Search code examples
dockergoogle-app-enginegoogle-cloud-platformapp-engine-flexible

Terminal hangs when executing `docker exec` from google app engine SSH


I am running a flex environment on google app engine which is hosting a Ruby on Rails application. I'd like to access the rails console on this application. When I SSH into an instance from my local terminal or through the google web console, I execute the command docker exec -it gaeapp /bin/bash -c "bundle exec rails c"

It starts to launch the rails console, but quickly hangs. I can get one or two commands in before it stops responding completely.

I am able to do as much as I like in the SSH console, but the second I run the docker exec command things start to hang. Any idea what is going on?

Our app.yaml

entrypoint: RAILS_ENV=develop bundle exec rails server --port $PORT
env: flex
runtime: ruby
instance_class: F1

env_variables:
  RAILS_MASTER_KEY: ${RAILS_MASTER_KEY}

beta_settings:
  cloud_sql_instances: [hidden]

Running ruby '2.6.3' 'rails', '~> 5.2.3'


Solution

  • I can see in your app.yaml: instance_class: F1. This is NOT a valid setting for App Engine flexible.

    So one possibility is that your instance is running out of resources. Please try to set more CPU and memory in resource setting of app.yaml for the instance.

    Furthermore, be aware that if you are trying to make some changes using SSH inside of the instance, all of them will be lost when this particular instance will be killed/restarted and recreated from the original deployment code.