laurent22/joplin · error · JoplinError

rejectedByTarget

rejectedByTarget

Error message

Cannot download because content is restricted by Dropbox

What it means

A JoplinError (code 'rejectedByTarget') thrown by the Dropbox driver's get/download method when the Dropbox API returns the 'restricted_content' error code. Dropbox returns this for content that has been flagged as restricted (DMCA, policy, or ToS violations); the driver converts it so the sync engine skips the item rather than treating it as a normal download failure.

Source

Thrown at packages/lib/file-api-driver-dropbox.js:163

			let response;
			if (!needsFetchWorkaround) {
				response = await fetchPath('POST', path);
			} else {
				// Use a random If-None-Match value to prevent React Native from using the cache.
				// Passing "cache: no-store" doesn't seem to be sufficient, so If-None-Match is set to a value
				// that will never match the ETag.
				//
				// Something similar is done for WebDAV.
				//
				// See https://github.com/laurent22/joplin/issues/10396
				response = await fetchPath('GET', path, { 'If-None-Match': `JoplinIgnore-${Math.floor(Math.random() * 100000)}` });
			}
			return response;
		} catch (error) {
			if (this.hasErrorCode_(error, 'not_found')) {
				return null;
			} else if (this.hasErrorCode_(error, 'restricted_content')) {
				throw new JoplinError('Cannot download because content is restricted by Dropbox', 'rejectedByTarget');
			} else {
				throw error;
			}
		}
	}

	async mkdir(path) {
		try {
			await this.api().exec('POST', 'files/create_folder_v2', {
				path: this.makePath_(path),
			});
		} catch (error) {
			if (this.hasErrorCode_(error, 'path/conflict')) {
				// Ignore
			} else {
				throw error;
			}
		}

View on GitHub (pinned to 2654b33620)

Solutions

  1. Check the affected file in the Dropbox web UI for restriction notices and follow Dropbox's remediation process.
  2. If the content is legitimate, file a counter-notice/review request with Dropbox.
  3. Remove or replace the restricted item in the sync target so sync can proceed.
  4. Consider switching to a different sync target (Joplin Server, local filesystem) if restrictions are persistent.
Defensive patterns

Strategy: try-catch

Type guard

import JoplinError from './JoplinError';
function isRejectedByTarget(e: unknown): e is JoplinError {
  return e instanceof JoplinError && (e as any).code === 'rejectedByTarget';
}

Try / catch

try {
  const content = await driver.get(path);
} catch (error) {
  if (isRejectedByTarget(error) && /restricted by Dropbox/.test(error.message)) {
    // skip the restricted item; inform the user it needs manual attention
    logger.warn('Dropbox restricted content', path);
    return;
  }
  throw error;
}

Prevention

When it happens

Trigger: During sync DELTA, apiCall('get', path) calls the Dropbox download endpoint which returns error code 'restricted_content'. The driver's hasErrorCode_ check matches and throws this JoplinError.

Common situations: A file in the Joplin app folder on Dropbox was flagged as restricted by Dropbox's automated policy enforcement; shared content subject to a takedown; region-specific content restrictions.

Related errors


AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12). Data as JSON: /api/errors/2a1e4922a47a8eb8. Report an issue: GitHub.