Nodejitsu Deploy Private Github Repo Error

nodejitsu Error 502 deploy:github:no_pkg_json

I’m trying to auto deploy my nodejs application from github to nodejitsu. I have already setup my webhook to nodejitsu and everything works fine when the github repository is public. Now I have made my github repo private i’m seeing an error when i commit changes.

Nodejitsu emails me the error:

Your application has failed to deploy.

Error 502 deploy:github:no_pkg_json: Unspecified error

Error: Failed to fetch `package.json`.Is this a private repo ?
    at Request._callback
(/opt/run / snapshot / package / lib / github.js: 100: 23)
    at Request.self.callback
(/opt/run / snapshot / package / node_modules / request / request.js: 129: 22)
    at Request.emit(events.js: 98: 17)
    at Request.
(/opt/run / snapshot / package / node_modules / request / request.js: 873: 14)
    at Request.emit(events.js: 117: 20)
    at IncomingMessage.
(/opt/run / snapshot / package / node_modules / request / request.js: 824: 12)
    at IncomingMessage.emit(events.js: 117: 20)
    at _stream_readable.js: 929: 16
    at process._tickCallback(node.js: 419: 13)

Full details may be seen via curl:

curl -u sdeering
https://webhooks.nodejitsu.com/1/status/sdeering/changes/7997b65888a48af2c50d2af0fe330619

When I try curl to output full details, it’s not helpful at all.

Further research states to use webhooks via command line to update your apps (fetch package.json).

https://www.nodejitsu.com/documentation/features/webhooks/

Install latest jistu

npm install jitsu -g

Then enter the directory of your app

cd <dr>

Then prompt an update

jitsu apps update

684963CC-19E8-4D05-8E77-7E188B34C2D5

Ok so we need to give access to nodejitsu to our private repo. We can do this by running the following with your username/password replaced.

curl -X POST -u sdeering
https://webhooks.nodejitsu.com/1/auth/github -H "Content-type: application/json" --data '{ "credentials": "github-username:github-password" }'

Then when we click “test service” on our github webhooks page, it should now work.

The active snapshot should now update to the new version.

5D18E5A0-BA25-4E89-AAA5-566AFA5CA4CD

And the success email should come through.

8C1062BA-AA74-465F-A613-63B854ECC5D6