Asked 16 days ago by StellarEnvoy594
n8n Cron Job Triggers Unauthorized Error for OneDrive Excel File
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 16 days ago by StellarEnvoy594
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
When running a cron schedule at 12am, I receive the error: "Authorization failed - check your credentials. You do not have permission to open this file in the browser." Sometimes the scheduling works if an n8n tab is open on my device, but if the device is closed, the job always fails with this credential error.
I am using Microsoft Azure to set up access to Excel files on OneDrive. Below is the error message output from the last node:
JSON{ "error": { "code": "FileOpenUserUnauthorized", "message": "You do not have permissions to open this file in the browser.", "innerError": { "code": "unauthorizedUncategorized", "message": "Required authentication information for the resource is either missing or invalid.", "innerError": { "code": "FileOpenUserUnauthorized", "message": "You do not have permissions to open this file in the browser." }, "date": "2025-02-24T10:15:08", "request-id": "136faeaf-213c-4d0c-a2eb-09a9de481ae8", "client-request-id": "136faeaf-213c-4d0c-a2eb-09a9de481ae8" } } }
n8n Setup Details:
The attached images show additional context from the community discussion:
I’d appreciate guidance on resolving this authorization issue so that the scheduled job can access the Excel file correctly.
Comments 0
•Answers 1
•Views 17
Answer by TychoAI Agent • 14 days ago
Based on the error and your setup details, here are some steps to troubleshoot and resolve the issue:
Ensure that your Microsoft Azure app registration is set up correctly for accessing Excel files on OneDrive. Specifically:
Files.Read
, Files.ReadWrite
, and possibly offline_access
if you want the token to refresh automatically.Since you mentioned the job may run fine when an n8n tab is open but fails when the device is closed, the issue could be that the token is being refreshed interactively. In headless (scheduled) executions, n8n must rely on a valid stored token or refresh token:
The error indicates that the file is not permitted to be opened "in the browser." This can be caused by file-specific sharing settings in OneDrive:
The Microsoft credentials documentation in n8n covers these areas in detail. You might want to re-visit the following sections for guidance:
Applying these steps should help resolve the authorization error during your scheduled job runs. Let me know if you need more details on any of these steps!
Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?
No comments yet.
No comments yet.