laurent22/joplin · error · Error
User is not authenticated
Error message
User is not authenticated
What it means
Thrown by SyncTargetDropbox.initSynchronizer() when isAuthenticated() returns false. The Dropbox sync target needs a valid OAuth token stored under Setting `sync.<id>.auth`; without it the Synchronizer cannot be constructed and Dropbox sync cannot start.
Source
Thrown at packages/lib/SyncTargetDropbox.ts:73
});
api.on('authRefreshed', (auth: string|null) => {
this.logger().info('Saving updated Dropbox auth.');
Setting.setValue(`sync.${SyncTargetDropbox.id()}.auth`, auth ? auth : null);
});
const authToken = Setting.value(`sync.${SyncTargetDropbox.id()}.auth`);
api.setAuthToken(authToken);
const appDir = '';
const fileApi = new FileApi(appDir, new FileApiDriverDropbox(api));
fileApi.setSyncTargetId(SyncTargetDropbox.id());
fileApi.setLogger(this.logger());
return fileApi;
}
public async initSynchronizer() {
if (!(await this.isAuthenticated())) throw new Error('User is not authenticated');
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
}
}
View on GitHub (pinned to 2654b33620)
Solutions
- Open Joplin sync settings, pick Dropbox, and complete the OAuth authorisation flow again.
- If auth keeps failing, revoke the app from Dropbox's Connected Apps page, then re-authorise in Joplin.
- Confirm system clock is correct — large skew can invalidate OAuth responses.
- After successful auth, retry the sync.
Example fix
// before: initSynchronizer() throws 'User is not authenticated' // after: in Joplin UI // Tools -> Synchronisation -> Synchronisation target: Dropbox // Follow the OAuth link, grant access, then click 'Synchronise'.
Defensive patterns
Strategy: validation
Validate before calling
// Check the stored Dropbox auth token exists and is non-empty before initSynchronizer.
const token = Setting.value(`sync.${SyncTargetDropbox.id()}.auth`);
if (!token) throw new Error('Dropbox not authenticated — run the OAuth flow first'); Type guard
const hasAuthToken = () => !!Setting.value(`sync.${SyncTargetDropbox.id()}.auth`); Try / catch
try { await syncTarget.initSynchronizer(); }
catch (e) { if (/User is not authenticated/.test(e.message)) { /* trigger OAuth re-flow */ } else throw e; } Prevention
- Gate the 'Start sync' UI on isAuthenticated() to avoid the throw entirely.
- Periodically refresh the token; surface expiry to the user before it lapses.
When it happens
Trigger: User enables Dropbox sync but has not completed the OAuth flow, or the stored token was revoked/expired. initSynchronizer() calls isAuthenticated() which returns false.
Common situations: First-time setup where the user skipped the auth wizard; token revoked via Dropbox app settings; long- unused install whose token expired; clock skew invalidating token checks.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- User is not authenticated
- rejectedByTarget
- Batch delete failed? ${JSON.stringify(check)}
- No item with ID ${itemId}
- Please specify the sync target path.
AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12).
Data as JSON: /api/errors/5546bbf75faf1a28.
Report an issue: GitHub.