I am facing an issue where my Node Express application, deployed on Clever Cloud through GitHub Actions, keeps restarting in a loop immediately after launch. Here are the details:
Setup: My application is set up with a staging.yml workflow file for CI/CD on GitHub Actions and a standard Dockerfile for a Node.js application.
Behavior: The CI/CD pipeline runs successfully, and the application deploys on Clever Cloud. However, as soon as it starts, it enters a continuous restart loop.
FROM node:alpine
WORKDIR /usr/app
COPY ./package.json ./
RUN npm install
COPY ./ ./
CMD ["npm", "run" ,"start"]
And here are the logs : (I suspect this is linked to the docker run command that isn't running in detached mode or something like that...)
(I hided some sensitive informations in logs with "...")
Waiting for application logs…
2024-01-09T15:27:30.446Z: WARNING: Nokogiri was built against libxml version 2.10.4, but has dynamically loaded 2.11.4
2024-01-09T15:27:31.632Z: Preparing application environment…
2024-01-09T15:27:32.011Z: Configure and enable vector.service
2024-01-09T15:27:32.887Z: Inject CC_REVERSE_PROXY_IPS
2024-01-09T15:27:32.887Z: Inject INSTANCE_NUMBER
2024-01-09T15:27:32.887Z: Inject CC_DEPLOYMENT_ID
2024-01-09T15:27:32.888Z: Inject CC_APP_NAME
2024-01-09T15:27:32.888Z: Inject CC_USE_PULSAR_LOGSCOLLECTION
2024-01-09T15:27:32.888Z: Inject CC_OWNER_ID
2024-01-09T15:27:32.888Z: Inject CC_ENVIRON_UPDATE_URL
2024-01-09T15:27:32.888Z: Inject CC_ENVIRON_UPDATE_TOKEN
2024-01-09T15:27:32.888Z: Inject INSTANCE_TYPE
2024-01-09T15:27:32.888Z: Inject CC_PRETTY_INSTANCE_NAME
2024-01-09T15:27:32.888Z: Inject PORT
2024-01-09T15:27:32.888Z: Inject INSTANCE_ID
2024-01-09T15:27:32.888Z: Inject CC_INSTANCE_ID
2024-01-09T15:27:32.888Z: Inject COMMIT_ID
2024-01-09T15:27:32.888Z: Inject CC_COMMIT_ID
2024-01-09T15:27:32.888Z: Inject APP_ID
2024-01-09T15:27:32.888Z: Inject CC_APP_ID
2024-01-09T15:27:32.888Z: Inject APP_HOME
2024-01-09T15:27:32.888Z: Added sourceable file /home/bas/applicationrc
2024-01-09T15:27:32.895Z: Checking cache data: GET /api/builds/app_38cc..../docker-20230717
2024-01-09T15:27:32.919Z: A build cache archive exists, downloading in progress…
2024-01-09T15:27:35.392Z: Successfully downloaded build cache archive
2024-01-09T15:27:35.408Z: Generating public/private ed25519 key pair.
2024-01-09T15:27:35.408Z: Your identification has been saved in /home/bas/.ssh/id_ed25519
2024-01-09T15:27:35.408Z: Your public key has been saved in /home/bas/.ssh/id_ed25519.pub
2024-01-09T15:27:35.408Z: The key fingerprint is:
2024-01-09T15:27:35.408Z: SHA256:DR2S....
2024-01-09T15:27:35.408Z: The key's randomart image is:
2024-01-09T15:27:35.408Z: +--[ED25519 256]--+
...
2024-01-09T15:27:35.408Z: +----[SHA256]-----+
2024-01-09T15:27:35.936Z: Mounting persistent file system
2024-01-09T15:27:35.940Z: No Clever Cloud specific configuration file detected. Continuing…
2024-01-09T15:27:35.940Z: using python version 2
2024-01-09T15:27:36.119Z: Changing current directory to /home/bas/app_38cc… ...
2024-01-09T15:27:36.119Z: We are now in /home/bas/app_38cc..., let's build and run the app.
2024-01-09T15:27:36.119Z: Deploying commit ID f65c0...224
2024-01-09T15:27:36.322Z: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2024-01-09T15:27:36.323Z: Importing image from the cache…
2024-01-09T15:27:39.582Z: Successfully got application from cache
2024-01-09T15:27:39.648Z: Got image sha256:aac...84a, let's check if it exists
2024-01-09T15:27:39.666Z: clever latest sha256:aac...84a 49 minutes ago 148MB
2024-01-09T15:27:39.667Z: Executing docker run -p 8080:8080 -p 4040:4040 clever
2024-01-09T15:27:39.716Z: WARNING: Published ports are discarded when using host network mode
2024-01-09T15:27:40.971Z: > tp-clever-api@1.0.0 start
2024-01-09T15:27:40.971Z: > node app.js
2024-01-09T15:27:41.198Z: Example app listening on port 8080!
2024-01-09T15:27:44.667Z: Application start successful
2024-01-09T15:27:45.177Z: Successfully deployed in 0 minutes and 14 seconds
2024-01-09T15:27:45.177Z: No build cache archive was created. Not uploading anything.
Hello,
I am facing an issue where my Node Express application, deployed on Clever Cloud through GitHub Actions, keeps restarting in a loop immediately after launch. Here are the details:
Setup: My application is set up with a staging.yml workflow file for CI/CD on GitHub Actions and a standard Dockerfile for a Node.js application.
Behavior: The CI/CD pipeline runs successfully, and the application deploys on Clever Cloud. However, as soon as it starts, it enters a continuous restart loop.
Here are my files :
.github/workflows/staging.yml
and my basic Dockerfile
And here are the logs : (I suspect this is linked to the docker run command that isn't running in detached mode or something like that...)
(I hided some sensitive informations in logs with "...")
Thanks for your help ❤️