mem0ai/mem0 · error · RuntimeError

JWT_SECRET is required. Set it in .env (generate with `opens

Error message

JWT_SECRET is required. Set it in .env (generate with `openssl rand -base64 48`) or set AUTH_DISABLED=true for local development only.

What it means

Error "JWT_SECRET is required. Set it in .env (generate with `openssl rand -base64 48`) or set AUTH_DISABLED=true for local development only." thrown in mem0ai/mem0.

Source

Thrown at server/main.py:91

    except Exception:
        return

    logging.warning(
        "\n%s\n"
        "  Auth is enabled by default and this server has no admin configured.\n"
        "  Protected endpoints will return 401 until you either:\n"
        "    1. Set ADMIN_API_KEY=<long-random-value>  (fastest, no client changes)\n"
        "    2. Register an admin at http://<host>:3000/setup\n"
        "    3. Set AUTH_DISABLED=true                 (local development only)\n"
        "  Docs: https://docs.mem0.ai/open-source/features/rest-api#authentication\n"
        "%s",
        "=" * 72,
        "=" * 72,
    )


if not AUTH_DISABLED and not JWT_SECRET:
    raise RuntimeError(
        "JWT_SECRET is required. Set it in .env (generate with `openssl rand -base64 48`) "
        "or set AUTH_DISABLED=true for local development only."
    )

if AUTH_DISABLED:
    logging.warning("AUTH_DISABLED is enabled. Protected endpoints are open for local development only.")
elif ADMIN_API_KEY and len(ADMIN_API_KEY) < MIN_KEY_LENGTH:
    logging.warning(
        "ADMIN_API_KEY is shorter than %d characters - consider using a longer key for production.",
        MIN_KEY_LENGTH,
    )
elif not ADMIN_API_KEY:
    _warn_if_unconfigured()

telemetry.log_status()

POSTGRES_HOST = os.environ.get("POSTGRES_HOST", "postgres")
POSTGRES_PORT = os.environ.get("POSTGRES_PORT", "5432")

View on GitHub (pinned to 001c235229)

Solutions

  1. Set JWT_SECRET in .env (generate with `openssl rand -base64 48`) or set AUTH_DISABLED=true for local development only.

When it happens

Trigger: Thrown at server/main.py:91 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/df9afc5d51148c52. Report an issue: GitHub.