Skip to content

Troubleshooting Guide

Fixes for common setup and runtime problems. For the AI flow assistant, see Troubleshoot the flow assistant. For broader questions, see the FAQ.

Start with `ciaren check`

It reports a non-writable data directory, a non-async database URL, an unreachable database, the available engines, and (on Windows) a risky MLflow path.

Database connection fails

Ciaren uses async SQLAlchemy, so a plain sqlite://, postgresql://, or mysql:// URL does not connect. Use the async form in CIAREN_DATABASE_URL:

  • sqlite+aiosqlite:///./ciaren.db (default)
  • postgresql+asyncpg://user:pass@host/db
  • mysql+aiomysql://user:pass@host/db

Install the matching driver (asyncpg or aiomysql) for a non-SQLite database. Ciaren creates missing tables on startup. After you upgrade Ciaren, run ciaren db upgrade against an existing database to change tables that already exist. It is safe to re-run. See Database and data directory and the CLI reference.

"Port 8055 already in use"

Start the server on another port:

bash
ciaren serve --port 8001

The dev frontend can't reach the backend

This applies to a source checkout. The Vite dev server proxies /api to http://localhost:8055. If your backend runs elsewhere, point the proxy at it:

bash
VITE_API_TARGET=http://localhost:8001 npm run dev

If port 5173 is taken, change it with VITE_PORT=3000 npm run dev, and add the new origin to CIAREN_CORS_ORIGINS.

A scheduled flow stopped running

A schedule disables itself after several consecutive failed runs (5 by default) and records a disabled_reason. Re-enable it to clear the failure streak. A manual run now does not count toward auto-disable. See Scheduling.

CORS errors

A page on a different origin than the API needs that origin in CIAREN_CORS_ORIGINS (a JSON list):

bash
CIAREN_CORS_ORIGINS='["http://localhost:5173"]'

Browser clients can send the API token as Authorization: Bearer <token> or as X-Ciaren-Token: <token>. Both pass the CORS preflight.

401 "Missing or invalid API token"

CIAREN_API_TOKEN is set, and the request did not carry it. In the editor, open the app with ?api_token=<token> on the URL. The editor keeps the token for that browser tab session and removes it from the address bar, so repeat this in a new session. Scripts send Authorization: Bearer <token>.

403 "Cross-origin request was refused"

You open Ciaren by a non-local hostname and no API token is set, so Ciaren refuses browser writes from an origin it does not trust. Add the hostname to CIAREN_TRUSTED_HOSTS, or set CIAREN_API_TOKEN. See Production deployment.

Upload rejected as too large

The default upload limit is 100 MB. Raise it on the Settings page or with CIAREN_MAX_UPLOAD_SIZE_MB. Behind nginx, also raise client_max_body_size, which defaults to 1 MB. See Production deployment.

Module not found errors

Activate the environment you use to run Ciaren, then check that the package is installed in that interpreter:

bash
python -m pip show ciaren

For a PyPI install, run python -m pip install ciaren in that environment. For a source checkout, run python -m pip install -e . from backend/. Use python -m pip so the install goes to the selected interpreter. A bare pip can belong to a different environment.

Reinstalling the base package does not add the optional drivers. For connector drivers, see the extras in Installation and Connections. For an async database driver such as aiomysql, see Database connection fails: the mysql extra installs pymysql, not aiomysql. You do not need to delete your virtual environment.

Exported pandas code fails after Split column

Symptom: the flow runs in Ciaren, but an older exported pandas script fails with KeyError: 1 at _parts[1]. For example, splitting ['EU', None] on | into region and city gives no second field in any row.

Cause: pandas only creates split columns that exist in the data. An older export can index a column that was never created, while Ciaren's runtime leaves missing fields null.

Workaround: check each split column before assigning it and use pd.NA for a missing output. For the example above:

python
import pandas as pd

df_1 = pd.DataFrame({"location": ["EU", None]})
_parts = df_1['location'].astype('string').str.split('|', expand=True)
df_2 = df_1.assign(
    region=(_parts[0] if 0 in _parts.columns else pd.NA),
    city=(_parts[1] if 1 in _parts.columns else pd.NA),
)

The result keeps region as ['EU', null] and city as [null, null]. Apply the same check to each additional output, and do not drop rows to avoid the error. If your export already includes these checks, missing trailing fields are expected nulls rather than an error. See the Split column reference and the split-column recipe for configuration and examples.

Install fails on Windows with a long-path error

A pip install can fail on Windows with an error like OSError: [Errno 2] No such file or directory: '...\mlflow\store\db_migrations\versions\...' and a hint about long-path support. Ciaren bundles MLflow, whose internal paths are long, so installing into a deeply nested folder can push the full path past the 260-character Windows limit.

Fix it either way:

  • Enable long paths (recommended, one time). In an Administrator PowerShell:

    powershell
    Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' LongPathsEnabled 1

    Reopen your terminal, then reinstall. See the pip long-paths note.

  • Install into a shorter path. Create the virtual environment close to the drive root, for example C:\ciaren\.venv.

ML training fails because the model could not be saved (Windows)

A training node fails even though the model trained, with an error like:

text
mlTrainClassifier: the model trained successfully but could not be saved to
MLflow ([WinError 206] The filename or extension is too long: '...'). No model
was persisted, so downstream nodes cannot load it.

This is the same 260-character limit as the install error above, hit at run time. MLflow writes artifacts under your tracking directory (CIAREN_MLFLOW_TRACKING_URI, default ./mlruns in the working directory), and its nested mlruns/<exp>/<run>/models/... layout can pass the limit when Ciaren runs from a deeply nested folder. Training happens in memory and succeeds, but saving the model fails. Ciaren fails the node rather than report a run with no model behind it.

ciaren check catches this ahead of time. When the tracking store is a local folder and long paths are off, it prints an ml_path line: [warn] with the fix if the path is at risk, [ok] otherwise.

Fix it either way:

  • Enable long paths (recommended, one time): the same LongPathsEnabled setting shown for the install error above.
  • Point the tracking store somewhere short. Set an absolute, shallow CIAREN_MLFLOW_TRACKING_URI, for example CIAREN_MLFLOW_TRACKING_URI=C:\mlruns, or run Ciaren from a directory close to the drive root. You can also edit the Local MLflow connection's Tracking URI on the Connections page.

Still stuck?