EACCES: permission denied, open '/var/www/ghost/config.production.json' when upgrading from
See original GitHub issueWas 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:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
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?
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?