Hi, I am new to appwrite, I tried to install it on multiple servers, including self-hosted, and digitalocean droplet.. after each fresh install, the docker container keeps generating those 2 errors continuosly:
Error 1:
appwrite | [Error] URL: /v1/realtime
appwrite | [Error] Type: Appwrite\Extend\Exception
appwrite | [Error] Message: The requested route was not found. Please refer to the API docs and try again.
appwrite | [Error] File: /usr/src/code/app/controllers/general.php
appwrite | [Error] Line: 860
Error 2:
appwrite | [Error] Method: GET
appwrite | [Error] URL: /v1/account
appwrite | [Error] Type: Appwrite\Extend\Exception
appwrite | [Error] Message: User (role: guests) missing scope (account)
appwrite | [Error] File: /usr/src/code/app/controllers/shared/api.php
appwrite | [Error] Line: 272
I tried to manually test this endpoint using this request
curl -H "X-Appwrite-Project: your_project_id" \
-H "X-Appwrite-Key: your_api_key" \
-H "Content-Type: application/json" \
-X GET "http://cms.itexpertnow.com/v1/account"
and got this response:
{
"message": "app.6610481f003bf0704275@service.cms.itexpertnow.com (role: applications) missing scope (account)",
"code": 401,
"type": "general_unauthorized_scope",
"version": "1.5.4"
}
also the data on the website is not automatically updated, I have to refresh the page to get the new data... is this because of the realtime error? how to troubleshoot please
This is happening because realtime isn't working. how did you install Appwrite? Do you have anything in front of Appwrite?
error 2 is expected if you don't have a session
you can't call the account endpoint with an api key like that. it's meant to be called as an end user with a session
more digging, I hope someone will be able to help... btw this issue is on fresh install...
docker logs -f appwrite
[Error] Method:
[Error] URL: /v1/realtime
[Error] Type: Appwrite\Extend\Exception
[Error] Message: The requested route was not found. Please refer to the API docs and try again.
[Error] File: /usr/src/code/app/controllers/general.php
[Error] Line: 860
Browser console log:
sdk.alo1Ck00.js:1 WebSocket connection to 'wss://cms.itexpertnow.com/v1/realtime?project=console&channels%5B%5D=project&channels%5B%5D=console' failed:
createSocket @ sdk.alo1Ck00.js:1
(anonymous) @ sdk.alo1Ck00.js:1
r @ 0.DelvZ7a0.js:33
0.DelvZ7a0.js:15 Realtime got disconnected. Reconnect will be attempted in 1 seconds.
(anonymous) @ 0.DelvZ7a0.js:15
(anonymous) @ sdk.alo1Ck00.js:1
r @ 0.DelvZ7a0.js:33
Again... How did you install Appwrite and do you have anything in front of Appwrite?
Appwrite is selfhosted and behind nginx reverse proxy:
Current config:
location ~ ^/.* {
proxy_pass http://0.0.0.0:32790;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection 'upgrade';
proxy_set_header Upgrade $http_upgrade;
proxy_http_version 1.1;
}
How did you install Appwrite?
And did you do something to the traefik container?
That’s because it seems Realtime isn’t running, for some reason. If you tell us how you installed Appwrite, we could start trying to figure out why that is
I am running selfhosted appwrite behind nginx:
$:/home/appwrite# docker port appwrite-traefik
80/tcp -> 0.0.0.0:32080
80/tcp -> [::]:32080
443/tcp -> 0.0.0.0:32443
443/tcp -> [::]:32443
working:
wss://cms.itexpertnow.com:32443/v1/realtime?project=console&channels%5B%5D=project&channels%5B%5D=console
not working:
wss://cms.itexpertnow.com/v1/realtime?project=console&channels%5B%5D=project&channels%5B%5D=console
Nginx config:
location ~ ^/.* {
proxy_pass http://0.0.0.0:32790;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection 'upgrade';
proxy_set_header Upgrade $http_upgrade;
proxy_http_version 1.1;
}
location /v1/realtime {
proxy_pass http://0.0.0.0:32443;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
}
docker config:
traefik:
image: traefik:2.11
container_name: appwrite-traefik
<<: *x-logging
command:
- --providers.file.directory=/storage/config
- --providers.file.watch=true
- --providers.docker=true
- --providers.docker.exposedByDefault=false
- --providers.docker.constraints=Label(`traefik.constraint-label-stack`,`appwrite`)
- --entrypoints.appwrite_web.address=:80
- --entrypoints.appwrite_websecure.address=:443
restart: unless-stopped
ports:
- 32080:80
- 32443:443
Recommended threads
- Selfhosted Github App installation
I've followed this guide: https://appwrite.io/docs/advanced/self-hosting/configuration/version-control to connect GitHub to my self-hosted Appwrite instance (1....
- User ID case sensitivity
I see that through REST (and SDK as well), getting a user is not case sensitive. And even though documentation does not clearly state that it is, the wording "V...
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...