question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EACCES: permission denied, open '/var/www/ghost/config.production.json' when upgrading from

See original GitHub issue

Was running stably with Ghost 1.6.2, or so I thought. Node Version: v6.11.2 Ghost-CLI Version: 1.1.1

Took a system snapshot, tried upgrading to 1.8.0 and failed with error below:

✔ Linking latest Ghost and recording versions
Running sudo command: -E -u ghost /usr/lib/node_modules/ghost-cli/node_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current
✖ Running database migrations
An error occurred.
Message: 'Command failed: /bin/sh -c sudo -E -u ghost /usr/lib/node_modules/ghost-cli/node_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current
[2017-08-31 03:15:55] ERROR

NAME: InternalServerError
MESSAGE: The server has encountered an error.

level:normal

InternalServerError: The server has encountered an error.
    at new KnexMigrateError (/usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/lib/errors.js:7:26)
    at new KnexMigrator (/usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/lib/index.js:28:15)
    at /usr/lib/node_modules/ghost-cli/node_modules/knex-migrator/bin/knex-migrator-migrate:20:28
    at tryCatcher (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:524:17)
    at Promise._settlePromise (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/usr/lib/node_modules/ghost-cli/node_modules/bluebird/js/release/async.js:143:10)

Error: Error parsing your configuration file: [/var/www/ghost/config.production.json]: EACCES: permission denied, open '/var/www/ghost/config.production.json'
    at File.loadSync (/var/www/ghost/versions/1.8.0/node_modules/nconf/lib/nconf/stores/file.js:160:11)
    at Provider.add (/var/www/ghost/versions/1.8.0/node_modules/nconf/lib/nconf/provider.js:137:23)
    at Provider.file (/var/www/ghost/versions/1.8.0/node_modules/nconf/lib/nconf/provider.js:63:15)
    at Object.loadNconf (/var/www/ghost/versions/1.8.0/core/server/config/index.js:34:11)
    at Object.<anonymous> (/var/www/ghost/versions/1.8.0/core/server/config/index.js:78:27)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/var/www/ghost/versions/1.8.0/MigratorConfig.js:1:76)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)


'


Debug Information:
    Node Version: v6.11.2
    Ghost-CLI Version: 1.1.1
    Environment: production
    Command: 'ghost update'

I’ve reviewed #378 and #281 but have been unable to resolve.

I think there may have been some instability on the system prior that I was unaware of, because I have restored my snapshot and the service will not run even back on 1.6.2. Service log shows a failure on access of the same json file.

I’m having trouble finding documentation to confirm who the owner of '/var/www/ghost/config.production.json should be, but I’m not sure if that is the root issue since I have tried running via sudo and I even tried chown of '/var/www/ghost/config.production.json to ghost:ghost just to see if it would correct the issue.

Apologies if I’m duplicating. Looked through active/closed and didn’t find a resolution.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ErisDScommented, Aug 31, 2017

P.S. the docs live at docs.ghost.org - there’s a Knowledge Base that details file structure and perms, and a troubleshooting guide that mentions this problem - where did you look / search that didn’t help you find them?

1reaction
aileencommented, Aug 31, 2017

Hey @0xvext 👋

Sorry to hear that you’re having trouble. As this is more likely to be an issue with Ghost-CLI, would you mind re-opening it there?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stack: Error: EACCES: permission denied ghost config url
An error occurred. Message: 'EACCES: permission denied, open '/var/www/ghost/config.production.json''. Here is the content of the log file.
Read more >
How to fix permission denied in Ghost packaged by Bitnami
Learn how to fix the "Cannot upload image" error in your Ghost blog packaged by Bitnami in ... cat /opt/bitnami/ghost/config.production.json.
Read more >
'EACCES: permission denied, open '/var/www/ghost/.ghost-cli''
I have tried to run the $ ghost update command, as the root, ghost-mgr (I set up Ghost using a Digital Ocean applet),...
Read more >
Error: EACCES: permission denied, access '/usr/local/lib ...
This means you do not have permission to write to the directories npm uses to store global packages and commands. Try running commands:...
Read more >
Ghost Blog EACCES: permission denied Fix
Run the 'ghost doctor' command within your ghost installation directory. In my case, this was /var/www/ghost. If ghost doctor identifies any ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found