Ghost Error (Communication) / File Permission Error
See original GitHub issueSummary
It appears my ghost cli is unable to access the log files to write logs, so it is throwing an error when i start up.
Steps to Reproduce
- Follow local install steps here
- My install was working for a short period of time like this, but it was in the dev environment, so I did the following in an attempt to get a prod environment
ghost setup
- Follow the promts.
- Run the different commands to see the output (pasted below).
Log file
The issue is that I canβt get access to my log files.
ghost ls
:
james@jamesdev:/var/www/ghost$ ghost ls
+ sudo systemctl is-active ghost_blog-jaims-dev
ββββββββββββββββββ¬βββββββββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββ¬βββββββ¬ββββββββββββββββββ
β Name β Location β Version β Status β URL β Port β Process Manager β
ββββββββββββββββββΌβββββββββββββββββΌββββββββββΌββββββββββΌββββββΌβββββββΌββββββββββββββββββ€
β blog-jaims-dev β /var/www/ghost β 3.31.3 β stopped β n/a β n/a β n/a β
ββββββββββββββββββ΄βββββββββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββ΄βββββββ΄ββββββββββββββββββ
james@jamesdev:/var/www/ghost$
ghost run
:
james@jamesdev:/var/www/ghost$ ghost run
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
events.js:292
throw er; // Unhandled 'error' event
^
Error: EACCES: permission denied, open '/var/www/ghost/versions/3.31.3/content/logs/https___blog_jaims_dev_production.error.log'
Emitted 'error' event on Logger instance at:
at WriteStream.onStreamError (/var/www/ghost/versions/3.31.3/node_modules/ghost-ignition/node_modules/bunyan/lib/bunyan.js:627:18)
at WriteStream.emit (events.js:315:20)
at internal/fs/streams.js:361:12
at FSReqCallback.oncomplete (fs.js:156:23) {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/var/www/ghost/versions/3.31.3/content/logs/https___blog_jaims_dev_production.error.log'
}
james@jamesdev:/var/www/ghost$
ghost start
:
james@jamesdev:/var/www/ghost$ ghost start
+ sudo systemctl is-active ghost_blog-jaims-dev
β Ensuring user is not logged in as ghost user
β Checking if logged in user is directory owner
β Checking current folder permissions
+ sudo systemctl is-active ghost_blog-jaims-dev
β Validating config
β Checking folder permissions
β Checking file permissions
β Checking content folder ownership
β Checking memory availability
β Checking binary dependencies
+ sudo systemctl start ghost_blog-jaims-dev
+ sudo systemctl stop ghost_blog-jaims-dev
β Starting Ghost: blog-jaims-dev
A GhostError occurred.
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_blog-jaims-dev -n 50
Debug Information:
OS: Ubuntu, v20.04.1 LTS
Node Version: v12.18.3
Ghost Version: 3.31.3
Ghost-CLI Version: 1.14.1
Environment: production
Command: 'ghost start'
Additional log info available in: /home/james/.ghost/logs/ghost-cli-debug-2020-08-31T16_54_37_656Z.log
Try running ghost doctor to check your system for known issues.
You can always refer to https://ghost.org/docs/api/ghost-cli/ for troubleshooting.
james@jamesdev:/var/www/ghost$
journalctl -u ghost_blog-jaims-dev -n 50
:
james@jamesdev:/var/www/ghost$ sudo journalctl -u ghost_blog-jaims-dev -n 50
-- Logs begin at Sat 2020-07-04 03:34:27 UTC, end at Mon 2020-08-31 16:55:43 UTC. --
Aug 31 16:54:32 jamesdev node[315350]: Emitted 'error' event on Logger instance at:
Aug 31 16:54:32 jamesdev node[315350]: at WriteStream.onStreamError (/var/www/ghost/versions/3.31.3/node_modules/ghost-ignition/node_modules/bunyan/lib/bunyan.js:627:18)
Aug 31 16:54:32 jamesdev node[315350]: at WriteStream.emit (events.js:315:20)
Aug 31 16:54:32 jamesdev node[315350]: at internal/fs/streams.js:361:12
Aug 31 16:54:32 jamesdev node[315350]: at FSReqCallback.oncomplete (fs.js:156:23) {
Aug 31 16:54:32 jamesdev node[315350]: errno: -13,
Aug 31 16:54:32 jamesdev node[315350]: code: 'EACCES',
Aug 31 16:54:32 jamesdev node[315350]: syscall: 'open',
Aug 31 16:54:32 jamesdev node[315350]: path: '/var/www/ghost/versions/3.31.3/content/logs/https___blog_jaims_dev_production.error.log'
Aug 31 16:54:32 jamesdev node[315350]: }
Aug 31 16:54:32 jamesdev systemd[1]: ghost_blog-jaims-dev.service: Succeeded.
Aug 31 16:54:32 jamesdev systemd[1]: ghost_blog-jaims-dev.service: Scheduled restart job, restart counter is at 121.
Aug 31 16:54:32 jamesdev systemd[1]: Stopped Ghost systemd service for blog: blog-jaims-dev.
Aug 31 16:54:32 jamesdev systemd[1]: Started Ghost systemd service for blog: blog-jaims-dev.
Aug 31 16:54:33 jamesdev node[315361]: - Inspecting operating system
Aug 31 16:54:34 jamesdev node[315385]: events.js:292
Aug 31 16:54:34 jamesdev node[315385]: throw er; // Unhandled 'error' event
Aug 31 16:54:34 jamesdev node[315385]: ^
Aug 31 16:54:34 jamesdev node[315385]: Error: EACCES: permission denied, open '/var/www/ghost/versions/3.31.3/content/logs/https___blog_jaims_dev_production.error.log'
Aug 31 16:54:34 jamesdev node[315385]: Emitted 'error' event on Logger instance at:
Aug 31 16:54:34 jamesdev node[315385]: at WriteStream.onStreamError (/var/www/ghost/versions/3.31.3/node_modules/ghost-ignition/node_modules/bunyan/lib/bunyan.js:627:18)
Aug 31 16:54:34 jamesdev node[315385]: at WriteStream.emit (events.js:315:20)
Aug 31 16:54:34 jamesdev node[315385]: at internal/fs/streams.js:361:12
Aug 31 16:54:34 jamesdev node[315385]: at FSReqCallback.oncomplete (fs.js:156:23) {
Aug 31 16:54:34 jamesdev node[315385]: errno: -13,
Aug 31 16:54:34 jamesdev node[315385]: code: 'EACCES',
Aug 31 16:54:34 jamesdev node[315385]: syscall: 'open',
Aug 31 16:54:34 jamesdev node[315385]: path: '/var/www/ghost/versions/3.31.3/content/logs/https___blog_jaims_dev_production.error.log'
Aug 31 16:54:34 jamesdev node[315385]: }
Aug 31 16:54:35 jamesdev systemd[1]: ghost_blog-jaims-dev.service: Succeeded.
Aug 31 16:54:35 jamesdev systemd[1]: ghost_blog-jaims-dev.service: Scheduled restart job, restart counter is at 122.
Aug 31 16:54:35 jamesdev systemd[1]: Stopped Ghost systemd service for blog: blog-jaims-dev.
Aug 31 16:54:35 jamesdev systemd[1]: Started Ghost systemd service for blog: blog-jaims-dev.
Aug 31 16:54:35 jamesdev node[315396]: - Inspecting operating system
Aug 31 16:54:37 jamesdev node[315420]: events.js:292
Aug 31 16:54:37 jamesdev node[315420]: throw er; // Unhandled 'error' event
Aug 31 16:54:37 jamesdev node[315420]: ^
Aug 31 16:54:37 jamesdev node[315420]: Error: EACCES: permission denied, open '/var/www/ghost/versions/3.31.3/content/logs/https___blog_jaims_dev_production.error.log'
Aug 31 16:54:37 jamesdev node[315420]: Emitted 'error' event on Logger instance at:
Aug 31 16:54:37 jamesdev node[315420]: at WriteStream.onStreamError (/var/www/ghost/versions/3.31.3/node_modules/ghost-ignition/node_modules/bunyan/lib/bunyan.js:627:18)
Aug 31 16:54:37 jamesdev node[315420]: at WriteStream.emit (events.js:315:20)
Aug 31 16:54:37 jamesdev node[315420]: at internal/fs/streams.js:361:12
Aug 31 16:54:37 jamesdev node[315420]: at FSReqCallback.oncomplete (fs.js:156:23) {
Aug 31 16:54:37 jamesdev node[315420]: errno: -13,
Aug 31 16:54:37 jamesdev node[315420]: code: 'EACCES',
Aug 31 16:54:37 jamesdev node[315420]: syscall: 'open',
Aug 31 16:54:37 jamesdev node[315420]: path: '/var/www/ghost/versions/3.31.3/content/logs/https___blog_jaims_dev_production.error.log'
Aug 31 16:54:37 jamesdev node[315420]: }
Aug 31 16:54:37 jamesdev systemd[1]: ghost_blog-jaims-dev.service: Succeeded.
Aug 31 16:54:37 jamesdev systemd[1]: Stopped Ghost systemd service for blog: blog-jaims-dev.
james@jamesdev:/var/www/ghost$
ghost doctor
:
james@jamesdev:/var/www/ghost$ ghost doctor
β Checking system Node.js version
β Checking logged in user
β Ensuring user is not logged in as ghost user
β Checking if logged in user is directory owner
β Checking current folder permissions
System checks failed with message: 'Linux version is not Ubuntu 16 or 18'
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using `ghost install local` instead.
? Continue anyway? Yes
System stack check skipped
βΉ Checking operating system compatibility [skipped]
β Checking for a MySQL installation
+ sudo systemctl is-active ghost_blog-jaims-dev
β Validating config
β Checking folder permissions
β Checking file permissions
β Checking content folder ownership
β Checking memory availability
β Checking binary dependencies
james@jamesdev:/var/www/ghost$
Technical details
This is automatically output by Ghost-CLI if an error occurs, please copy & paste:
Debug Information:
OS: Ubuntu, v20.04.1 LTS
Node Version: v12.18.3
Ghost Version: 3.31.3
Ghost-CLI Version: 1.14.1
Environment: production
Command: 'ghost start'
Bug submission checklist
Please fill out this checklist to acknowledge that you followed the requirements to submit a bug report.
- [βοΈ] Tried to find help in the forum & docs
- [βοΈ] Checked for existing issues
- [βοΈ] Attached log file (i attached the logs that are available to me)
- [βοΈ] Provided technical details incl. operating system
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Issues - GitHub
Permissions related: "Error trying to access settings files in /opt/bitnami/ghost/versions/4.9.4/content/settings/." #115.
Read more >Ghost start results in could not communicate with ghost error
When I run ghost start , it hangs for a couple of minutes and then outputs a message about not being able to...
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 a few seconds with this commands...
Read more >"Permission Denied" error shown in log when Norton Ghost v15
This morning I noticed multiple "Permission Denied" errors in its log for the image deletes. The Ghost service runs as the "SYSTEM" ID...
Read more >502 Bad Gateway After Ghost Upgrade - DigitalOcean
When trying ghost update --force I get the error Message: 'EACCES: permission denied, rmdir '/var/www/ghost/versions/3.38.1'' Even though IΒ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@acburdine I think we should add a warning when both dev and prod configs exist - the number of users that should intentionally have both should be low π€
Ah ok. Thank you for explaining the difference between the prod and dev environments. I was thinking the two would maybe be running concurrently, but it appears that I have to pick one or the other.
I think this resolves my problem. Thanks.