Skip to content

Instantly share code, notes, and snippets.

@Unitech
Created March 26, 2019 13:43
Show Gist options
  • Save Unitech/c705b8f84dca6c9a88fcdfd38a560314 to your computer and use it in GitHub Desktop.
Save Unitech/c705b8f84dca6c9a88fcdfd38a560314 to your computer and use it in GitHub Desktop.
this.io.bucket.create({
name: 'PM2 Plus Monitoring'
}).then(res => {
const bucket = res.data
this.io.bucket.billing.startTrial(bucket._id, {
plan: 'plus_8'
}).then(res => {
console.log(`${cst.PM2_IO_MSG} Successfully created the bucket`)
this.pm2.link({
public_key: bucket.public_id,
secret_key: bucket.secret_id,
pm2_version: pkg.version
}, (err) => {
if (err) {
return cb(new Error('Failed to connect your local PM2 to your bucket'), bucket)
} else {
return cb(null, bucket)
}
})
}).catch(err => {
return cb(new Error(`Failed to enable the trial: ${err.message}`))
})
}).catch(err => {
return cb(new Error(`Failed to create a bucket: ${err.message}`))
})
Trace: [PM2 I/O] Failed to connect to the bucket: Failed to enable the trial: Expected to receive string argument for :id to match but got undefined
at createBucketHandler (/home/unitech/keymetrics/pm2/lib/API/pm2-plus/PM2IO.js:233:15)
at io.bucket.billing.startTrial.then.catch.err (/home/unitech/keymetrics/pm2/lib/API/pm2-plus/PM2IO.js:278:18)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
[PM2 I/O] You can also contact us to get help: [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment