On a client job, I'm being asked to set up an instance of Discourse, a Ruby on Rails application for hosting discussion forums. I've been a fan of Jeff Atwood's blog for some time, so I was excited at the chance. Doubly so because Discourse's preferred shipping method is using Docker containers.
I'm running Discourse on AWS, so I'm using Amazon RDS PostgreSQL for the database server. Following the steps as outlined in the Discourse Docker deployment instructions, I put my database configuration into my YAML file as environment variables and ran
launcher bootstrap app. Success!
Then I ran
launcher run app. I
curled localhost to ensure my success, but... 502 Bad Gateway.
I connected to the Docker container using
docker exec -ti app bash and verified using env that my environment variables were set. They were. I then
/shared/log/rails/unicorn.stderr.log to discover that Discourse was bombing out saying it could not log into my database.
I stared at this for a good long while before I figured it out.
Like any good sysadmin, I'm using randomly generated passwords. This particular password ended with a hash character (i.e. #). It was there in the environment variable. But running
rails console -e production and looking at
Rails.app.config.database_configuration, it was not there in Ruby. Somewhere along the line in parsing the environment variables, it was getting lopped off.
I've changed the password to only letters and numbers.
Bug filed too.Share on Twitter Share on Facebook