{"record":{"id":"df9afc5d51148c52","repo":"mem0ai/mem0","slug":"jwt-secret-is-required-set-it-in-env-generate-w","errorCode":null,"errorMessage":"JWT_SECRET is required. Set it in .env (generate with `openssl rand -base64 48`) or set AUTH_DISABLED=true for local development only.","messagePattern":"JWT_SECRET is required\\. Set it in \\.env \\(generate with `openssl rand -base64 48`\\) or set AUTH_DISABLED=true for local development only\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"server/main.py","lineNumber":91,"sourceCode":"    except Exception:\n        return\n\n    logging.warning(\n        \"\\n%s\\n\"\n        \"  Auth is enabled by default and this server has no admin configured.\\n\"\n        \"  Protected endpoints will return 401 until you either:\\n\"\n        \"    1. Set ADMIN_API_KEY=<long-random-value>  (fastest, no client changes)\\n\"\n        \"    2. Register an admin at http://<host>:3000/setup\\n\"\n        \"    3. Set AUTH_DISABLED=true                 (local development only)\\n\"\n        \"  Docs: https://docs.mem0.ai/open-source/features/rest-api#authentication\\n\"\n        \"%s\",\n        \"=\" * 72,\n        \"=\" * 72,\n    )\n\n\nif not AUTH_DISABLED and not JWT_SECRET:\n    raise RuntimeError(\n        \"JWT_SECRET is required. Set it in .env (generate with `openssl rand -base64 48`) \"\n        \"or set AUTH_DISABLED=true for local development only.\"\n    )\n\nif AUTH_DISABLED:\n    logging.warning(\"AUTH_DISABLED is enabled. Protected endpoints are open for local development only.\")\nelif ADMIN_API_KEY and len(ADMIN_API_KEY) < MIN_KEY_LENGTH:\n    logging.warning(\n        \"ADMIN_API_KEY is shorter than %d characters - consider using a longer key for production.\",\n        MIN_KEY_LENGTH,\n    )\nelif not ADMIN_API_KEY:\n    _warn_if_unconfigured()\n\ntelemetry.log_status()\n\nPOSTGRES_HOST = os.environ.get(\"POSTGRES_HOST\", \"postgres\")\nPOSTGRES_PORT = os.environ.get(\"POSTGRES_PORT\", \"5432\")","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/server/main.py#L73-L109","documentation":"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.","triggerScenarios":"Thrown at server/main.py:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set JWT_SECRET in .env (generate with `openssl rand -base64 48`) or set AUTH_DISABLED=true for local development only."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}