service is deemed crashed when volume is attached on redeployment
dragonhuntr
PROOP

a year ago

not a big deal, but whenever a redeployment happens with a service that has a volume attached, the previous deployment is marked as crashed and sends out a crashed email when shutting down.

29 Replies

dragonhuntr
PROOP

a year ago

e27edfa5-ed43-4bf6-a40f-6a2089373f19


jackrkelly
PRO

a year ago

We tested by removing the volume, and redeploying, not seeing any crash email/statuses. But with the volume attached, the "Stopping container" is logged twice, and the status enum shows "Crashed" for a moment before being removed.


brody
EMPLOYEE

a year ago

Hello, Looks like this is no longer a problem?


dragonhuntr
PROOP

a year ago

no, seems like still occuring


brody
EMPLOYEE

a year ago

can you link directly to the deployment?



brody
EMPLOYEE

a year ago

its active? im not quite sure i see the problem


dragonhuntr
PROOP

a year ago

1354167225501876200


dragonhuntr
PROOP

a year ago

the problem is its sending out crashed emails even though the deployment is active


brody
EMPLOYEE

a year ago

gotcha, can you share your Dockerfile please


dragonhuntr
PROOP

a year ago

and from our testing it seems that when taking the previous deployment offline for the latest deployment to take over, the previous deployment crashes right before it being removed


brody
EMPLOYEE

a year ago

likely incorrect start command


brody
EMPLOYEE

a year ago

can you share your Dockerfile please?


dragonhuntr
PROOP

a year ago

```javascript

FROM node:20.17.0

Set working directory

WORKDIR /apps

Install pnpm with the correct version

RUN npm install -g pnpm@9.14.2

Copy everything

COPY . .

Install dependencies

RUN pnpm install --frozen-lockfile

Define build arguments

ARG PRIVATEFTPWEBHOOKURL ARG PRIVATEFTPWEBHOOKSECRET
ARG PRIVATEFTPSERVERPORT ARG PRIVATEFTPMAXFILESIZEIN_MB

EXPOSE $PRIVATEFTPSERVER_PORT

Use the entrypoint script to generate SSH host keys and start the server

CMD ["pnpm", "--filter", "@org/ftp-server", "start"]```


dragonhuntr
PROOP

a year ago

i dont see anything wrong with it


dragonhuntr
PROOP

a year ago

hmm now that i think about it


dragonhuntr
PROOP

a year ago

would nodemon play a role?


brody
EMPLOYEE

a year ago

does the start command use nodemon?


dragonhuntr
PROOP

a year ago

yes


brody
EMPLOYEE

a year ago

no it doesnt, no need to worry there


dragonhuntr
PROOP

a year ago

if it helps, this only started occuring whenever a volume is attached


brody
EMPLOYEE

a year ago

so you would want to build the ftp-server with tsc and then run the resulting .js file directly -

...
RUN pnpm --filter @org/ftp-server build

...
# Please replace with the actual path to the .js file, this is just a guess
ENTRYPOINT ["node", "/apps/apps/ftp-server/dist/src/index.js"]

dragonhuntr
PROOP

a year ago

just to clarify, how did this extra step helped?


brody
EMPLOYEE

a year ago

this is the correct start command syntax, running through pnpm is not good for production environments


jackrkelly
PRO

a year ago

We do this for our other production environment, we are not looking for advice on that. This issue is related to volumes.


jackrkelly
PRO

a year ago

We have already tested several times, and it's only occuring when a volume is attached. The container is stopped twice. (one time seemingly preemptively, isolated to having a volume attached)


jackrkelly
PRO

a year ago

The "Stopping container" is logged twice when a volume is attached.


jackrkelly
PRO

a year ago

and it's status is flagged as crashed right before being removed.


brody
EMPLOYEE

a year ago

I can't see this being related to volumes, pnpm is not passing the correct signals and thus your app is crashing when we remove the old deployment, please try my suggestion and then we can go from there


Loading...