Areca Docs

Errors and limits

What each SDK and CLI error message means, how HTTP errors and 429 rate limits are reported, the API error format, and the site API limits.

This page explains the errors you can see from the SDK and the areca command, and the limits that apply to the site API. Use it when a command fails or a request is refused.

The CLI prints each error message to stderr and exits with code 1. The SDK throws an Error with the same message. Messages are shown exactly as the code produces them. Values in angle brackets, such as <key>, are replaced with your values.

Identifier rules

Collection keys, site content keys and field keys are identifiers. The SDK checks them before it sends anything to the CMS or writes any file. An identifier must:

  • Start with an ASCII letter.
  • Contain only ASCII letters, digits, _ and -.
  • Be 64 characters or fewer.
  • Not be a reserved name. Reserved names are matched without regard to case, so MANIFEST and Con are rejected too.

A field's collection and after values follow the same rules.

Reserved names for every key and field

No collection, site content section or field may use these names:

__proto__, prototype, constructor, manifest, con, prn, aux, nul, com1, com2, com3, com4, com5, com6, com7, com8, com9, lpt1, lpt2, lpt3, lpt4, lpt5, lpt6, lpt7, lpt8, lpt9

manifest is the name of the pulled manifest file. __proto__, prototype and constructor would clash with JavaScript object properties. The com and lpt names are Windows device names.

Reserved names for collections and site content

A collection key or a site content key may not be one of these names. The SDK compares the camelCase form of the key, so preview-globals and preview_globals count as previewGlobals:

resolve, href, preview, globals, previewGlobals, previewFrom, in, languages, matchLocale

These are the members of the generated content object. Field keys may use them: a field called href or preview is fine.

Errors for identifiers

These messages come from areca manifest push, areca manifest pull, and areca pull. The SDK checks the names before any file is written.

MessageMeaningWhat to do
Unsafe collection or field identifier: manifestA collection, section or field name is reserved, or breaks the character rules.Rename it in your config and push again. See renaming keys.
Collection "globals" uses the reserved name "globals". resolve, href, preview, globals, previewGlobals, previewFrom, in, languages and matchLocale are reserved.A collection key is a reserved content name after camelCase.Rename the collection.
Global "preview-globals" uses the reserved name "previewGlobals". resolve, href, preview, globals, previewGlobals, previewFrom, in, languages and matchLocale are reserved.A site content key is a reserved content name after camelCase.Rename the section.
Collection keys blog-posts and blog_posts both map to "blogPosts". Rename one of them.Two collection keys have the same camelCase name.Rename one of them.
Collection identifiers differ only by case: Articles, articlesTwo collection keys differ only by letter case. Mac and Windows file systems treat them as one folder.Rename one of them.
Duplicate field identifier: titleTwo fields in one collection have the same key.Rename one of them.

Typed content errors

areca pull and pullContent also check names and values in camelCase. These checks run before anything is written. See typed content for the rules.

MessageMeaningWhat to do
Collection keys <a> and <b> both map to "<name>". Rename one of them.Two collection keys have the same camelCase name, such as blog-posts and blog_posts.Rename one of them in the config, push, and publish.
Field keys <a> and <b> in <collection> both map to "<name>". Rename one of them.Two field keys in one collection have the same camelCase name.Rename one of them, push, and publish.
Collection "<key>" uses a reserved name (resolve, href, preview, globals, previewGlobals, previewFrom, in, languages, matchLocale)createContent was given a collection with a reserved name.Rename the collection in areca.config.ts, then run areca pull again.
Publication does not match its schema:Each following line is <collection>/<slug>.<field>: <problem>, for example is required or must be a YYYY-MM-DD date. Up to 20 lines are listed, then ...and N more.Fix the entry in the CMS, or fix the schema and publish again.
Types output must not be a symbolic linkThe areca.gen.ts path is a symlink.Delete the symlink and pull again.

A warning, not an error, appears when the publication has no embedded schema: Publication <id> has no embedded schema; types use the current CMS schema. Go live again to embed it. The pull still succeeds.

Output path errors

areca pull, pullContent and readContent check that each collection file stays inside the output folder and is not a symbolic link.

MessageMeaningWhat to do
Output path escapes content directoryA file path would leave the output folder.Check the output folder and the collection keys.
Content output must not be a symbolic linkA collection file in the output folder is a symlink. The SDK refuses to follow it, so a link cannot send data to another file.Delete the symlink and run the command again.

A failed areca pull can leave the folder partly updated. See areca pull.

Configuration errors

These errors appear when a required setting is missing.

MessageWhere it comes fromWhat to do
Missing ARECA_CMS_URL. Set the ARECA_CMS_URL environment variable or pass cmsUrl to createArecaClient().Any command that calls the CMS, and createArecaClientSet ARECA_CMS_URL in .env.local.
Missing ARECA_SITE_TOKEN. Set the ARECA_SITE_TOKEN environment variable or pass siteToken to createArecaClient().Any command that calls the CMS, and createArecaClientSet ARECA_SITE_TOKEN.
Missing ARECA_SCHEMA_TOKEN. Set the ARECA_SCHEMA_TOKEN environment variable or pass schemaToken to createArecaClient().syncManifest, which is areca manifest pushSet ARECA_SCHEMA_TOKEN. The site token is never used in its place.
Config module <path> has no default export.The config file does not export a default valueAdd export default defineSiteContent({ ... }).
Failed to load TypeScript config <path> via native import (...)Node could not load the TypeScript configFollow the suggested tsx command in the message. See areca manifest push.

Environment variables are read from .env.local and .env, and from the shell. See CLI reference for the precedence rules.

Setup errors

These errors come from areca init.

MessageMeaningWhat to do
Missing --cms-url, --token. Pass --cms-url, --token, and --site-key, or run areca init in a terminal to enter them interactively.You used --yes, or no terminal is attached, and a required value is missing. The message lists only the flags that are missing.Pass the flags, or run areca init in a terminal.
Invalid CMS URL: <value>. Enter a valid URLThe URL cannot be parsed.Use a full URL, such as https://cms.example.com.
Invalid CMS URL: <value>. Enter a valid http(s) URLThe URL uses a scheme other than http or https.Use http:// or https://.
Invalid site key: <value>. Use a lowercase slug like acme-site (letters, numbers, hyphens)The site key does not match the pattern.Use lowercase letters, digits and single hyphens. Copy the key from the CMS.
No package.json found. Run areca init from the site root.init ran in a folder without package.json.Run init in your site project's root.
Invalid JSON in package.json. or Invalid package.json. Expected a JSON object.package.json is not a valid JSON object.Fix the file. Nothing is written until it is valid.

When you cancel the interactive init prompts, the command prints Operation cancelled. and exits with 0.

Publication and site key errors

No publication

No publication exists for this site. Publish content in the CMS before running areca pull.

This appears when the site has never gone live, or the CMS returns a 404 for the snapshot. The CMS's own message, No publication exists, is added after it when present. Publish the site in the CMS, then run areca pull again.

Missing site key

No siteKey found. <path> does not exist and ARECA_SITE_KEY is not set. Run areca init first.

This comes from areca manifest pull when the config file is missing, or has no siteKey, and ARECA_SITE_KEY is not set. Run areca init, or set ARECA_SITE_KEY.

Manifest overwrite

Remove collection legacy in ./areca.config.ts. Re-run with --yes to confirm.
<path> already defines 2 collection(s). Re-run with --yes to overwrite it.

areca manifest pull stops when it cannot ask you and the pull would remove a collection, a site content section, a field, a language, or the main language. The first message names the removal. It also stops before replacing a populated config that it did not write; the second message is for that case. Re-run with --yes, or run the command in a terminal and confirm the prompt.

Failed to reach CMS

Failed to reach CMS at https://cms.example.com. fetch failed. If the CMS is up, publish content before running areca pull.

The request never got an HTTP response. The message includes the CMS URL and the network error. Check the following:

  • The ARECA_CMS_URL value, including the protocol and port.
  • That the CMS is running and reachable from this machine.
  • Any proxy or VPN in the way.

The last sentence is the same for every command, so it can be misleading. A failed areca manifest push has nothing to do with publishing.

HTTP errors

When the CMS responds with an error status, the SDK throws a message in this form:

<action> (<status>): <CMS error message>

If the CMS response has no JSON error message, the message ends after the status, for example Failed to fetch snapshot (500).

The actions are Failed to sync manifest, Failed to fetch manifest, Failed to fetch snapshot and Failed to fetch preview.

StatusExample messageMeaningWhat to do
401Failed to fetch manifest (401): UnauthorizedThe token is missing, wrong, or was rotated. For a preview, the token is invalid or has expired.Check ARECA_SITE_TOKEN. If it was rotated, copy the new token into .env.local. For a preview, open the link again.
404No publication exists for this site... (snapshot)No publication exists.See No publication.
404Failed to fetch preview (404): Not foundThe entry or collection no longer exists.Open the preview again from the CMS.
413Failed to sync manifest (413): Manifest is larger than 262144 bytesThe content definitions are too large.Split or shorten the definitions. See Payload limits.
429Failed to fetch snapshot (429): Too many requestsRate limit reached.Wait, then try again. See Rate limits and 429 responses.
5xxFailed to fetch snapshot (503)The CMS had a server-side problem.Check the CMS's health with /api/health/ready, and try again.

Rate limits and 429 responses

When you exceed the site API limit, the CMS returns 429. It also sends a Retry-After header with the number of seconds until the window resets. The SDK formats the message, for example Failed to fetch manifest (429): Too many requests.

The SDK does not retry, and it does not read Retry-After. Its errors contain only the message text. If your build needs to retry, catch the error in your code and wait before you call again. To use the exact Retry-After value, call the HTTP API directly.

import type { ArecaClient } from '@areca-cms/site-sdk'

// The SDK does not retry. This helper retries a 429 after a fixed 60 seconds,
// which matches the length of the rate-limit window.
async function fetchSnapshotWithRetry(client: ArecaClient, attempts = 3) {
  for (let attempt = 1; ; attempt += 1) {
    try {
      return await client.fetchSnapshot()
    } catch (error) {
      const rateLimited = error instanceof Error && error.message.includes('(429)')
      if (!rateLimited || attempt >= attempts) throw error
      await new Promise((resolve) => setTimeout(resolve, 60_000))
    }
  }
}

API error body

The CMS returns errors as JSON with an error string:

{ "error": "Unauthorized" }

Some 400 responses also have an issues value that lists the problems in the request:

{
  "error": "Invalid body",
  "issues": [
    { "code": "invalid_type", "path": ["collections", "articles", "fields", 0, "label"], "message": "Invalid input" }
  ]
}

The SDK reads only the error string. It does not show issues. To see them, call the HTTP API directly. The text of each issue depends on the problem.

Responses that are not JSON have no message, so the SDK shows only the status.

Site API limits

These limits apply to the site API that your build calls.

LimitValueApplies to
Requests per minute per token300GET /api/sites/manifest, POST /api/sites/manifest, GET /api/sites/snapshot/current
Requests counted per IP addressUsed when a request has no bearer tokenSame endpoints
Readiness and liveness probesNot limited/api/health and /api/health/ready
Preview requestsNot limited by the site API limitGET /api/sites/preview
Public file requestsNot limited by the site API limitGET /api/assets/file/...

When a limit is reached, the response is 429 with Retry-After. See Rate limits for every limit in the CMS, and for how the limits are counted.

Payload limits

LimitValue
Manifest body256 KiB
Collections per site100
Fields per collection100
Route pattern500 characters
Entry data, all fields together1 MiB

Field-level limits, such as the 1,000-character limit for short text, are listed in Field types.

On this page