Checking for deprecations
An error occurred.
Message: ‘EACCES: permission denied, mkdir ‘/var/www/.ghost’’
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v14.17.1
Ghost Version: 3.16.1
Ghost-CLI Version: 1.17.3
Environment: production
Command: ‘ghost doctor’
A promise was rejected but did not have a .catch() handler:
Error: EACCES: permission denied, mkdir ‘/var/www/.ghost/logs’
at Object.mkdirSync (fs.js:1009:3)
at Object.module.exports.makeDirSync (/usr/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/make-dir.js:101:15)
at System.writeErrorLog (/usr/lib/node_modules/ghost-cli/lib/system.js:361:12)
at UI.error (/usr/lib/node_modules/ghost-cli/lib/ui/index.js:462:40)
at Function._run (/usr/lib/node_modules/ghost-cli/lib/command.js:195:16)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
/usr/lib/node_modules/ghost-cli/lib/bootstrap.js:27
throw reason;
^
Error: EACCES: permission denied, mkdir ‘/var/www/.ghost/logs’
at Object.mkdirSync (fs.js:1009:3)
at Object.module.exports.makeDirSync (/usr/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/make-dir.js:101:15)
at System.writeErrorLog (/usr/lib/node_modules/ghost-cli/lib/system.js:361:12)
at UI.error (/usr/lib/node_modules/ghost-cli/lib/ui/index.js:462:40)
at Function._run (/usr/lib/node_modules/ghost-cli/lib/command.js:195:16)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
errno: -13,
syscall: ‘mkdir’,
code: ‘EACCES’,
path: ‘/var/www/.ghost/logs’
}
I have tried various options but got no sucess, and now my blog is giving Bad gateway error.
I have installed ghost on aws using another user.
I followed below link to resolve but now my blog doesn’t even work
If you followed my instructions then your content folder should be owned by the ghost user, which for me is just ‘ghost’ (some people seem to use ghost-mgr or something?). The outside of that I just have a regular user which is my name and that owns everything else. To make sure all permissions are correct, the steps I took were (assuming your ghost install location is /var/www/ghost and the ghost user is ghost):
# set the owners correctly (assuming you are currently 'plezna')
sudo chown -R $USER:$USER /var/www/ghost
sudo chown -R ghost:ghost /var/www/ghost/content
# set the access permissions
sudo find /var/www/ghost/* -type d -exec chmod 775 {} \;
sudo find /var/www/ghost/* -type f -exec chmod 664 {} \;
I did exactly as you said but I am still not able to move past this error.
Now running ls -al /var/www/ghost gives me
total 36
drwxrwxrwx 6 plezna plezna 4096 Jun 24 15:20 .
drwxr-xr-x 7 root root 4096 Jun 24 16:23 …
-rw-rw-r-- 1 plezna plezna 111 May 26 2020 .ghost-cli
-rw-rw-r-- 1 plezna plezna 712 Jun 20 13:06 config.production.json
drwxrwxr-x 8 ghost ghost 4096 May 26 2020 content
lrwxrwxrwx 1 plezna plezna 30 May 26 2020 current → /var/www/ghost/versions/3.16.1
drwxrwxr-x 5 plezna plezna 4096 May 27 2020 node_modules
-rw-rw-r-- 1 plezna plezna 990 May 27 2020 package-lock.json
drwxrwxr-x 4 plezna plezna 4096 May 26 2020 system
drwxrwxr-x 3 plezna plezna 4096 May 26 2020 versions
But if I run ghost restart it again gives me
Checking for deprecations
An error occurred.
Message: ‘EACCES: permission denied, mkdir ‘/var/www/.ghost’’
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v14.17.1
Ghost Version: 3.16.1
Ghost-CLI Version: 1.17.3
Environment: production
Command: ‘ghost restart’
A promise was rejected but did not have a .catch() handler:
Error: EACCES: permission denied, mkdir ‘/var/www/.ghost/logs’
at Object.mkdirSync (fs.js:1009:3)
at Object.module.exports.makeDirSync (/usr/local/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/make-dir.js:101:15)
at System.writeErrorLog (/usr/local/lib/node_modules/ghost-cli/lib/system.js:361:12)
at UI.error (/usr/local/lib/node_modules/ghost-cli/lib/ui/index.js:462:40)
at Function._run (/usr/local/lib/node_modules/ghost-cli/lib/command.js:195:16)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
/usr/local/lib/node_modules/ghost-cli/lib/bootstrap.js:27
throw reason;
^
Error: EACCES: permission denied, mkdir ‘/var/www/.ghost/logs’
at Object.mkdirSync (fs.js:1009:3)
at Object.module.exports.makeDirSync (/usr/local/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/make-dir.js:101:15)
at System.writeErrorLog (/usr/local/lib/node_modules/ghost-cli/lib/system.js:361:12)
at UI.error (/usr/local/lib/node_modules/ghost-cli/lib/ui/index.js:462:40)
at Function._run (/usr/local/lib/node_modules/ghost-cli/lib/command.js:195:16)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
errno: -13,
syscall: ‘mkdir’,
code: ‘EACCES’,
path: ‘/var/www/.ghost/logs’
}