Skip to content

Error opening log in production mode #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JustinAiken opened this issue Jan 11, 2016 · 8 comments
Closed

Error opening log in production mode #27

JustinAiken opened this issue Jan 11, 2016 · 8 comments

Comments

@JustinAiken
Copy link

If I set NODE_ENV to production in the container settings, I get this:

npm info it worked if it ends with ok
npm info using npm@2.14.12
npm info using node@v4.2.4
npm info prestart ghost@0.7.4
npm info start ghost@0.7.4
> ghost@0.7.4 start /usr/src/ghost
> node index
ERROR: Unable to access Ghost's content path:
  EACCES: permission denied, open '/usr/src/ghost/content/apps/c7d97c8399fc41be'
Check that the content path exists and file system permissions are correct.
Help and documentation can be found at http://support.ghost.org.
npm info ghost@0.7.4 Failed to exec start script
npm ERR! Linux 4.1.13-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.4
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! ghost@0.7.4 start: `node index`
npm ERR! Exit status 235
npm ERR! 
npm ERR! Failed at the ghost@0.7.4 start script 'node index'.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index
npm ERR! You can get their info via:
npm ERR!     npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! Linux 4.1.13-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.4
npm ERR! npm  v2.14.12
npm ERR! path npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, open 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/ghost/npm-debug.log
@methodx
Copy link

methodx commented Jan 29, 2016

Same issue here

@adam-beck
Copy link

Does this issue help?

@coolnalu
Copy link

coolnalu commented Apr 18, 2016

Tried adding paths to config.js like mentioned in #2 but still got error

npm info it worked if it ends with ok
npm info using npm@2.14.12
npm info using node@v4.2.6
npm info prestart ghost@0.7.8
npm info start ghost@0.7.8

> ghost@0.7.8 start /usr/src/ghost
> node index

ERROR: Unable to access Ghost's content path:
  EACCES: permission denied, open '/usr/src/ghost/content/apps/6086a6d7c89d71e3'

Check that the content path exists and file system permissions are correct.
Help and documentation can be found at http://support.ghost.org.

npm info ghost@0.7.8 Failed to exec start script
npm ERR! Linux 4.1.19-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! ghost@0.7.8 start: `node index`
npm ERR! Exit status 235
npm ERR! 
npm ERR! Failed at the ghost@0.7.8 start script 'node index'.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index
npm ERR! You can get their info via:
npm ERR!     npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! Linux 4.1.19-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! path npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, open 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: 'npm-debug.log.7da2e9feb6af80ea1c45d89105a542fd' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/ghost/npm-debug.log

@jeff-kilbride
Copy link

Same issue here when I first switched from development to production. The trick that worked for me was to start the container in development with a persistent volume for /var/lib/ghost:

-v /home/ubuntu/docker/ghost:/var/lib/ghost

This will create config.js and the apps, data, images, and themes directories on the host. Then I was able to edit the config.js file and add the path fix from Issue #2:

paths: {
    contentPath: path.join(process.env.GHOST_CONTENT, '/')
}

As well as configure my url and mail settings. I removed the development container and started a new one using NODE_ENV=production and it solved the problem. Hopefully, this helps someone else, since Issue #2 has been closed and is a little harder to find.

It's been over a year since this was brought up in Issue #2 and people are still having problems with it. Is this something that needs to be filed as a bug report with the ghost developers upstream? People try out the docker image, because they are looking for a drop in solution that works out of the box. It's frustrating to see an issue that's this easy to fix stick around for so long. At the very least, it should be mentioned in the Readme and the blurb on Docker Hub. I had to Google around for an hour or two before I came across the closed issue.

@dalanmiller
Copy link

Still having this problem. Trying to figure out what's causing this exactly, or what the preferred mode of mounting config.js and content into the container is.

@pascalandy
Copy link
Contributor

My 5 cents - #25 (comment)

@JustinAiken
Copy link
Author

This issue doesn't affect me anymore (just decided to use jekyll for my single-user blog instead), but I'll leave this issue up since others have commented here :)

@tianon
Copy link
Member

tianon commented Sep 26, 2017

This should be much simpler to get right with Ghost 1.x, especially since it can be configured via environment variables (although the out-of-the-box default configuration should be pretty decent for most users as well). 👍

See https://docs.ghost.org/v1.0.0/docs/config#section-running-ghost-with-config-env-variables for more details.

@tianon tianon closed this as completed Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants