Closed apoutchika closed 6 years ago
i see that there are some node8
references in the config.. are they still valid after your upgrade?
do you confirm that is working with node 8.x.x but failing with node 9.x.x ? did you also tried to remove and setup again the deployment?
Sadly there are no verbose log here, can you try to git clone
the pm2 repo, add a console.log(err)
here and use the binary in ./bin/pm2
where you cloned the repo ?
I try with node 8, i have same issue.
The console log return this :
Deploy failed
{ Error
at new ValidationError (/tmp/pm2/node_modules/tv4/tv4.js:1461:12)
at ValidatorContext.createError (/tmp/pm2/node_modules/tv4/tv4.js:359:14)
at ValidatorContext.validateType (/tmp/pm2/node_modules/tv4/tv4.js:751:14)
at ValidatorContext.validateBasic (/tmp/pm2/node_modules/tv4/tv4.js:721:19)
at ValidatorContext.validateAll (/tmp/pm2/node_modules/tv4/tv4.js:599:19)
at ValidatorContext.validateObjectProperties (/tmp/pm2/node_modules/tv4/tv4.js:1010:21)
at ValidatorContext.validateObject (/tmp/pm2/node_modules/tv4/tv4.js:961:11)
at ValidatorContext.validateAll (/tmp/pm2/node_modules/tv4/tv4.js:603:11)
at Object.validate (/tmp/pm2/node_modules/tv4/tv4.js:1573:24)
at Object.deployForEnv (/tmp/pm2/node_modules/pm2-deploy/deploy.js:52:12)
message: 'Invalid type: object (expected string/array)',
params: { type: 'object', expected: 'string/array' },
code: 0,
dataPath: '/host',
schemaPath: '/properties/host/type',
subErrors: null,
stack: 'Error\n at new ValidationError (/tmp/pm2/node_modules/tv4/tv4.js:1461:12)\n at ValidatorContext.createError (/tmp/pm2/node_modules/tv4/tv4.js:359:14)\n at ValidatorContext.validateType (/tmp/pm2/node_modules/tv4/tv4.js:751:14)\n at ValidatorContext.validateBasic (/tmp/pm2/node_modules/tv4/tv4.js:721:19)\n at ValidatorContext.validateAll (/tmp/pm2/node_modules/tv4/tv4.js:599:19)\n at ValidatorContext.validateObjectProperties (/tmp/pm2/node_modules/tv4/tv4.js:1010:21)\n at ValidatorContext.validateObject (/tmp/pm2/node_modules/tv4/tv4.js:961:11)\n at ValidatorContext.validateAll (/tmp/pm2/node_modules/tv4/tv4.js:603:11)\n at Object.validate (/tmp/pm2/node_modules/tv4/tv4.js:1573:24)\n at Object.deployForEnv (/tmp/pm2/node_modules/pm2-deploy/deploy.js:52:12)' }
It's because the host deploy parameter is bad formated ?
As you can see, the problem is the host
property, you need to configure it like this : "host": "mydomain:7891"
Thank you for you'r fast response !
with the "host": "mydomain:7891"
the deploy failed with this error :
ssh: Could not resolve hostname mydomain:5172: Name or service not known
But i have found the good config :
release: {
user: 'node8',
host: 'mydomain.com',
port: '7891',
ref: 'origin/release',
repo: 'git@myrepo.com:myapp.git',
path: '/home/node8/myapp/',
'post-deploy': 'npm i && npm run build && pm2 startOrGracefulReload ecosystem.config.js --env production'
}
It work ! Thank you :-)
happy to see this resolved! :smile:
For those who might stumble upon this looking for a way to change ssh port in new pm2:
deploy : {
production : {
user : 'node8',
host : 'mydomain.com',
ssh_options: [
'Port=59990',
],
ref : 'origin/release',
repo : 'git@myrepo.com:myapp.git',
path : '/home/node8/myapp',
'post-deploy' : 'npm i && npm run build && pm2 startOrGreacefulReload ecosystem.config.js --env production'
}
}
Might work for you, as it did for me (since port is no longer one of possible parameters).
Hello,
When i deploy my project, pm2 deploy output is "Deploy failed", with not other errors or logs.
This work fine when i start my project, but now (after node update ?) pm2 deploy output is always :
My ecosystem.config.js :
My versions :
Thank you in advance, Apoutchika