examples icon indicating copy to clipboard operation
examples copied to clipboard

gcp-ts-k8s-ruby-on-rails-postgresql example app not working

Open lblackstone opened this issue 5 years ago • 0 comments

The TODO app container appears to be invalid. I followed the README and successfully created the cluster and deployed the app, but the container is crash looping.

I connected to the cluster to debug by running

pulumi stack output kubeConfig > kubeconfig

and then running

KUBECONFIG=$PWD/kubeconfig kubectl logs -l app=rails-app

I saw the following logs:

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
* CREATING DATABASE (first time only):
* MIGRATING DATABASE (if needed):
* RUNNING...
/myapp/start: line 10: bin/rails: No such file or directory
/myapp/start: line 12: bin/rails: No such file or directory

It appears that the start script is not working. Changing it to

#!/bin/bash

# Spawn the Rails App.
echo "* SPAWNING RAILS:"
rails new . -f
rails s -p 3000 -b '0.0.0.0' &

# Wait for it to come up, and then ensure the database is created and migrated.
sleep 5
echo "* CREATING DATABASE (first time only):"
rails db:create
echo "* MIGRATING DATABASE (if needed):"
rails db:migrate

echo "* RUNNING..."
wait

got the server to start and stopped the container from crash looping, but when I navigate to the page, I'm seeing DB connection errors: ActiveRecord::ConnectionNotEstablished No connection pool with 'primary' found.

lblackstone avatar Aug 25 '20 23:08 lblackstone