Error On Deployment
ItemNotFound
{
"error": {
"error": {
"code": "itemNotFound",
"message": "The resource could not be found."
}
}
}This usually means BASE_DIRECTORY does not point to an existing OneDrive folder.
Check these items:
- The folder exists in the OneDrive account configured by
USER_PRINCIPAL_NAME. BASE_DIRECTORYstarts with/.- The OAuth account is the same account that owns or can access that folder.
403 After Deployment
The app cannot find valid OAuth tokens yet, or Redis is unavailable.
Check these items:
REDIS_URLexists in Vercel production environment variables.- The project was redeployed after
REDIS_URLwas added. - OAuth setup was completed on the deployed site.
Upload Permission Denied
This happens when the stored OAuth token does not include write permission.
Add Files.ReadWrite.All, clear the old Redis/KV tokens, redeploy, and authenticate again.
Error 504
504 errors are usually caused by a slow Microsoft Graph response, an invalid Redis connection, or a folder traversal that is too large for a serverless request.
Check REDIS_URL, retry the request, and avoid using folder zip download for very large folders.
API fetch error
Error message:
Failed to refresh Microsoft Graph API access token. Reset OAuth tokens and authenticate againThis happens when the stored Microsoft Graph access token or refresh token is invalid. Common causes:
- Access token expired and the refresh attempt failed
- Microsoft account password was changed
- Authorization for VercelDrive was revoked in the Microsoft account
- Azure App Registration was deleted, changed, or broken
- Stored tokens in Upstash are stale
Fix
Step 1: Check your Microsoft Entra App Registration.
Open Azure Portal — App registrations and verify the app used by VercelDrive still exists and is correctly configured. If the app registration was deleted or its configuration changed, recreate it and update the Vercel environment variables:
CLIENT_IDCLIENT_SECRET
See Advanced — Microsoft Entra App Registration for setup details.
Step 2: Clear stored tokens in Upstash.
- Open the Upstash Console: console.upstash.com
- Select the Redis database connected to your VercelDrive project.
- Open Data Browser.
- Find and delete these keys:
access_tokenrefresh_token- If you use
KV_PREFIX, delete<KV_PREFIX>access_tokenand<KV_PREFIX>refresh_tokeninstead.
- Use the
...menu next to each key and choose Delete Key.
Step 3: Redeploy.
- Open your Vercel project dashboard.
- In the sidebar, open Deployments.
- Find the latest Ready deployment.
- Hover the
...menu on the right and choose Redeploy.
Step 4: Authenticate again.
After redeployment, open your site. VercelDrive will show the OAuth setup wizard. Complete the 3-step authentication flow to store fresh tokens.