Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kaizen's avatar

Envoyer timing out, but not actually.

I currently build 7 different webpack bundles for 7 different sites via an Envoyer hook, which has generally been working fine.

The hook:

  cd {{release}}
  npm run production

Example of the script it calls:

  "production": "npm run production:site1 && npm run production:site2 && npm run production:site3 && npm run production:site4 && npm run production:site5 && npm run production:site6 && npm run production:site7 && npm run production:site8",

I recently added another site / build resulting in a total of 8 webpack builds. However, upon adding the last site, Envoyer thinks that the hook never completes, and eventually throws a timeout. Which results in the next hook / step not firing.

The server is overpowered in terms of compute and memory, so the hook completes in far less than the 8 minute per-step limit (typically around 2 minutes). I've ssh'd into the server and watched the builds complete, and can confirm all bundles are in the proper places of the release. So the hook is definitely completing.

I've confirmed through access logs that Envoyer closes the connection to the server after the step (which I'm assuming means it received an exit code), but never attempts to reconnect to the server for the next step. UFW and rate limiting don't appear to be an issue as I'm not seeing any rejections to the Envoyer IP. It just seems Envoyer doesn't recognize the step completed, even though it received the exit code.

I attempted using Envoy to initiate the task, but the same behavior occurs.

As a workaround I've broken down the hook into 8 separate hooks, which works fine. However, it'd be nice to not need to add another hook for each new site; prefer just chaining them in npm run production.

Any help is greatly appreciated.

0 likes
1 reply
jjudge's avatar

Why insist on chaining them like this? The usual reason is to stop execution of the next command if a command fais. And that is exactly what the deployment hooks do to - the chain of hooks halts on a failure.

Please or to participate in this conversation.