Closed elefantemarketing closed 4 days ago
To resolve the 404 error when deploying the stack on Portainer, ensure the following steps:
Environment Variables: Verify that all required environment variables are correctly set in your .env
file. Refer to the .env.example for guidance.
Docker Compose File: Ensure you are using the correct docker-compose.yml file. Place it in the same directory as your .env
file.
Service Dependencies: Confirm that the db
and server
services are healthy and running. The server
service depends on the db
service being healthy.
Health Checks: Check the health status of the server
service using the health check endpoint defined in the docker-compose.yml
file:
healthcheck:
test: curl --fail http://localhost:3000/healthz
interval: 5s
timeout: 5s
retries: 10
Port Configuration: Ensure that port 3000
is correctly mapped and accessible. The server
service should expose port 3000
:
ports:
- "3000:3000"
Logs: Check the logs of the server
and db
services for any errors or issues. Use the following commands:
docker-compose logs server
docker-compose logs db
Network Configuration: Ensure that the network configuration in Portainer allows communication between the services.
If the issue persists, please provide the specific docker-compose.yml
file you are using for further assistance.
/packages/twenty-docker /packages/twenty-docker/docker-compose.yml /packages/twenty-postgres/docker/docker-compose.yml /packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx
version: "3.9"
services: change-vol-ownership: image: ubuntu user: root volumes:
network_public deploy: restart_policy: condition: none
db: image: twentycrm/twenty-postgres:latest volumes:
network_public
server: image: examplecrm/example:latest volumes:
api.example.com
)traefik.http.routers.api.service=api
worker: image: examplecrm/example:latest command: ["yarn", "worker:prod"] environment: PG_DATABASE_URL: postgres://exampleuser:examplepass@db:5432/exampledb SERVER_URL: http://api.example.com FRONT_BASE_URL: http://example.com MESSAGE_QUEUE_TYPE: pg-boss ENABLE_DB_MIGRATIONS: "false" # it already runs on the server STORAGE_TYPE: s3 STORAGE_S3_REGION: us-east-1 STORAGE_S3_NAME: example STORAGE_S3_ENDPOINT: http://s3.example.com ACCESS_TOKEN_SECRET: example_access_token_secret LOGIN_TOKEN_SECRET: example_login_token_secret REFRESH_TOKEN_SECRET: example_refresh_token_secret FILE_TOKEN_SECRET: example_file_token_secret depends_on:
example.com
)volumes: docker-data: server-local-data: db-data-new:
networks: network_public: external: true
i believe the API and SERVER_URL might be missing the external :3000 port? I was never able to make it work with traefik though also I believe that twenty expects a PORT env var... at least in my case I had to use it.
the first step would be to know if you are able to make it work without traefik on a given port, because that 404 might be traefik or might be the twenty server, better to take that away and once you get it working without traefik then maybe put that on top? A bit more information on that 404 would be useful too.
traefik should be able to turn this port available?
does the stack work without traefik?, do you get 404 without traefik?, at this point is difficult for me to give you advice because i don't have enough information, relevant logs from the server, the http 404 response response contains anything else? what are the headers of the response?, etc. As i said i wasn't able to make twenty run with traefik myself but a good first step is debug without. once you make it work without it will be easier to find out why traefik doesn't work
i tried with cloudflared services cutting of traefik and dos not work
just a quick glance at your traefik suggests to me that you are missing the server base url, not just the api...
again, without additional information, logs, http responses, chrome inspector logs, from your part it's gonna be tough to throw anything that could help you...
version: "3.9"
services: change-vol-ownership: image: ubuntu user: root volumes:
network_public deploy: restart_policy: condition: none
db: image: twentycrm/twenty-postgres:latest volumes:
network_public
server: ports:
network_public
cloudflared: image: cloudflare/cloudflared:latest container_name: cloudflared restart: always command:
--token=eyJhIjoiY2Y4NzlkZmI1NmZjYmU1NTdmOTY5MmNlODY4Y34325325k3MTBjYWEtNDIxMy00MmZmLTk2NGUtOGJjN2Q5MjFjODJkIiwicyI6ImZpY3RpdGlvdXNfdG9rZW4ifQ235
worker: image: twentycrm/twenty:latest volumes:
volumes: change-vol-ownership_data: external: true name: change-vol-ownership_data server_data: external: true name: server_data db_data: external: true name: db_data worker_data: external: true name: worker_data docker-data: external: true name: docker_data server-local-data: external: true name: server-local_data db-data-new: external: true name: db-data-new
networks: network_public: external: true name: network_public _twenty_worker.1.apk6cdtj95pulc3jgkmyzhnmc_logs.txt _twenty_server.1.w6rpocsstvbg6ahuf6jgkfnya_logs.txt _twenty_db.1.o4istlx1xmsgkuoguvph4wi79_logs.txt
Following the documentation, docker compose yaml into twenty instructions, but erro 404 everytime, blank screen.
I will send the docker-compose file that i tried to deploy into container
version-twenty-check-it.txt