A SAS® Model Studio job fails with the following error after running in the background for approximately one hour:
You are not authorized to submit this request.
Note that the job runs successfully in SAS® Studio, and the job completes after running for more than two hours. The job also completes successfully when you subset the data that so it runs for less than one hour and execute it in the background.
| SAS Studio (Interactive) | ✅ Auto‑refresh via browser session | Long jobs work |
| Background / Batch Job | ❌ No refresh mechanism | Fails after ~1 hour |
An OAuth token expiration causes this issue. In SAS® Viya®, background jobs authenticate using an OAuth access token that SAS Logon issues.
Note that this issue does not involve a SAS Compute time-out and nor a Python error. The issue involves an authentication failure that happens mid‑job.
To circumvent this issue, complete any of the following workarounds:
SAS recommends this workaround for jobs that contain greater than one-hour workloads.
Instead of background compute jobs, expose the code as a job.
If allowed by your security team, complete the following steps:
Note: You can issue tokens with longer lifetimes
This workaround avoids the user‑session expiry entirely.
Checkpoint the pipeline:
Each stage finishes in less than one hour. Then, hand off.
This workaround is possible, but note the following: