{"record":{"id":"2a1e4922a47a8eb8","repo":"laurent22/joplin","slug":"rejectedbytarget-2a1e49","errorCode":"rejectedByTarget","errorMessage":"Cannot download because content is restricted by Dropbox","messagePattern":"Cannot download because content is restricted by Dropbox","errorType":"exception","errorClass":"JoplinError","httpStatus":null,"severity":"error","filePath":"packages/lib/file-api-driver-dropbox.js","lineNumber":163,"sourceCode":"\t\t\tlet response;\n\t\t\tif (!needsFetchWorkaround) {\n\t\t\t\tresponse = await fetchPath('POST', path);\n\t\t\t} else {\n\t\t\t\t// Use a random If-None-Match value to prevent React Native from using the cache.\n\t\t\t\t// Passing \"cache: no-store\" doesn't seem to be sufficient, so If-None-Match is set to a value\n\t\t\t\t// that will never match the ETag.\n\t\t\t\t//\n\t\t\t\t// Something similar is done for WebDAV.\n\t\t\t\t//\n\t\t\t\t// See https://github.com/laurent22/joplin/issues/10396\n\t\t\t\tresponse = await fetchPath('GET', path, { 'If-None-Match': `JoplinIgnore-${Math.floor(Math.random() * 100000)}` });\n\t\t\t}\n\t\t\treturn response;\n\t\t} catch (error) {\n\t\t\tif (this.hasErrorCode_(error, 'not_found')) {\n\t\t\t\treturn null;\n\t\t\t} else if (this.hasErrorCode_(error, 'restricted_content')) {\n\t\t\t\tthrow new JoplinError('Cannot download because content is restricted by Dropbox', 'rejectedByTarget');\n\t\t\t} else {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync mkdir(path) {\n\t\ttry {\n\t\t\tawait this.api().exec('POST', 'files/create_folder_v2', {\n\t\t\t\tpath: this.makePath_(path),\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (this.hasErrorCode_(error, 'path/conflict')) {\n\t\t\t\t// Ignore\n\t\t\t} else {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/laurent22/joplin/blob/2654b33620775080d1d59c552259d41e33dad3d2/packages/lib/file-api-driver-dropbox.js#L145-L181","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the affected file in the Dropbox web UI for restriction notices and follow Dropbox's remediation process.","If the content is legitimate, file a counter-notice/review request with Dropbox.","Remove or replace the restricted item in the sync target so sync can proceed.","Consider switching to a different sync target (Joplin Server, local filesystem) if restrictions are persistent."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"import JoplinError from './JoplinError';\nfunction isRejectedByTarget(e: unknown): e is JoplinError {\n  return e instanceof JoplinError && (e as any).code === 'rejectedByTarget';\n}","tryCatchPattern":"try {\n  const content = await driver.get(path);\n} catch (error) {\n  if (isRejectedByTarget(error) && /restricted by Dropbox/.test(error.message)) {\n    // skip the restricted item; inform the user it needs manual attention\n    logger.warn('Dropbox restricted content', path);\n    return;\n  }\n  throw error;\n}","preventionTips":["Treat Dropbox 'restricted_content' as unfixable by the client — surface it to the user.","Review Dropbox notifications/email for the flagged file.","Consider a different sync target if restrictions recur."],"tags":["dropbox","sync","restricted-content","rejectedbytarget","policy"],"backgroundTag":null,"analyzedSha":"2654b33620775080d1d59c552259d41e33dad3d2","analyzedAt":"2026-08-12T14:26:46.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}