#issue deploying to self hosted convex
4 messages · Page 1 of 1 (latest)
Hi @lyric creek. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
I’m sorry, but the knowledge sources don’t mention this specific BadJsonBody: appDefinition: missing field "functions" error when deploying to a self‑hosted backend, so I can’t give a definitive root cause.
What I can say from the docs:
-
When using a self‑hosted backend,
npx/bunx convex devtalks to the backend whose URL and admin key you configure via:CONVEX_SELF_HOSTED_URL='<http://127.0.0.1:3210'> CONVEX_SELF_HOSTED_ADMIN_KEY='<your admin key>'in
.env.local(or your environment). [Self-hosted readme; Dev workflow] -
The CLI then pushes an “app definition” (functions, schema, etc.) to that backend, similar to how it does for the cloud dev deployment. [CLI dev]
The error you’re seeing indicates that the backend is trying to parse that app definition JSON and doesn’t find a required functions field. That suggests a mismatch between:
- the CLI version you’re running locally, and
- the version of the self‑hosted backend you’re running in Docker/Fly/etc.
However, the provided docs don’t explicitly document this error or the exact compatibility matrix, so I can’t confirm that with certainty.
Given the limits of the docs, the only concrete, doc‑backed steps I can recommend are:
-
Ensure you’re on the latest
convexNPM package in your app:npm install convex@latest
-
Ensure your self‑hosted backend is up to date by pulling the latest images / code per the self‑hosting instructions (Docker or Fly). [Self-hosted readme; Self-hosted article]
-
Double‑check your environment variables: only
CONVEX_SELF_HOSTED_URLandCONVEX_SELF_HOSTED_ADMIN_KEYshould be set for self‑hosting; don’t mix them with cloudCONVEX_DEPLOY_KEYetc. [Dev workflow]
Beyond that, the docs suggest using the #self-hosted channel in Discord or GitHub Issues for self‑hosting problems, which is likely the best next step for this specific backend JSON error. [Self-hosted questions]