mail-for-good
mail-for-good copied to clipboard
Error while running docker-compose up(installation steps)
After installing Docker and doing the necessary steps
when I run docker-compose up
Getting this error message:
manifest for freecodecamp/mail-for-good:stable not found
Umm, currently the stable tag Docker image is not uploaded, sorry about that. And thanks for reporting.
For now, you can change the line 6 in docker-compose.yml and change the tag to latest
. It should look like this :
...
...
app:
image: freecodecamp/mail-for-good:latest
env_file: .env
...
...
And I am not sure if the latest
tag works. We found some issues in the Docker images and kind of concluded that they aren't getting updated. But please do try it. For any issues, you can comment here or mail me and I can provide support
As far as we can tell, this is a bug with Docker Hub. The repo below should automatically update, but it has not done so for two weeks.
https://hub.docker.com/r/freecodecamp/mail-for-good/
We've reported it to Docker, who have said they're looking into it. We won't be able to make any progress on this one until we hear back.
@karuppiah7890 latest
resolved that issue but now I'm getting a postgres error
postgres_1 | ERROR: relation "settings" does not exist at character 204 postgres_1 | STATEMENT: SELECT "id", "amazonSimpleEmailServiceAccessKey", "amazonSimpleEmailServiceSecretKeyEncrypted" , "amazonSimpleQueueServiceUrl", "region", "whiteLabelUrl", "email", "createdAt", "updatedAt", "userId" FROM "settings" AS "setting";
Am I setting this up right?
Like @AndrewGHC mentioned, there are some problems in the freecodecamp Docker Hub repository due to issues on Docker Hub side, so the Docker images aren't updated. You can try a version that I uploaded recently for using in a server (but it's not the latest), by changing line 6 to
...
...
app:
image: karuppiah7890/mail-for-good:latest
env_file: .env
...
...
@karuppiah7890 I followed your instruction, then ran sudo docker-compose up
and everything was successful up to a point.
The server booted up, I went to http://localhost:8000
, clicked "Sign in with Google", picked an account, then got Internal Server Error
.
This is what the logs show:
app_1 | ############################
app_1 | # Mail 4 Good started #
app_1 | ############################
app_1 | # Port: 8080
app_1 | ############################
app_1 |
app_1 | (node:36) DeprecationWarning: Using the automatically created return value from client.query as an event emitter is deprecated and will be removed in [email protected]. Please see the upgrade guide at https://node-postgres.com/guides/upgrading
postgres_1 | ERROR: relation "users" does not exist at character 112
postgres_1 | STATEMENT: SELECT "id", "googleId", "picture", "token", "email", "name", "sentEmailsCount", "createdAt", "updatedAt" FROM "users" AS "user";
app_1 | Error
app_1 | at /usr/src/app/node_modules/passport-google-oauth20/lib/strategy.js:95:21
app_1 | at passBackControl (/usr/src/app/node_modules/oauth/lib/oauth2.js:132:9)
app_1 | at IncomingMessage.<anonymous> (/usr/src/app/node_modules/oauth/lib/oauth2.js:157:7)
app_1 | at emitNone (events.js:91:20)
app_1 | at IncomingMessage.emit (events.js:188:7)
app_1 | at endReadableNT (_stream_readable.js:975:12)
app_1 | at _combinedTickCallback (internal/process/next_tick.js:80:11)
app_1 | at process._tickDomainCallback (internal/process/next_tick.js:128:9)
Any idea what I'm doing wrong?
Thanks a lot!
Not sure if it's related, but at first I didn't set a PSQL_USERNAME
, PSQL_PASSWORD
, and PSQL_DATABASE
in the .env
file and the docker-compose up
showed this:
postgres_1 | ****************************************************
postgres_1 | WARNING: No password has been set for the database.
postgres_1 | This will allow anyone with access to the
postgres_1 | Postgres port to access your database. In
postgres_1 | Docker's default configuration, this is
postgres_1 | effectively any other container on the same
postgres_1 | system.
postgres_1 |
postgres_1 | Use "-e POSTGRES_PASSWORD=password" to set
postgres_1 | it in "docker run".
postgres_1 | ****************************************************
Then I changed the .env
to set values to those variables, did a docker-compose rm
, then docker-compose up
again, and still got the same warning.
Maybe there's something wrong with establishing a database connection and that's why it blows up after receiving the Google oAuth callback?
Please let me know if there's anything I can do to help investigate to contribute a fix for this. Thanks!
@hsribei I wouldn't be able to advise until Docker get back to us. I've spoken with @QuincyLarson about this and might be able to build this manually if I can get permissions to the Hub repo. We're haven't heard back from the Docker team yet. The problem is simply that there was a bit of a frenzy in terms of updating and changing various bits of the app, so I can't vouch for the version that Docker Hub is currently frozen at. I'm a fan of @karuppiah7890's suggestion to run docker in development to resolve OS/environment issues once and for all.
While I'm working pretty much flat out this week I'll have a good amount of time next week to address these issues. Watch this space!
@hsribei Are you using my Docker image ? I just tried the whole thing with my Docker image, and it does work. The Postgresql is not really creating issues. I think it's your Google API keys configuration that's creating issues. And even I get a "relation doesn't exist" error, but then the application works. I believe sequelize creates the relation later. The Internal Server Error
that you got, it must be from the Google's OAuth system, it will give the details (which you have to see by clicking over an arrow) of why it didn't work. If you still have issues, ping me on Gitter @karuppiah7890 or comment here :)
@ashish-y Does it work for you now ?
Oh sorry, I was trying to comment using my phone and clicked on "close issue" by mistake. @karuppiah7890 yes! I'm using your docker image file, and it does work. Haven't faced any issues.
@karuppiah7890 I found the error! I had set up the Google+ API on Google API Manager, but after setting it up it remained disabled. I enabled it, then things worked :)
Now on to setting up Amazon SES.
@AndrewGHC I think this issue can be closed, since the Docker images look fine and work well.
I also can't get it to work. Using the stable tag I get the following error at the end.
postgres_1 | ERROR: relation "users" does not exist at character 112
postgres_1 | STATEMENT: SELECT "id", "googleId", "picture", "token", "email", "name", "sentEmailsCount", "createdAt", "updatedAt" FROM "users" AS "user";
@arashsoheili Umm, it's an error which occurs while running the application for the first time, but the error doesn't crash the App. It can be ignored for now ( we have to fix it so that it doesn't pop up unnecessarily like in this case ). You can try the Application in the browser and it will work. Try it out and let us know if any other error pops up!
@karuppiah7890 Yes, it is working. I was confused as the console shows that it's running on port 8080 and that's what I was expecting in my host browser. But it seems that host port 80 is mapped to 8080. I think it would be better if host port 8080 was matched to the container port 8080 instead.
Also the local deploy guide incorrectly states localhost:8080 as well.
@arashsoheili Yeah, sorry about that. Thing is, we recently changed some configurations (like mapping host port 80 to container port 8080) - so that people can run the system in production without changing config. But we didn't change it in the guide.
I have created an issue #194 to address it. Thanks @arashsoheili for notifying this :smile:
@karuppiah7890 Okay, that's fair. But this can be better solved by having different docker compose files like docker-compose.prod.yml
. Please refer to docker compose override for details.
True, I agree @arashsoheili , we actually plan to have even a development version of the docker-compose file for development purposes The application is still being developed. We will soon consider all this