Skip to content

Deployment troubleshooting

Stop at the failed check and fix that step. Do not switch setup paths, expose secrets, weaken origin checks, or alter an existing database. The install commands support fresh deployments only; updating a running backend is a separate procedure (see below).

SymptomCheckSafe recovery
Wrangler says login is requiredThe saved OAuth login is absent or unusableRun pnpm exec wrangler login in an interactive terminal, finish browser authorization, then repeat pnpm exec wrangler whoami.
R2 creation is rejectedR2 is not active for the accountActivate R2, then retry.
D1 or R2 is not foundAccount, resource name, or D1 ID differsCompare the live resources with the private configuration. Do not create duplicates blindly.
Preflight reports a missing secretOne of the three Worker secrets is absentComplete the backend secret setup, then rerun preflight.
pnpm vizoalica install says a database or bucket "already exists"This is not a first install: the names are takenAnswer "update" to deploy over it, or pass --database, --bucket, and --worker-name to install alongside it. It never adopts existing data.
pnpm vizoalica install says R2 is not enabledR2 is not activated for the accountActivate R2 in the Cloudflare dashboard (billing details may be requested), then rerun. Nothing was left behind.
A first install stopped after the Worker was createdAn interrupted install; some secrets may be missingRun pnpm vizoalica backend, answer "update": it generates only the secrets that are missing and shows them.
pnpm vizoalica connect says the Worker rejected the secretThe value is not the current VIZOALICA_ADMIN_SECRETUse the administrator secret you saved, not the token or digest one. If it was rotated, use the newest saved value.
pnpm vizoalica demo says the token secret does not matchThe value is not the current VIZOALICA_TOKEN_SECRETUse the token secret you saved. pnpm vizoalica demo --remove deletes any partial sample first.
Preflight or apply reports an existing schemaThe D1 target is not fresh: deploy:check and deploy:apply are first-install commandsFor a first install, select a new empty D1 database. To update a running backend, use Update an existing backend. Never repair or delete the existing database.
pnpm vizoalica purge-deleted fails with HTTP 404The deployed Worker predates the purge endpointUpdate the backend, then rerun the dry run.
Console returns 403Browser origin is missing or differsUse the exact printed loopback URL. Do not disable provenance checks.
Console Worker call returns 401Configuration mode and startup command may not matchRun pnpm vizoalica status. Check whether the file is direct-secret or onecli-managed, then whether its corresponding startup command was used. Only then check hostname, secret freshness, Authorization / Bearer {value} format, and OneCLI grant.
OneCLI gateway cannot resolveA container-only address was configuredRerun pnpm vizoalica setup with the host-reachable gateway, normally 127.0.0.1:10255, then run pnpm vizoalica doctor.
Pages upload fails with 8000013A proxy may have replaced Wrangler's upload tokenUse the native Cloudflare Pages path below. Do not add unrelated permissions.
Deployment times outRemote state is unknownInspect D1 migration state and Worker deployment history before retrying.
SDK URL returns HTMLThe bundle was not copied to the deployed outputRun pnpm browser-sdk:build, copy vizoalica.js, and redeploy.
Loader URL returns HTMLThe dynamic loader was not copied to the deployed outputBuild and copy vizoalica-loader.js, then redeploy without enabling the static path too.
Config URL returns 503One or more public variables are missing or invalidReview all six public values, exact project/source scope, HTTPS endpoints, and same-origin token URL; then redeploy.
Config URL returns fallback HTMLThe Function or _routes.json merge was not deployedKeep config.json.ts beside the token Function, merge the config route, and deploy from the real site root.
Analytics initializes twiceStatic and dynamic paths are both enabledRemove one path, redeploy, and verify a single loader/SDK element before resuming collection.
Token URL returns HTMLThe Function was not discoveredDeploy from the site root with --cwd; keep functions/ beside, not inside, public/.
Ingest returns 401 missing_token or malformed_tokenThe request carried no valid signed token; it is rejected before any lookupConfirm the website's token endpoint works and its VIZOALICA_TOKEN_SECRET matches the Worker's. An unknown source key with no token also reports 401.
Ingest returns 429 rate_limitedThe optional edge rate limiter throttled this client and sourceWait for Retry-After. If legitimate visitors share one address, raise limit in the [[ratelimits]] block and redeploy.
Token Function returns 503Secret or server variables are missingSet the production Pages secret and variables, then redeploy.
Token Function returns 403Website origin or referrer differsUse the registered production origin and a same-origin referrer.
Worker rejects the tokenSigning secret or source scope differsMatch the Worker and issuer secret, project ID, source ID, and origin.
Push did not update the websiteThe project uses Direct Upload or another production branchInspect its deployment mode and commit; use Wrangler for Direct Upload.
Console counts remain zeroThe event was never acceptedGrant consent, confirm the Worker batch returns 202, then refresh the same source's 24h view.

Dynamic configuration never falls back to another endpoint or identifier. A failed fetch, malformed document, CSP block, or SDK load must leave the website usable and send no analytics; repair the configuration rather than adding a default destination.

Local console authorization recovery

Do not switch modes merely by changing the startup command. Switching between a private local credential and OneCLI requires intentionally recreating the configuration with the corresponding setup procedure.

  • Expired browser session: select Reconnect. No credential repair or process restart is normally required.
  • onecli-managed launched directly: stop it and run pnpm vizoalica console. The direct API command is the wrong startup path and refuses a detected placeholder.
  • Worker rejects the current credential: use pnpm vizoalica status, then repair or rotate the direct credential, or correct the OneCLI card and grant. Verify again before reopening the UI.

OneCLI and Pages uploads

Some OneCLI proxy configurations replace Wrangler's short-lived Pages upload authorization and cause error 8000013. Deploy Pages from a fresh terminal using native Cloudflare login, as described in website activation. This does not change the OneCLI choice for the local operator console. If policy forbids native Pages login, stop and have the OneCLI owner correct the gateway; do not copy authorization headers or disable injection globally.

Deleted data reappears or a purge seems stuck

Deleting a website or project is permanent: the daily run removes its data, or pnpm vizoalica purge-deleted --apply does it immediately (dry run without --apply). A run is bounded and reports complete: false internally until everything is gone; the command repeats itself up to 100 times. If it still stops, rerun it; the purge resumes where it stopped and never touches anything that is not soft-deleted. See Deleted websites and projects.

Interrupted backend deployment

A local timeout does not prove a remote operation failed. Inspect the D1 migration list and Worker deployment history first. For the optional profile workflow, also run deploy:status for the plan ID. Retry a mutation only after the target state is known; a recorded baseline intentionally prevents a second fresh-schema apply.

Released under the MIT License. Visitor data stays in your own Cloudflare account.