Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Difficulty bootstrapping in heroku #104

Closed
sihil opened this issue Nov 1, 2017 · 1 comment
Closed

Difficulty bootstrapping in heroku #104

sihil opened this issue Nov 1, 2017 · 1 comment

Comments

@sihil
Copy link

sihil commented Nov 1, 2017

I've struggled to get the application running on Heroku. Despite successfully installing the application on Heroku, I'm unable to run the heroku run bundle exec rake db:migrate command.

Initially I thought it might be because I'd inadvertently deployed on heroku-16 rather than cedar-14. However, I switched that out and the problem persists. I've also tried reseting the DB to see if it had got into a bad state.

I believe I've followed the instructions correctly, but not having much Heroku or Rails experience I'm not sure if I've made a mistake or if something has broken in the bootstrap process. Any assistance is greatly appreciated!

The error I see is a IndexError: string not matched with the full stack trace being:

boxen-web git:(master 2↑)$ heroku run bundle exec rake db:migrate --trace
Running bundle exec rake db:migrate --trace on ⬢ REDACTED-boxen-web-REDACTED... up, run.8779 (Free)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /app/config/environments/production.rb:11)
DEPRECATION WARNING: You did not specify a `log_level` in `production.rb`. Currently, the default value for `log_level` is `:info` for the production environment and `:debug` in all other environments. In Rails 5 the default value will be unified to `:debug` across all environments. To preserve the current setting, add the following line to your `production.rb`:

   config.log_level = :info

. (called from block in tsort_each at /app/vendor/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:228)
** Invoke db:load_config (first_time)
** Execute db:load_config
rake aborted!
IndexError: string not matched
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:77:in `[]='
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:77:in `block in config'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:74:in `tap'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:74:in `config'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:69:in `resolve'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/core.rb:46:in `configurations='
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:44:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/base.rb:315:in `<module:ActiveRecord>'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/base.rb:26:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/mysql_database_tasks.rb:8:in `<class:MySQLDatabaseTasks>'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/mysql_database_tasks.rb:3:in `<module:Tasks>'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/mysql_database_tasks.rb:2:in `<module:ActiveRecord>'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/mysql_database_tasks.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:50:in `<module:DatabaseTasks>'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:37:in `<module:Tasks>'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:4:in `<module:ActiveRecord>'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:3:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/railtie.rb:41:in `block (3 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
/app/vendor/ruby-2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/bin/rake:22:in `load'
/app/vendor/bundle/ruby/2.3.0/bin/rake:22:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/bin/bundle:22:in `load'
/app/vendor/bundle/ruby/2.3.0/bin/bundle:22:in `<main>'
Tasks: TOP => db:migrate => db:load_config

For completeness the output from pushing the application is:

boxen-web git:(master 2↑)$ git push heroku master
Counting objects: 1, done.
Writing objects: 100% (1/1), 827 bytes | 827.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.3
remote: -----> Installing dependencies using bundler 1.15.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Using rake 12.0.0
remote:        Using i18n 0.8.1
remote:        Using minitest 5.10.1
remote:        Using thread_safe 0.3.5
remote:        Using builder 3.2.3
remote:        Using erubis 2.7.0
remote:        Using mini_portile2 2.1.0
remote:        Using rack 1.6.5
remote:        Using mime-types 1.25.1
remote:        Using arel 6.0.4
remote:        Using bundler 1.15.2
remote:        Using coffee-script-source 1.12.2
remote:        Using execjs 2.7.0
remote:        Using thor 0.19.4
remote:        Using concurrent-ruby 1.0.4
remote:        Using dotenv 2.2.0
remote:        Using multipart-post 2.0.0
remote:        Using hashie 3.5.3
remote:        Using jwt 1.5.6
remote:        Using kgio 2.11.0
remote:        Using multi_json 1.11.2
remote:        Using multi_xml 0.6.0
remote:        Using pg 0.19.0
remote:        Using raindrops 0.17.0
remote:        Using sass 3.4.23
remote:        Using tilt 2.0.6
remote:        Using nokogiri 1.7.0.1
remote:        Using tzinfo 1.2.2
remote:        Using rack-test 0.6.3
remote:        Using mail 2.6.4
remote:        Using uglifier 3.0.4
remote:        Using coffee-script 2.4.1
remote:        Using sprockets 3.7.1
remote:        Using faraday 0.10.1
remote:        Using omniauth 1.6.1
remote:        Using unicorn 5.2.0
remote:        Using loofah 2.0.3
remote:        Using activesupport 4.2.8
remote:        Using oauth2 1.3.0
remote:        Using rails-html-sanitizer 1.0.3
remote:        Using rails-deprecated_sanitizer 1.0.3
remote:        Using globalid 0.3.7
remote:        Using activemodel 4.2.8
remote:        Using omniauth-oauth2 1.4.0
remote:        Using rails-dom-testing 1.0.8
remote:        Using activerecord 4.2.8
remote:        Using activejob 4.2.8
remote:        Using actionview 4.2.8
remote:        Using omniauth-github 1.2.3
remote:        Using actionpack 4.2.8
remote:        Using actionmailer 4.2.8
remote:        Using railties 4.2.8
remote:        Using sprockets-rails 3.2.0
remote:        Using coffee-rails 4.2.1
remote:        Using jquery-rails 4.2.2
remote:        Using rails 4.2.8
remote:        Using sass-rails 5.0.6
remote:        Bundle complete! 13 Gemfile dependencies, 57 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (1.08s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing node-v6.11.1-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /tmp/build_fd6f6cd9f33590cdda5447e3c597a531/config/environments/production.rb:11)
remote:        DEPRECATION WARNING: You did not specify a `log_level` in `production.rb`. Currently, the default value for `log_level` is `:info` for the production environment and `:debug` in all other environments. In Rails 5 the default value will be unified to `:debug` across all environments. To preserve the current setting, add the following line to your `production.rb`:
remote:        config.log_level = :info
remote:        . (called from block in tsort_each at /tmp/build_fd6f6cd9f33590cdda5447e3c597a531/vendor/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:228)
remote:        Asset precompilation completed (1.36s)
remote:        Cleaning assets
remote:        Running: rake assets:clean
remote:        DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /tmp/build_fd6f6cd9f33590cdda5447e3c597a531/config/environments/production.rb:11)
remote:        DEPRECATION WARNING: You did not specify a `log_level` in `production.rb`. Currently, the default value for `log_level` is `:info` for the production environment and `:debug` in all other environments. In Rails 5 the default value will be unified to `:debug` across all environments. To preserve the current setting, add the following line to your `production.rb`:
remote:        config.log_level = :info
remote:        . (called from block in tsort_each at /tmp/build_fd6f6cd9f33590cdda5447e3c597a531/vendor/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:228)
remote:
remote: ###### WARNING:
remote:        Include 'rails_12factor' gem to enable all platform features
remote:        See https://devcenter.heroku.com/articles/rails-integration-gems for more information.
remote:
remote: ###### WARNING:
remote:        No Procfile detected, using the default web server.
remote:        We recommend explicitly declaring how to boot your server process via a Procfile.
remote:        https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> console, rake, web, worker
remote:
remote: -----> Compressing...
remote:        Done: 57.8M
remote: -----> Launching...
remote:        Released v13
remote:        https://REDACTED-boxen-web-REDACTED.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/REDACTED-boxen-web-REDACTED.git
   e06b380..e5d069e  master -> master

I've set config for the app:

=== REDACTED-boxen-web-REDACTED Config Vars
DATABASE_URL:             postgres://REDACTED@REDACTED:5432/REDACTED
GITHUB_CLIENT_ID:         REDACTED
GITHUB_CLIENT_SECRET:     REDACTED
GITHUB_ORG:               REDACTED
LANG:                     en_US.UTF-8
RACK_ENV:                 production
RAILS_ENV:                production
RAILS_SERVE_STATIC_FILES: enabled
REPOSITORY:               REDACTED/our-boxen
SECRET_KEY_BASE:          REDACTED
SECRET_TOKEN:             REDACTED
@sihil sihil closed this as completed Nov 1, 2017
@sihil
Copy link
Author

sihil commented Nov 1, 2017

I've just noticed that GitHub stopped using boxen some time ago and many people are moving away in favour of other options. I'm off to review them :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant