{"action":"created","issue":{"url":"https://api.github.com/repos/colinmeinke/ghost-storage-adapter-s3/issues/6","repository_url":"https://api.github.com/repos/colinmeinke/ghost-storage-adapter-s3","labels_url":"https://api.github.com/repos/colinmeinke/ghost-storage-adapter-s3/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/colinmeinke/ghost-storage-adapter-s3/issues/6/comments","events_url":"https://api.github.com/repos/colinmeinke/ghost-storage-adapter-s3/issues/6/events","html_url":"https://github.com/colinmeinke/ghost-storage-adapter-s3/issues/6","id":200520977,"number":6,"title":"ERROR: Cannot find module '../../../core/server/storage/base' ","user":{"login":"necevil","id":1987471,"avatar_url":"https://avatars.githubusercontent.com/u/1987471?v=3","gravatar_id":"","url":"https://api.github.com/users/necevil","html_url":"https://github.com/necevil","followers_url":"https://api.github.com/users/necevil/followers","following_url":"https://api.github.com/users/necevil/following{/other_user}","gists_url":"https://api.github.com/users/necevil/gists{/gist_id}","starred_url":"https://api.github.com/users/necevil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/necevil/subscriptions","organizations_url":"https://api.github.com/users/necevil/orgs","repos_url":"https://api.github.com/users/necevil/repos","events_url":"https://api.github.com/users/necevil/events{/privacy}","received_events_url":"https://api.github.com/users/necevil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-01-13T00:49:36Z","updated_at":"2017-01-14T20:04:35Z","closed_at":null,"body":"Hey guys.\r\nAttempting to get this module up and running inside of a docker container.\r\n\r\nI have a reasonable amount of experience with Docker and have had a lot of luck getting a full ghost environment up and running locally (and also setup with a full ci pipeline for production).\r\n\r\nI am running based off of the official ghost:0.11.3 image which works flawlessly without the module added.  I did a fresh NPM install of the module when I created the Dockerfile to build the container.  Here's the config:\r\n\r\nDebian Jessie\r\nGhost v0.11.3\r\nNode v4.7.2\r\nNPM v2.15.11 \r\nghost-storage-adapter-s3 v1.2.0\r\n\r\nThat being the case, my latest attempt to integrate the ghost-storage-adapter-s3 has failed with the following error:\r\n\r\nERROR: Cannot find module '../../../core/server/storage/base' \r\nghost                       |  \r\nghost                       |  IncorrectUsage: Cannot find module '../../../core/server/storage/base'\r\nghost                       |     at Error.IncorrectUsage (/usr/src/ghost/core/server/errors/incorrect-usage.js:3:18)\r\nghost                       |     at Object.getStorage (/usr/src/ghost/core/server/storage/index.js:36:19)\r\nghost                       |     at setupMiddleware (/usr/src/ghost/core/server/middleware/index.js:126:44)\r\n\r\nI shelled a new terminal inside of the container and verified that the /usr/src/ghost/node_modules/ghost-storage-adapter-s3/ \r\nDOES exist.\r\n\r\nThen I shifted over to check to make sure that my copy functionality properly copied the contents also into: /usr/src/ghost/content/storage/s3\r\nALSO Exists and all contents appear to be in the folder.\r\n\r\nAfter verifying the above, I added / installed vim inside of the container in an effort to inspect the source of the error (which now existed in two places since the above mentioned copy).  \r\n\r\nSince  was in /usr/src/ghost/content/storage/s3 I figured I would mess with that one first.  I found the following line:\r\nvar _base = require('../../../core/server/storage/base');\r\n\r\nAnd changed it to the absolute path:\r\nvar _base = require('/usr/src/ghost/core/server/storage/base');\r\n\r\nThen I cd'd over to /usr/src/ghost/node_modules/ghost-storage-adapter-s3/  to edit index.js over there.  Code was the same so I replaced the line exactly as mentioned above.\r\n\r\nNext I exited the container and did a docker ps, no container running.\r\nDid a docker run to bring the container back up and it booted back up properly.\r\n\r\nStill trying to figure out WHY it happened, if I knew I would fix it and submit a PR but figured I would bring it to your attention incase its happening to others.  For now I am going to patch my Dockerfile to copy an alternate version of the index.js file overtop of the one causing the problems to quiet it down on myside (until I know for sure that its happening to everyone and not just docker peeps).\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/colinmeinke/ghost-storage-adapter-s3/issues/comments/272649305","html_url":"https://github.com/colinmeinke/ghost-storage-adapter-s3/issues/6#issuecomment-272649305","issue_url":"https://api.github.com/repos/colinmeinke/ghost-storage-adapter-s3/issues/6","id":272649305,"user":{"login":"necevil","id":1987471,"avatar_url":"https://avatars.githubusercontent.com/u/1987471?v=3","gravatar_id":"","url":"https://api.github.com/users/necevil","html_url":"https://github.com/necevil","followers_url":"https://api.github.com/users/necevil/followers","following_url":"https://api.github.com/users/necevil/following{/other_user}","gists_url":"https://api.github.com/users/necevil/gists{/gist_id}","starred_url":"https://api.github.com/users/necevil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/necevil/subscriptions","organizations_url":"https://api.github.com/users/necevil/orgs","repos_url":"https://api.github.com/users/necevil/repos","events_url":"https://api.github.com/users/necevil/events{/privacy}","received_events_url":"https://api.github.com/users/necevil/received_events","type":"User","site_admin":false},"created_at":"2017-01-14T20:04:35Z","updated_at":"2017-01-14T20:04:35Z","body":"Ok it seems like this was a permissions error inside of docker.\r\n\r\nWhile my container that I used to work with the project includes some specific files required for my use case anyone else who runs into a similar error should try to chown the directories associated with ghost (and / or the storage/s3 directory).  \r\n\r\nAdd the following to your Dockerfile (after the point you install your S3 package):\r\nRUN chown -R user:user /usr/src/ghost/\r\n\r\nI noticed that the official ghost container (on docker hub) runs a chown after all of its packages are installed so after doing the same I had success.  Since I have been trouble shooting this for so many days I am going to run back through the process to make sure I am attributing the fix properly as soon as I get a few extra minutes."}}
{"actor":{"display_login":"necevil"}}