fomu65
By:
fomu65

Ghost 502 error & lodash error

August 13, 2016 626 views
Ghost Ubuntu

My site, highgravityconsulting.com, is getting a 502 error. This site has been up and running for a couple years and other than system upgrades (I have them set to occur automatically), I haven't touched it. No config settings changes at all and suddenly, its just not working.

When I go into my ghost directory and try to manually start ghost, I get this error:

ERROR: Cannot find module 'lodash/object/assign'

 Error: Cannot find module 'lodash/object/assign'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/var/www/ghost/node_modules/knex/lib/raw.js:8:14)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/var/www/ghost/node_modules/knex/lib/index.js:3:11)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/var/www/ghost/node_modules/knex/knex.js:8:18)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)

I tried to reinstall lodash but get the same problem. Anyone have suggestions?

2 comments
  • Here is what is in the nginx error.log:

    2016/08/13 10:30:20 [error] 2284#0: *228 connect() failed (111: Connection refused) while connecting to upstream, client: 2604:a880:800:10::de:4001, server: highgravityconsulting.com, request: "GET /feed/ HTTP/1.1", upstream: "http://127.0.0.1:2368/feed/", host: "highgravityconsulting.com"
    

    syslog shows nothing related.

    Oh, I also reinstalled ghost and node, neither of which solved the issue.

    Also note, I've got several subdomains on this same server, all of which are php apps and not node apps, which all work just fine. This has to be related to ghost, I just can't figure out what.

  • I uninstalled node, reinstalled, then reinstalled ghost. Here's what I got at the end of the ghost install.

    npm WARN cannot run in wd ghost@0.9.0 node core/server/utils/npm/preinstall.js (wd=/var/www/ghost)
    npm WARN unmet dependency /var/www/ghost/node_modules/knex requires lodash@'^3.7.0' but will load
    npm WARN unmet dependency /var/www/ghost/node_modules/lodash,
    npm WARN unmet dependency which is version 4.13.1
    ###### NPM installed. ######
    chown: invalid user: ‘ghost:ghost’
    ghost start/running, process 19983
    ###### Ghost started. ######
    
2 Answers
fomu65 August 13, 2016
Accepted Answer

Boom! Figured it out. Looks like the last upgrade of Ghost I did bombed and I completely missed it. Blew it all away and started from scratch (minus my data), doing an install from zip, and it works again.

Have another answer? Share your knowledge.