Pm2: PM2 SH Bad Substitution on deploy

Created on 25 Aug 2015  Β·  10Comments  Β·  Source: Unitech/pm2

Hi all, can anyone point out what script could result in this error? My app deploys fine however I use stash for deployment and this is reporting the build has failed

pm2 deploy ecosystem.json production
--> Deploying to production environment
--> on host 192.168.0.195
  β—‹ deploying
  β—‹ hook pre-deploy
  β—‹ fetching updates
Fetching origin
  β—‹ resetting HEAD to origin/master
HEAD is now at 78297ee Merge pull request #6 in AA/ppm---stores from dev to master
  β—‹ executing post-deploy `pm2 startOrRestart ecosystem.json β€”env production`
[PM2] restartProcessId process id 0
[PM2] restartProcessId process id 1
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€   ───┬─────────────┬──────────┐

β”‚ App name β”‚ id β”‚ mode β”‚ pid β”‚ status β”‚ restart β”‚ uptime β”‚ memory β”‚ watching β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ PPM Stores Test β”‚ 0 β”‚ fork β”‚ 28151 β”‚ online β”‚ 8 β”‚ 0s β”‚ 15.770 MB β”‚ disabled β”‚
β”‚ PPM Stores Live β”‚ 1 β”‚ fork β”‚ 28163 β”‚ online β”‚ 8 β”‚ 0s β”‚ 5.395 MB β”‚ disabled β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Use pm2 show <id|name> to get more details about an app
sh: 1: Bad substitution

  post-deploy hook failed

 Deploy failed

if I run pm2 startOrRestart ecosystem.json β€”env production from command then it builds without this error.

This is on Ubuntu 14.04.1

Most helpful comment

Ah, thanks... Looks like my user couldn't do this, so I had to do it this way,

sudo chsh -s /bin/bash myuser

All 10 comments

Same problem here.. Not sure what to make of it.

@Unitech I've seen hints that this could be related to the fact that Ubuntu uses dash instead of bash. Does this seem like the likely culprit?

@jpdesigndev - Based on your comment I gave my pm2 group permission for bash and this has done the trick.

See also #1456 if you have thoughts/ideas

@herghost Sorry, linux skills are lacking. How might I do this?

@jpdesigndev I am using webmin on my server so I did it through that, however I believe the followig commands should do it
chsh (From the user you want to add)
//Enter your password, then
/bin/bash

Ah, thanks... Looks like my user couldn't do this, so I had to do it this way,

sudo chsh -s /bin/bash myuser

Hope it helped :-)

On Tue, 8 Sep 2015 at 16:58 Jarrod Payne [email protected] wrote:

Ah, thanks... Looks like my user couldn't do this, so I had to do it this
way,

sudo chsh -s /bin/bash web

β€”
Reply to this email directly or view it on GitHub
https://github.com/Unitech/PM2/issues/1553#issuecomment-138608935.

@herghost Yep, pm2 deployment successful! Thank you.

had the same issue. Changing the shell to /bin/bash fixed it. thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  Β·  3Comments

alexpts picture alexpts  Β·  3Comments

psparago picture psparago  Β·  3Comments

xzycn picture xzycn  Β·  3Comments

webchaz picture webchaz  Β·  3Comments