Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes with traefik after 10-15 mins with exit code 137 and no other error in logs #2

Open
t0mtaylor opened this issue Dec 10, 2024 · 4 comments

Comments

@t0mtaylor
Copy link

t0mtaylor commented Dec 10, 2024

Have tried running via Traefik, seems to work but crashes after 10 minutes with exit code 137 and no other error in logs

Running on Docker Swarm with single replica, error messages to why the container failed:

State | failed State Message | started Error message | task: non-zero exit (137)

State | failed State Message | starting Error message | No such container: pds_pds.1.t4py6tckd64immy2o2wety4xt

List of containers recently failed and running with timestamps:

Status Id Node Host Last Update
running pds_pds.1.x42afuu4fr5fprupv1esxl03h   1 h02 2024-12-10 19:10:44
failed pds_pds-pds.1.hcn3eowdwz0vfk20wvokaa0k3   1 h02 2024-12-10 19:10:34
failed pds_pds-pds.1.vssfcfwt2t74cvfcfshkadcdk   1 h02 2024-12-10 19:10:23
failed pds_pds-pds.1.56v6647op4zplcsg14rmg5pia   1 h02 2024-12-10 18:58:33
failed pds_pds-pds.1.b9zku10qf94vte6i3aef2vixj   1 h02 2024-12-10 18:58:23
failed pds_pds-pds.1.t4py6tckd64immy2o2wety4xt   1 h02 2024-12-10 18:46:33
failed pds_pds-pds.1.disytrtjeesmay6qku0yh1p2s   1 h02 2024-12-10 18:46:23
failed pds_ds-pds.1.n495gdyjdxzdb730gbzct9odm   1 h02 2024-12-10 18:34:34
failed pds_pds-pds.1.t2c3g8fz4w4ffa66et2grfznb   1 h02 2024-12-10 18:34:23
failed pds_pds-pds.1.s436xzdvemcrw7qkzbojxplsv   1 h02 2024-12-10 18:22:33
failed pds_pds-pds.1.ly2ipxi32o05a7bemnkfxjkzb   1 h02 2024-12-10 18:22:23
@gravityfargo
Copy link
Owner

I appreciate you following up with this issue! I've made quite a few changes in the documentation and pushed out a new image. There were several errors with the example compose projects which I've fixed. The container runs as an unprivileged user now.

Try pulling down a fresh image docker pull forgejo.gravityfargo.dev/gravityfargo/bluesky-pds:latest and looking over the deployment notes again.

@t0mtaylor
Copy link
Author

t0mtaylor commented Dec 11, 2024

@gravityfargo sounds promising, I've updated with the unprivileged user and ive given the latest image a try, but it still crashes out after 10-15mins

Could you update the entrypoint.sh file to run the index.js in production mode without source maps?

NODE_ENV=production node index.js

You could still support dev mode by setting PDS_DEV_MODE in the env file, if you need source maps?

Another option is to use nodemon which will also restart pds index.js if it exits clean (such as code 0) - https://www.npmjs.com/package/nodemon
nodemon ./index.js

@gravityfargo
Copy link
Owner

gravityfargo commented Dec 11, 2024

NODE_ENV is inherited from the stock pds container . The modified code from that is used in my base image

If I exec in to a test container and su pds I can see that NODE_ENV=production is defined in the pds user's environment.

$ id
uid=1000(pds) gid=1000(pds) groups=1000(pds)

$ printenv
LOG_ENABLED=true
MAIL=/var/mail/pds
PDS_REPORT_SERVICE_URL=https://mod.bsky.app
USER=pds
NODE_VERSION=20.11.1
HOSTNAME=................
YARN_VERSION=1.22.19
PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=................
SHLVL=1
PDS_DATADIR=/pds
HOME=/pds
PDS_REPORT_SERVICE_DID=................
PGID=1000
PDS_DID_PLC_URL=https://plc.directory
LOGNAME=pds
_=id
TERM=xterm
UV_USE_IO_URING=0
PDS_PORT=3000
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PDS_JWT_SECRET=................
URL_SUFFIX=................
PDS_BSKY_APP_VIEW_URL=https://api.bsky.app
PDS_DATA_DIRECTORY=/pds
PUID=1000
PDS_BLOBSTORE_DISK_LOCATION=/pds/blocks
SHELL=/bin/sh
PDS_BSKY_APP_VIEW_DID=did:web:api.bsky.app
PDS_HOSTNAME=................
PDS_CRAWLERS=https://bsky.network
PWD=/app
PDS_BLOB_UPLOAD_LIMIT=52428800
NODE_ENV=production
URL_NAME=................
PDS_ADMIN_PASSWORD=................

If you download a copy of entrypoint.sh, make it executable, and mount it and remove the sourcemap flag.

    volumes:
      - ./config:/pds
      - ./entrypoint.sh:/entrypoint.sh

You can make changes as needed. npm is still installed so you can do which I've tested to work

npm install -g nodemon
nodemon index.js

@t0mtaylor
Copy link
Author

Cool ive made a custom entrypoint.sh and with nodemon, still seems to crash, I've raised a seperate bug issue here on bluesky pds bluesky-social/pds#179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants