Deploying Rails - Cannot read property 'statusCode' of undefined


#1

Hi,
I’m trying to deploy a rails app with opscaptain but running opscaptain deploy produces the following error:

OpsCaptain CLI (1.3.0)
CLI: You are currently running the latest version of the OpsCaptain CLI: [v1.3.0]

CLI: Find manifest file in current working directory: /home/simon/Code/rails/trip_reg_sulej/ocmanifest.json
CLI: Detected [ocmanifest.json] in application root directory
CLI: Using application name: [trip-reg]
CLI: Using application directory [/home/simon/Code/rails/trip_reg_sulej]
CLI: Ignore file or directory with name: [.git]
CLI: Ignore file or directory with name: [.ocignore]
CLI: Ignore file or directory with name: [node_modules]
CLI: Ignore file or directory with name: [ocbundle.zip]
CLI: Ignore file or directory with name: [__oc__trip-reg-40.json]

CLI: Remote accept new file: [tmp/restart.txt]
CLI: Remote accept new file: [vendor/.keep]
CLI: Length of zip archive in bytes: [8396774]
CLI: Binary info: {
“buildpacks”: [
“ruby”
],
“env”: {

},
“deployid”: “1525672891051-51e237ff-c1d0-4367-a944-de40682c5721”,
“appid”: “trip-reg-40”
}
CLI: Lift off!

/usr/local/lib/node_modules/opscaptain-cli/deploymentstatus.js:80
if (res.statusCode != 200) {
^

TypeError: Cannot read property ‘statusCode’ of undefined
at Request._callback (/usr/local/lib/node_modules/opscaptain-cli/deploymentstatus.js:80:21)
at self.callback (/usr/local/lib/node_modules/opscaptain-cli/node_modules/request/request.js:186:22)
at Request.emit (events.js:180:13)
at Request.onRequestError (/usr/local/lib/node_modules/opscaptain-cli/node_modules/request/request.js:878:8)
at ClientRequest.emit (events.js:180:13)
at TLSSocket.socketErrorListener (_http_client.js:395:9)
at TLSSocket.emit (events.js:180:13)
at emitErrorNT (internal/streams/destroy.js:64:8)
at process._tickCallback (internal/process/next_tick.js:114:19)

Any idea what might be causing this?


#2

It is also possible to deploy from the dashboard. Can you attempt to deploy from the dashboard by simply zipping your project folder and uploading it. Click on the name of the app you created and then click on the Deploy section. Should report any errors.

The above error seems like an error returned from the deployment process. The connection was terminated and the res variable is not available which the CLI is failing to check. In short, a minor bug with the CLI failing to handle errors properly.

Deploying from the dashboard could help reveal the underlying error.