tapstateDocs
Self-hostingServer administration

Troubleshoot self-hosted deployments

Diagnose tapstate CLI exit codes, workspace validation errors, local Docker quickstart issues, connector registration, and server failures

Use this guide to diagnose .tap.yml workspaces, the CLI, the local Docker playground, connector JAR registration, and self-hosted server failures. For Cloud workflows and shared connector, CDC, or transform diagnostics, see Troubleshoot a tapstate configuration.

CLI exit codes and version checks

Read the command result

Tapstate commands use these exit codes:

CodeMeaning
0Success
1A coded domain diagnostic or refused operation
2Invalid command usage
3Unavailable in this context, not connected, or not implemented

Use tapstate --help to inspect the commands in your installed version. In the current preview, use tapstate help <command> or tapstate <command> --help for a command's operands and options.

Text-mode results are written to standard output and usage or diagnostic messages are written to standard error. With -o json or -o yaml, the structured result, including validation diagnostics, is written to standard output. Preserve both streams and the exit code when collecting evidence.

CLI and server versions differ

The CLI and server are separate builds. When connect reaches a server on a different version, the CLI reports cli.version-mismatch and keeps the connection open. Run the following command in the same session to confirm both values:

version

Install the CLI version that matches the server, or connect to a server on the CLI version. If their contracts differ, the server decides which operations it accepts. Do not treat a successful connection as proof that every command is compatible.

If the CLI attempts anonymous issuer discovery against an older server that does not serve /.well-known/tapstate (such as a server on v0.3.0), the CLI reports cli.issuer-discovery-rejected. The diagnostic output includes:

  • seed: The server endpoint URL contacted during discovery.
  • reason: The rejection response or HTTP error status returned by the server.

To resolve cli.issuer-discovery-rejected, upgrade the tapstate server to a release that supports issuer discovery, or use a CLI version matching the older server.

Text-mode coded CLI diagnostics include the CLI version and the server version captured when the connection was made. Offline diagnostics say server not connected; an older server that does not report a version appears as server not reported. Structured JSON and YAML results keep their documented shape; collect tapstate version separately when reporting one.

A connected command returns exit code 3

The command was invoked without a server connection, or the verb is reserved but not implemented. Start an interactive session and run connect and login, or seed a one-shot command with -c and -u (which prompts interactively for the password). The CLI does not accept a password flag; for automation, set TAPSTATE_PASSWORD or pass --token / TAPSTATE_TOKEN so credentials stay out of shell history and the process list.

Troubleshoot v0.8 installation and browser access

  • 403 control.bootstrap-forbidden on /auth/bootstrap: Three-layer v0.8 installations do not bootstrap from /auth/bootstrap. Initialize the Configuration, Durable cache, and Application data layers first and create the first administrator on the dedicated management channel; see Initialize storage.
  • Occupied CACHE database refused during setup: First-time binding checks require a completely empty Durable cache database—any existing collection is refused, even with zero documents—along with collection-listing metadata permission. Select an unused database name and test again before committing.
  • Browser sign-in refused (403) or control.browser-auth-config-invalid: Plain HTTP browser logins are blocked by default in v0.8, and HTTPS requests must carry a single same-origin Origin header matching an allowed entry in TAPSTATE_BROWSER_AUTH_PUBLIC_ORIGINS. When TLS terminates at a reverse proxy, also list its proxy peer addresses in TAPSTATE_BROWSER_AUTH_TRUSTED_PROXIES, or enable TAPSTATE_BROWSER_AUTH_ALLOW_INSECURE_LOOPBACK=true only for server-local loopback testing. See Configure self-hosted browser access.

Check the workspace first

Run the validation command supplied with your tapstate environment before investigating the external system:

tapstate validate --workdir tapstate-work

Review the filename, location, diagnostic code, message, and suggested fix. Correct one layer at a time, then validate again.

Demo workspace already exists or cannot be written

tapstate demo protects existing files by default:

  • cli.demo-workspace-exists means the target already contains a generated demo. Choose an empty work directory, or inspect the existing files before retrying with --force.
  • cli.workspace-not-writable includes the failing path and filesystem reason. Correct the permission or choose a writable directory. The command restores replaced files and removes files it created, although empty directories from the failed attempt can remain.

The tap alias is unavailable

The optional alias never replaces another command. cli.alias-name-taken means the target path belongs to something else. Continue using tapstate, or remove the conflicting command yourself before running tapstate alias install. cli.alias-install-dir-unknown means the selected installation directory has no tapstate entry; set TAPSTATE_INSTALL_DIR to the directory used by the installer and retry.

Unknown field or invalid value

  • Confirm the connector ID and exact field spelling in its Reference section.
  • Remove fields copied from an upstream UI or another connector version unless the tapstate contract exposes them.
  • Check whether the field is conditional on another value, such as authentication method or storage type.

Invalid mode

  • Use only modes shown on the connector page.
  • Do not add cdc because the underlying database supports a transaction log.
  • A target-only connection does not need a source read mode.

Missing or unresolved reference

  • Confirm that pipeline references match resource IDs exactly.
  • Keep every referenced resource in the selected work directory.
  • Check for renamed files whose internal id did not change with the filename.

Troubleshoot the local Docker quickstart

The local quickstart assembles five MySQL orders and six PostgreSQL shipments into MongoDB. Treat the run as successful only when it prints this complete result:

quickstart: 5 orders from MySQL, each carrying its shipments from PostgreSQL -- 6 of them, in one object per order

A healthy server or order_pipeline running line does not establish that the assembled state is correct. Inspect the generated document when the success line is missing.

Docker is unavailable

docker info
docker compose version

Start Docker and confirm the Compose plugin is available. The local quickstart needs to pull and run MySQL, PostgreSQL, MongoDB, and the tapstate server.

A container is unhealthy or stopped

docker compose ps
docker compose logs --tail=200 mysql postgres mongo server

Wait for MySQL and PostgreSQL to finish initialization before retrying source schema discovery. A healthy tapstate server does not mean either source is ready. Slow Docker storage can leave a database initializing while the server already accepts requests.

For cli.request-timed-out during connector registration, check the registered catalog before retrying: the upload can finish on the server after the client times out. Registration is idempotent. Resolve storage or memory pressure, then retry the failed steps. Keep passwords and tokens out of shared log bundles.

Schema discovery ran before a sample database was ready

During a cold start, the tapstate server can become healthy before MySQL or PostgreSQL finishes initializing. If the script reports connector.discover-failed with a refused connection, wait until both source containers are healthy in docker compose ps.

Then open the CLI from the demo directory and inspect the pipeline:

./tapstate -w work
connect http://127.0.0.1:8080
login admin
status order_pipeline

Replace admin in the example with the username chosen during setup and enter that account's password at the prompt. If you accepted the playground's default username, keep admin; the password is the one you supplied during setup. The current playground does not save the password in .env. If the pipeline is FAILED, run stop order_pipeline --keep-state and wait for STOPPED. Rerun the same Quickstart entry point so it can discover both source schemas before applying and starting the pipeline. For a saved script, run sh quickstart.sh in its directory. For the one-line installer, repeat the original command from the parent of tapstate-demo.

Confirm the complete five-order, six-shipment success line and inspect the stored result. A start being accepted after an earlier discovery error does not establish a successful run. Do not clear volumes to resolve a database that is still initializing.

The assembled result does not appear

Check the source and target independently:

docker compose exec mysql mysql -uroot -psecret appdb \
  -e "SELECT COUNT(*) AS source_rows FROM orders;"

docker compose exec postgres psql -U postgres -d appdb \
  -c "SELECT COUNT(*) AS source_rows FROM shipments;"

docker compose exec mongo mongosh --quiet \
  'mongodb://mongo:27017/views?directConnection=true' \
  --eval 'printjson({orders: db.order_state.countDocuments({}), shipments: db.order_state.aggregate([{$unwind:"$shipments"},{$count:"count"}]).toArray()})'

If MySQL has five rows and MongoDB does not, enter the CLI REPL and collect pipeline evidence:

./tapstate -w work
connect http://127.0.0.1:8080
login admin
status order_pipeline
metrics order_pipeline
logs order_pipeline

Replace admin with the username chosen during setup and enter that account's password at the prompt. Keep admin if you accepted the playground's default username; there is no default password. For non-interactive setup, use the account supplied through TAPSTATE_ADMIN_USER and TAPSTATE_ADMIN_PASSWORD. Do not paste the password into a shell command or diagnostic bundle.

A rerun reports an illegal lifecycle transition

The script preserves generated assets. Inspect status and logs first. If the sample is already running and the five-order, six-shipment check passes, the setup is complete.

For a failed pipeline, fix the reported cause, stop it with --keep-state, and wait for the stop to complete before retrying the saved script from the same directory. See Lifecycle transitions. A lifecycle error alone is not a reason to delete the playground's volumes.

The managed view store is unreachable

actuation.view-store-unreachable means the server cannot reach the managed MongoDB store used for an inline view. Check the server's view-store configuration and MongoDB health, then start the pipeline again. The local quickstart's unauthenticated sample store is disposable and is not a production security model.

Connector registration and target rules

Connector registration is refused or download fails

  • connector.not-official means the server refused the artifact before registration. The default accepted set has 18 IDs across MySQL, PostgreSQL, MongoDB, Oracle, SQL Server, Db2 LUW, and Db2 for i, including selected managed variants. Check the exact accepted IDs; a catalog entry alone does not make an artifact acceptable or certify every role.
  • connector.artifact-unreadable (HTTP 400) means the uploaded JAR archive or its specification cannot be read. The error's artifact parameter names the file; the connector ID may not yet be known. Check that the download is a complete JAR, not an HTML error page, then fetch the matching artifact again before retrying registration.
  • cli.connector-download-failed means register <connector-id> could not fetch the artifact from the GitHub preview release or the mirror configured in TAPSTATE_CONNECTORS_URL. Verify network connectivity, HTTPS proxy settings, or set TAPSTATE_CONNECTORS_URL to an internal mirror.

Register connectors one at a time. The current preview still has a known ambiguity during concurrent registration; inspect the resulting catalog before retrying.

Unsupported target connector

dsl.unsupported-target-connector means a serve.sync destination is not allowed by this deployment's target rules. Cloud accepts MongoDB and MongoDB Atlas targets. Self-hosted deployments use the registered connector's sink capability, subject to source-only restrictions. Db2 LUW and aws-rds-mysql are source-only in both modes; aws-rds-mysql is refused as a target even when its catalog entry reports sink capability. Check the destination's exact connector ID and registration rules. Catalog capability does not establish release certification.

Server runtime, state, and API diagnostics

Interpret CLI observations carefully

  • Status separates lifecycle intent from the latest runtime observation. Metrics require an observation and may lag a lifecycle command briefly.
  • During server startup, /healthz and /auth/storage-entry can return 200 before Bootstrap logs Tapstate application is ready (while /auth/login still returns 503), so automation should wait for authentication or tapstate version readiness after a restart.
  • status --watch and logs --follow continue until you press Ctrl+C.
  • Logs are node-local in the preview and are not a durable audit history.
  • snapshot can report that no snapshot is available. Confirm source and target records instead of treating that response alone as proof of success or failure.
  • Shared-capture inbound observations can be attributed incorrectly in the current preview. Compare per-table target confirmations and data before diagnosing a consumer from inbound counts alone.
  • Light CLI requests (such as position, stop, pause, and resume) use a 3-second HTTP read timeout. On constrained or heavily loaded hosts where assembling the server response takes longer than 3 seconds (for example, GET /api/pipelines/{id}/position or :stop), the CLI can report request failed: <host:port> is unreachable even when the server accepted the request or remains healthy. Verify with status <pipeline-id> or the corresponding REST endpoint.
  • In v0.8.0, running tapstate -c <url> -u <user> data-browser '...' as a one-shot command returns cli.not-connected (exit code 3). Pipe the read expression into tapstate -c <url> -u <user> on standard input or run it inside an interactive session.

Connector state and keyring diagnostics

When capture.recovery-log-gap or capture.recovery-progress-unproven refuses recovery (including checkpoints written by some older server stores), back up the server metadata and operator state before clearing checkpoints or rerunning. Current preview releases prevent new unsafe checkpoints from being written, but they do not repair existing ones.

DiagnosticWhat it meansWhat to do
connector.state-unreadableStored connector state cannot be deserialized, for example after a downgrade.Preserve a backup and use the release that wrote the state. If choosing to clear it, review shared-chain and target effects before rerunning.
connector.state-value-unsupportedA connector attempted to persist an unmappable state data type in the storage layer.Report the issue against the connector build; the connector's internal state cannot be persisted by the engine.
store.source-config-keyring-invalidThe metadata keyring is missing, malformed, or inconsistent.Restore the encrypted Source records and their matching keyring from a consistent backup; do not generate a replacement keyring for existing ciphertext.
store.source-config-keyring-not-readyThis node cannot acknowledge the current keyring generation.Check cluster membership and startup logs before retrying. Preserve the metadata and keyring for diagnosis.

Lifecycle, position, and schema sync diagnostics

DiagnosticWhat it meansWhat to do
lifecycle.purge-state-not-statedA REST POST ...:stop request omitted the mandatory purgeState boolean body.Supply {"purgeState": false} to preserve checkpoint offsets, or {"purgeState": true} to clear this pipeline's checkpoint position and operator state.
actuation.schema-sync-while-runningderived-schema --accept was called while the pipeline is running or converging.If upstream schemas changed, refresh the source schema first, stop the pipeline until STOPPED, then accept the derived schema.
position.write-back-while-liveAttempted to update checkpoint positions while the pipeline or another pipeline sharing its mining chain is running.Stop all pipelines reading from the same source connection before writing back positions.
position.chain-not-readThe position document specifies a chain not read by the target pipeline.Read the pipeline's current position document first, edit only its existing chains, and re-apply.
position.field-not-editableA non-editable position attribute outside resumeFrom.token was altered.Re-export the position payload and edit only resumeFrom.token.

Control plane and REST API diagnostics

DiagnosticHTTP statusWhat it meansWhat to do
pipeline.not-found404 Not FoundThe requested pipeline ID does not exist on the server.Confirm the pipeline ID in Pipelines or GET /api/pipelines.
pipeline.already-exists409 ConflictA pipeline with the requested ID is already registered.Use a unique pipeline ID or update the existing pipeline with PUT.
pipeline.precondition-required428 Precondition RequiredA pipeline update request (PUT /api/pipelines/{id}) omitted the required If-Match header.Perform a GET request to read the current resource and its ETag, then pass that value in the If-Match header.
pipeline.version-conflict412 Precondition FailedThe provided If-Match ETag does not match the pipeline's current version (concurrent edit conflict).Re-fetch the pipeline resource to obtain the latest ETag and retry the update.

Pipeline, transform, and observation diagnostics

Start with the pipeline's monitoring and logs pages, or use the observation interfaces for repeatable CLI diagnostics.

Code or symptomWhat to check
dsl.unknown-field on view.schemaRemove the unused View policy; keep connector config.schema. See Upgrade to v0.6.
actuation.source-schema-not-discoveredDiscover every required source before starting either View or sync output.
engine.execution-not-authorizedThe run lost its execution lease or exhausted automatic lease-recovery retries while the server or capture layer was still starting. Inspect logs <pipeline-id>, run stop <pipeline-id> --keep-state, wait for STOPPED, and run start <pipeline-id> to resume from retained positions. Before a planned server restart, stop running pipelines with --keep-state first.
engine.view-key-missing-from-before-imageConfirm the selected View key is present in source before images for updates and deletes.
dsl.join-input-not-a-table / dsl.join-input-is-a-patternUse one physical table per Join alias, not a prior step or a table pattern.
actuation.join-sql-invalidResolve the reported SQL column or input error before starting again.
nest.flat-cardinality-violationMore than one live child matched a flat embed. Use an array or correct the relationship.
nest.flat-field-conflictRename or drop conflicting fields before Nest while preserving its relationship keys.
nest.state-database-changed-while-runningOn v0.7 single-store deployments, stop all writers and follow the full state move; on three-layer v0.8 installations, restore the original state.database name or run a full pipeline rebuild rather than copying cache collections.
transform.script-decimal-out-of-rangeJavaScript cannot represent the decimal within its numeric range. Keep it unchanged or revise the calculation.
transform.expression-failedCheck expression inputs, including null dimension values from an outer join.
monitor.no-observationNo observation has been published; do not interpret missing data as success.
monitor.cursor-expiredStart a fresh history query without the expired cursor.

Engine out of memory

After the engine is lost to out-of-memory, affected running or paused pipelines report engine.out-of-memory and /healthz returns 503 broken. Restart the server process after addressing memory pressure; repeating pipeline start cannot restore the lost engine. Check heap allocation, source batch sizes, operator state, and Nest capacity.

A healthy /healthz response does not prove target writes or CDC continuity. Inspect data and observations after recovery. Pipelines that failed for another reason before a member restart retain that failure and need separate diagnosis.

On this page