Skip to content

Error codes

Every code the routes, the upload route and the agent tools can answer, grouped by where it comes from, with its HTTP status and what to do about it.

A failed route answers with EmDash’s error envelope: an HTTP status and a body holding error.code and error.message, and sometimes error.details. An MCP tool answers with a tool error whose text starts with [CODE] message, and the code in _meta.code (see Agent tools). The admin shows its own sentence for each code it knows; it’s quoted below where it helps.

Some codes carry details:

  • problems: a list of what’s wrong, as on INVALID_TEMPLATE, INVALID_SOURCE and TEMPLATE_PROBLEMS.
  • code: the reader’s own code when a source couldn’t be read (csv_syntax, source_syntax, unsupported_encoding, xml_dtd_not_allowed, invalid_source).
  • revision: the current revision, on TEMPLATE_CHANGED and SCHEDULE_CHANGED.
  • scheduleIds: the schedules in the way, on TEMPLATE_IN_USE and SOURCE_IN_USE.

Codes are stable; messages may change between releases. Match on the code.

EmDash answers these before or around the plugin’s own code.

Code Status Meaning What to do
UNAUTHORIZED, NOT_AUTHENTICATED 401 No signed-in user, or the session ended. Sign in again, or send a valid token.
FORBIDDEN 403 The user lacks import:execute. “Only administrators can import.” Use an Administrator’s account. See Permissions.
CSRF_REJECTED 403 A session request without the X-EmDash-Request: 1 header. Send the header with every state-changing request.
VALIDATION_ERROR 400 The input doesn’t match the route’s schema, or sets both or neither of two exclusive fields (text and sourceId, uploadId and sourceId). Fix the request; the message says which field.
INVALID_PLUGIN_REQUEST 400, 413 The body couldn’t be read, or is too large: 2 MiB on routes that take a template or dry_run text, 1 MiB on sources/paste, 16 KiB on schedule routes. Send a smaller body. For a large file, use the upload route.
NOT_FOUND 404 The job, template, source, schedule or credential doesn’t exist. Check the id; it may have been deleted or removed by retention.
INTERNAL_ERROR 500 An unexpected error. Try again. On next_batch, wait 5 seconds; stop after 3 failures in a row.
STORAGE_INDEXES_NOT_READY 503 EmDash is still building the plugin’s storage indexes on a fresh runtime. Try again in a moment.
PLUGIN_SYNC_ERROR 503 EmDash couldn’t read the plugin’s state, or the plugin failed to load. Try again in a moment. If it persists, check the server log.
TRANSFER_IMPORT_IN_PROGRESS 503 An EmDash site import is running. Imports and their schedules wait until it ends. Try again after the site import finishes.
TRANSFER_FENCE_CHECK_FAILED 503 Flux Importer or EmDash couldn’t check whether a site import is running, so it refused to write. Try again shortly.

From POST /_emdash/api/fluximporter/uploads, the streamed upload route fluxImporterRoutes() adds.

Code Status Meaning What to do
FORBIDDEN 403 The user lacks import:execute. Use an Administrator’s account.
UNSUPPORTED_SOURCE 415 The filename query parameter doesn’t end in .csv, .json, .jsonl, .ndjson, .xml or .xlsx. Name the file with a supported extension.
TOO_LARGE 413 The file is over the limit: maxSourceBytes (default 50 MiB), or 10 MiB for .xlsx. Split the file, or raise maxSourceBytes. See Configuration.
LENGTH_REQUIRED 411 On Cloudflare Workers, the request has no Content-Length. Send the file’s length; the admin always does.
EMPTY_BODY 400 The request has no body, or the file is empty. Upload a file with data.
NOT_CONFIGURED 500 EmDash has no storage configured. Configure storage in EmDash’s options.

Reading files and pasted text, and fetching URL sources.

Code Status Meaning What to do
INVALID_SOURCE 400 The data couldn’t be read with the format settings given: a CSV or JSON syntax error, a missing records path, a file that isn’t UTF-8, an XML DTD. details.code names the reader’s code; the message gives the byte offset. Check the format, the records path and the encoding. See Source formats.
INVALID_FORMAT 400 Excel data sent as text, in a paste or in dry_run. “XLSX can only be uploaded as a file.” Upload the workbook, or use a URL source.
EMPTY_BODY 400 The pasted text is empty or only whitespace. Paste some data.
TOO_LARGE 413 Text over 1 MiB given to dry_run or templates/suggest, a URL source’s reply over maxSourceBytes, or an Excel sheet that converts to more than the limit. Upload the file instead, or make it smaller.
NO_SOURCE_KEYS 400 The sample has no column or path to map. Check the records path, or the file’s header row.
UPLOAD_NOT_FOUND 404 The uploaded file is no longer staged, for example after retention removed it. Upload it again.
SOURCE_NOT_FOUND 404 The saved source a schedule or a suggestion names doesn’t exist. Choose another source.
URL_BLOCKED 400 The URL isn’t allowed: not http or https, longer than 2,048 characters, with a user name or password, or a host that resolves to a private or loopback address. Use a public address. See URL sources.
FETCH_FAILED 502 The address couldn’t be reached: DNS failed, the connection failed or it timed out. Check the URL and that the host is up.
HTTP_ERROR 502 The address answered with an error status. The message gives it. Check the URL and its credential.
TOO_MANY_REDIRECTS 502 The address redirected too many times. Use the final URL.
LENGTH_REQUIRED 502 On Workers, the reply has no usable Content-Length and is larger than Workers can buffer. Serve the feed with a Content-Length, or run on Node.
CREDENTIAL_MISSING 409 The credential the source uses no longer exists. Add the credential again, or edit the source.
CREDENTIALS_UNAVAILABLE 500 The stored credentials can’t be read, usually because EMDASH_ENCRYPTION_KEY is missing or changed. Set the key the credentials were saved with.
CONFLICT 409 A source with that name exists, or the source or credentials changed during the request. Choose another name, or try again.
SOURCE_IN_USE 409 A schedule reads this source, so it can’t be deleted. details.scheduleIds names the schedules. Delete or change the schedules first.
PROVIDER_MISSING 409 From version 0.9.0. No installed package adds the source’s kind, for example after Flux Importer Pro was removed. Install the package again, or delete the source.
BAD_CONFIG 400 From version 0.9.0. A source’s settings, or a credential they name, aren’t valid for its kind. Fix the settings, or add the credential.
PROVIDER_FAILED 400 or 502 From version 0.9.0. The package that adds the source’s kind failed while checking its settings (400) or fetching (502). Check the source’s settings and its server.
PROVIDER_BAD_RESULT 502 From version 0.9.0. The package that adds the source’s kind returned a fetch result the importer can’t use. Nothing is kept. Update the package.
Code Status Meaning What to do
INVALID_TEMPLATE 400 The template doesn’t pass the shape check, or doesn’t fit the collection. details.problems lists why. Fix each problem. See Template format.
TEMPLATE_NOT_FOUND 404 The template a job, a schedule or schema/apply names doesn’t exist. Choose another template.
TEMPLATE_CHANGED 409 The template is at another revision than the one given. details.revision is the current one. Read the template again. From start_import, run a new dry run.
TEMPLATE_TOO_LARGE 413 The template is over 256 KiB of JSON. Make it smaller.
UNSUPPORTED_TEMPLATE_VERSION 400 The template’s version isn’t 1. Use a template this version of Flux Importer can read.
NAME_TAKEN 409 A template or schedule with that name exists. details.id names it. Choose another name.
COLLECTION_NOT_FOUND 404 The collection doesn’t exist. Choose another collection, or create it.
COLLECTION_MISMATCH 400 The base template imports into another collection. Use a template for this collection.
OWNER_IN_USE 409 A template that tracks missing entries uses an owner another template or import already uses in that collection and locale. Import it with a new owner name. See Missing entries.
REMAP_REQUIRED 409 From version 0.9.0. A template file made on another platform needs a collection, a locale, or re-mapped fields or taxonomies. details lists what to ask. Send the same file again with remap. Two answers that map to one name are refused INVALID_TEMPLATE; an answer for something the template doesn’t map, or a missing answer, is refused VALIDATION_ERROR. See Template format.
REMAP_UPDATE_FIELDS 400 From version 0.9.0. The re-map answers drop every field in rules.updateFields. Choose the fields to update in remap.updateFields.
INVALID_FILE 400 The uploaded template file isn’t one Flux Importer can read. Export the template again.
UNSUPPORTED_FILE_VERSION 400 The template file was made by a newer version of Flux Importer. Update Flux Importer.
TEMPLATE_IN_USE 409 A schedule runs this template, so it can’t be deleted. details.scheduleIds names the schedules. Delete or change the schedules first.
INVALID_CURSOR 400 The list cursor is no longer valid; the list changed while it was being read. Start the list again without a cursor.
Code Status Meaning What to do
INVALID_TEMPLATE 400 The template doesn’t fit the source or the schema when the job is created: a field that doesn’t exist, a required field it doesn’t map, a taxonomy that isn’t attached, or translationOf without i18n. details.problems lists why. Fix the template, or the collection.
INVALID_OPTIONS 400 A job option isn’t valid: batchSize outside 1 to 500, budgetMs outside 500 to 25000, publishAt without publishing, or a missing-entries option the template doesn’t allow. Fix the option.
INVALID_SOURCE 400 The job’s source block, or the data itself, can’t be read. Check the format settings.
INVALID_TRANSITION 409 The job can’t do that in its current state, such as rolling back a running job, a dry run or a job already rolled back. Reload the job and check its status. See Job states.
CONFLICT 409 The job changed during the request. Try again.
LOG_TOO_LARGE 413 The job’s log is over 8 MiB as one CSV. Download it per outcome, such as the failed records only.

A job that stops on an error keeps it in error, as { code, message }, in lowercase:

Code Meaning What to do
source_missing The job’s staged file is gone. Start a new import.
invalid_template The template no longer fits the collection, for example after a field was deleted. Fix the template or the schema, then start a new import.
internal Three batches in a row ended in an unexpected error. Resume the job to try again.
rollback_original_gone A rollback’s original job, and its journal, is gone or being deleted. Nothing can be rolled back any more.
collection_missing The collection was deleted during the job. Recreate it, or start a new import elsewhere.
source_id_field_invalid The collection’s flux_source_id field isn’t usable. Check the field in the collection’s schema.
media_config EmDash can’t store media at all. Check EmDash’s storage configuration.
csv_syntax, source_syntax, unsupported_encoding, xml_dtd_not_allowed, invalid_source The data couldn’t be read at a byte offset, given in the message. Fix the file and start a new import.

Per-record errors, such as term_not_found or reference_not_found, fail one record, not the job. They’re listed in Job states and record outcomes.

Code Status Meaning What to do
SCHEDULE_CHANGED 409 The schedule is at another revision than the one given. details.revision is the current one. Open the schedule again.
SCHEDULE_BUSY 409 The schedule is importing right now. details.jobId names the job. Wait for the import to finish, or cancel it.
SCHEDULE_DISABLED 409 The schedule is paused, so it can’t run now. Resume it first.
SCHEDULE_LIMIT 409 The site already has 20 schedules. Delete one first.
INVALID_CRON 400 The cron expression isn’t valid. The message says why. Use a five-field expression, in UTC. See Schedules.
MISSING_REQUIRED 400 The template tracks missing entries, so the schedule must say what to do about them. Choose a missing-entries option for the schedule.
INVALID_OPTIONS 400 A missing-entries option the template doesn’t allow, or a threshold above the template’s. A schedule can lower the template’s threshold, never raise it.
TEMPLATE_PROBLEMS 409 The template doesn’t fit the site, so it can’t be scheduled. details.problems lists why. Fix the template first.
TEMPLATE_NOT_FOUND, SOURCE_NOT_FOUND 404 The template or source the schedule names doesn’t exist. Choose another one.

When a scheduled run can’t start or ends badly, the schedule pauses itself. pause.reason is one of these codes; the admin shows the sentence after “Paused:”.

Reason The admin says
template_gone its template was deleted
template_changed its template changed after it was scheduled
source_gone its source was deleted
source_changed its source’s address or credential changed
creator_gone the person who turned it on can no longer import
invalid_template its template no longer fits the site
credential_missing its source’s credential no longer exists
url_blocked its source’s address cannot be fetched from the site
too_large the feed was larger than the site accepts
fetch_failed the feed could not be fetched several times in a row
job_failed an import it ran failed
cancelled an import it ran was cancelled
rolled_back an import it ran was rolled back
missing_refused too many entries were missing from the feed
empty_feed the feed was empty

Fix the cause, then resume the schedule. A launch that fails also records an error code in lastLaunch.errorCode, such as TEMPLATE_CHANGED, SOURCE_CHANGED or CREATOR_GONE.

From the MCP tools and their routes, jobs/plan, jobs/start, jobs/step and jobs/status. See Imports from AI agents.

Code Status Meaning What to do
INSUFFICIENT_SCOPE — The token lacks mcp:tools:fluximporter or mcp:tools. The admin scope doesn’t cover plugin tools. Give the token the plugin scope.
INSUFFICIENT_PERMISSIONS — The token’s user isn’t an Administrator. Use an Administrator’s token.
NOT_A_DRY_RUN 400 start_import was given a job that isn’t a dry run made with dry_run. Run dry_run, and start that.
DRY_RUN_INCOMPLETE 409 The dry run isn’t completed, or is being deleted. details.status names its status. Finish it with next_batch, or run a new dry run.
DRY_RUN_USED 409 The import started from this dry run was rolled back. details.jobId names it. Run dry_run again.
JOB_NOT_AGENT 403 next_batch was given a job that dry_run or start_import didn’t create: an Administrator’s import, a scheduled run or a rollback. Follow it with import_status.
SOURCE_FILE_MISSING 404 The data to plan from, or the dry run’s data, is no longer stored. Run dry_run again.
CONFLICT 409 start_import kept losing a race with another call for the same dry run. Call it again; it returns the same job.
TEMPLATE_CHANGED 409 The template was edited since the dry run, or isn’t at templateRevision. Run dry_run again and review the new plan.

The MCP server also answers MEDIA_USAGE_ACTIVATION_IN_PROGRESS and MEDIA_USAGE_ACTIVATION_CHECK_FAILED while EmDash activates media usage tracking. Try again shortly.

The suggestion route never fails because of the AI provider. A provider that can’t be used, fails or times out gives name-matching suggestions with a warning code such as ai_timeout or ai_rate_limited. Those warnings are explained in AI mapping.