WebFaction
Community site: login faq

I'm trying to upgrade node on a ghost app from 4.8.2 to 6.10.2 but after upgrade i get 502. Can you tell me what might be the cause? Last week I could upgrade from 4.8.0 to 6.10.0 just fine.

asked 05 May, 10:34

hakimjonas's gravatar image

hakimjonas
111
accept rate: 0%


502 means your app isn't running, or it's running but not listening on the correct port.

If your app is running, then check its config to ensure it's running on the correct port. You can see the correct port number in your app list in the control panel. If it's using the wrong port, then adjust the config and restart the app.

If your app isn't running, then try starting it, and make a note of any errors you see, then update your question to include the errors.

permanent link

answered 05 May, 19:10

seanf's gravatar image

seanf ♦♦
11.4k21233
accept rate: 37%

edited 05 May, 19:11

Hi Sean,

I basically update node the way it is described here: https://docs.webfaction.com/software/nodejs.html. The config.js file is not changed by this process. I then remove node_modules and install ghost again. There are still no changes to the config.js and I have verified that it keeps the same port. I don't seen any error messages when starting, updating or stopping the application. Furthermore if i use the same series of commands to downgrade node back to 4.8.2 everything works again.

Before your last API update I was able to do the 4.8.0 to 6.10.0 upgrade without issues using the same commands.

I should say I installed ghost using the following script:

https://github.com/hakimjonas/ghost-on-webfaction/blob/master/webfaction_install.py

This script works perfectly when it is set to install node 4.8.2 but fails when trying to install node 6.10.2. I'm not sure why of if there is a connection to the upgrade issue - but it doesn't seem unlikely I think.

(05 May, 20:26) hakimjonas hakimjonas's gravatar image

So is your app running when you see the 502, or not?

I think the start script is set up to fail silently, so you may want to inspect that script and run the actual start command manually, without any IO redirection, so that you can see any errors or other output.

(05 May, 21:36) seanf ♦♦ seanf's gravatar image

Do you mean the start script as in /bin/start? I don't get any errors from running that.

(07 May, 23:39) hakimjonas hakimjonas's gravatar image

No, I mean the command that bin/start runs, eg NODE_ENV=production /home/you/webapps/app_name/bin/node /home/you/webapps/app_name/index.js - if you run that manually, what sort of output do you see?

(08 May, 18:31) seanf ♦♦ seanf's gravatar image

Thanks Sean, it seems to have been a dependency issue. I wasn't specifying the version of ghost as "0.11.8" in my dependencies in package.json. So after the node upgrade npm was installing ghost version 1.x which has mysql as its default database instead of sqlite3. This meant that the upgraded app couldn't connect to database and thus would not run.

I'm glad i got around this issue with your help, but I still don't understand why I cannot install it directly to node

permanent link

answered 09 May, 08:45

hakimjonas's gravatar image

hakimjonas
111
accept rate: 0%

Not sure what you mean by "install it directly to node", but I'm glad to know you got it working :)

(09 May, 19:48) seanf ♦♦ seanf's gravatar image

It should have said node 6. The install script fails if i change node-4.8.2 to node-6-10.2. :-)

(09 May, 20:35) hakimjonas hakimjonas's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×22
×1

question asked: 05 May, 10:34

question was seen: 268 times

last updated: 09 May, 20:35

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM