Web Commands Start Not Executing in Platform.sh Deployment
Description:
I am encountering an issue where the start command defined in the web section of my .platform.app.yaml file is not executing correctly during the deployment of my Node.js application on Platform.sh. To debug this issue, I tried using a simple echo command, but it did not produce any output in the logs.
created a simple .platform.app.yaml file with an echo command in the start section to verify if the command is executed:
name: 'auth-app'
# The language and version for your app.
type: 'nodejs:20'
build:
flavor: none
# The size of the app's persistent disk (in MB).
disk: 2048
hooks:
build: |
echo "******Build step completed******"
# The app's configuration when it's exposed to the web.
web:
commands:
start: |
echo "Starting application..."
echo "Start command executed: $$$$$$"
echo "Application started"
dependencies:
nodejs:
pnpm: "*"
- After pushing the changes to Platform.sh, the build and deployment processes complete successfully, but the expected output from the start command (i.e.,
Starting application...,$$$$$$,Application startedor if i have any start command like pnpm run start) is not visible in the deployment logs.
Expected Behavior:
The logs should display the output of the start command, indicating that the command has been executed successfully. For example, the logs should show the line $$$$$$ after the start command is executed.
Actual Behavior:
The deployment logs do not show any output from the start command. This makes it difficult to verify if the start command is being executed correctly.
Logs Provided:
Here are the logs from the most recent deployment:
Found 1 new commit
Building application 'auth-app' (runtime type: nodejs:20, tree: c2feef5)
Generating runtime configuration.
Installing build dependencies...
Installing nodejs build dependencies: pnpm
added 1 package in 2s
1 package is looking for funding
run `npm fund` for details
W: npm notice
W: npm notice New minor version of npm available! 10.7.0 -> 10.8.1
W: npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
W: npm notice To update run: npm install -g npm@10.8.1
W: npm notice
Executing build hook...
******Build step completed******
Executing pre-flight checks...
Compressing application.
Beaming package to its final destination.
Provisioning certificates
Certificates
- certificate 467d546: expiring on 2024-09-10 13:11:27+00:00, covering platformsh-paas-ynhi6wq-fy56tgf7c3v4k.fr-3.platformsh.site
Redeploying environment platformsh-paas
Preparing deployment
Serving cached content for application auth-app
Closing service auth-app
Updating endpoints for auth-app
Opening application auth-app and its relationships
Opening environment
Environment configuration
auth-app (type: nodejs:20, size: S, disk: 2048)
Environment routes
http://platformsh-paas-ynhi6wq-fy56tgf7c3v4k.fr-3.platformsh.site/ redirects to https://platformsh-paas-ynhi6wq-fy56tgf7c3v4k.fr-3.platformsh.site/
https://platformsh-paas-ynhi6wq-fy56tgf7c3v4k.fr-3.platformsh.site/ is served by application `auth-app`
The original issue is that the web.commands.start: pnpm run dev command does not execute during the deployment of my Node.js application on Platform.sh. To debug this, I tried replacing it with a simple echo command, but this also did not produce any output in the logs.
Comments
Hi! The output of start commands will not appear in the deployment activity logs that you have pasted, though it is running if defined like you have here.
SSH into the container
platform sshand then when the session has started runcat /var/log/app.log(and Shift + G to get to the bottom). This is where the output of your app from the start command into runtime will go.Please sign in to leave a comment.