500 Error on /v1/console/variables After Nginx Proxy Setup (TypeError: domain is null) #10435
Replies: 1 comment
|
The stack trace identifies the missing value exactly: in Appwrite 1.7.4, console.php line 49 constructs Domain from _APP_DOMAIN_TARGET_CNAME—not from _APP_DOMAIN. Your .env sets _APP_DOMAIN_TARGET, which is not the variable that this endpoint reads. Replace it with the actual 1.7.4 variables, for example: Then recreate the Appwrite containers so Compose rebuilds their environment; restart alone is not enough: The second command must show _APP_DOMAIN_TARGET_CNAME with a non-empty value. You do not need to delete Redis or the config volume: this failure occurs before those are relevant. This is confirmed by the 1.7.4 source: console.php line 49 calls System::getEnv('_APP_DOMAIN_TARGET_CNAME'), and the official 1.7.4 .env defines _APP_DOMAIN_TARGET_CNAME, _A and _AAAA. The official compose also passes those exact names into the appwrite service. Your Nginx Host/X-Forwarded headers look unrelated to this particular TypeError; the null is created from the absent environment key. After fixing it, keep /v1 routed to the appwrite API and non-/v1 console paths routed to appwrite-console as you already do. |
Uh oh!
There was an error while loading. Please reload this page.
Hello Appwrite Community,
I am not an expert in ubuntu, nginx, docker, or appwrite, so if any of this sounds completely wrong forgive me as I'm definitely doing my best!
I'm trying to set up Appwrite on a VPS and have run into a persistent 500 error that I can't solve after several days of troubleshooting. I'm hoping someone in the community might have seen this specific issue before.
My Goal:
To run Appwrite (version 1.7.4) using Docker Compose on a VPS that already hosts other sites. I am using my own Nginx instance as a reverse proxy to handle SSL and serve Appwrite at https://app.pageinit.net.
The Problem:
The setup almost works. I can reach the Appwrite landing page and the signup page at /console. I can successfully fill out the form to create my root user account. However, after submitting the form, the app tries to redirect me to the onboarding page (/console/onboarding/create-project) and immediately fails with a "500 Server Error" page.
Using the browser's developer tools, I've identified the failing network request:
This error suggests that the Appwrite container doesn't know its own domain when this specific API is called, even though everything else seems to work.
My Configuration
Here are the relevant configuration files for my setup:
I've removed the default Traefik service and exposed ports for the three public-facing services (appwrite, appwrite-console, appwrite-realtime). I am also using bind mounts for persistent, restorable data.
(Showing only relevant services for brevity)
What I Have Already Tried (and did not work)
I have tried every conceivable fix for this, and the error persists every single time. This is a list of my troubleshooting steps:
Verified .env file: Confirmed _APP_DOMAIN and _APP_DOMAIN_TARGET are both set correctly to app.pageinit.net.
Verified Nginx Headers: Ensured that proxy_set_header Host $host; and other X-Forwarded-* headers are present in all relevant location blocks.
Confirmed Environment Variable Inside Container: I ran docker compose exec appwrite printenv | grep _APP_DOMAIN and confirmed that the variable is being passed correctly and is set inside the running container:
Reset Config Volume: I completely stopped Appwrite, removed the /opt/appwrite/volumes/config directory, recreated it as empty, and restarted. The error remained.
Reset Config AND Redis Volumes: Suspecting a bad cache, I stopped Appwrite, removed both the /opt/appwrite/volumes/config AND /opt/appwrite/volumes/redis directories, recreated them as empty, and restarted. The error still remains.
I am completely out of ideas. The container has the correct environment variable set, but it seems to be ignoring it, and resetting the config/cache volumes has not fixed it.
Has anyone ever seen this behavior? Is there another place a corrupted configuration could be stored?
Any help would be greatly appreciated!
All reactions