0

I'm trying to deploy a custom project on Elastic Beanstalk but I'm getting the following error in my puma.log file when puma is started. I'm not sure how to fix this. I assume it might be with my yaml parser but I'm not entirely sure how to update that using EB. Any help would be appreciated.

=== puma startup: 2018-12-26 22:06:02 +0000 ===
/opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/psych.rb:402:in 'parse': (<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 83 column 22 (Psych::SyntaxError)
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/psych.rb:402:in 'parse_stream'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/psych.rb:350:in 'parse'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/psych.rb:263:in 'load'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/secrets.rb:27:in 'block in parse'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/secrets.rb:24:in 'each'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/secrets.rb:24:in 'each_with_object'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/secrets.rb:24:in 'parse'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/application.rb:391:in 'secrets'
from /var/app/current/config/environments/production.rb:96:in 'block in <top (required)>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/railtie.rb:211:in 'instance_eval'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/railtie.rb:211:in 'configure'
from /var/app/current/config/environments/production.rb:1:in '<top (required)>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in 'require'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in 'block in require'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:258:in 'load_dependency'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in 'require'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:600:in 'block (2 levels) in <class:Engine>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:599:in 'each'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:599:in 'block in <class:Engine>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:30:in 'instance_exec'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:30:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:59:in 'block in run_initializers'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:228:in 'block in tsort_each'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:350:in 'block (2 levels) in each_strongly_connected_component'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:422:in 'block (2 levels) in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:431:in 'each_strongly_connected_component_from'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:421:in 'block in each_strongly_connected_component_from'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:48:in 'each'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:48:in 'tsort_each_child'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:415:in 'call'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:415:in 'each_strongly_connected_component_from'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:349:in 'block in each_strongly_connected_component'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in 'each'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in 'call'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in 'each_strongly_connected_component'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:226:in 'tsort_each'
from /opt/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:205:in 'tsort_each'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:58:in 'run_initializers'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.1.6.1/lib/rails/application.rb:353:in 'initialize!'
from /var/app/current/config/environment.rb:5:in '<top (required)>'
from config.ru:3:in 'require_relative'
from config.ru:3:in 'block in <main>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in 'instance_eval'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in 'initialize'
from config.ru:in 'new'
from config.ru:in '<main>'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in 'eval'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in 'new_from_string'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in 'parse_file'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/configuration.rb:318:in 'load_rackup'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/configuration.rb:243:in 'app'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/runner.rb:155:in 'app'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/runner.rb:162:in 'start_server'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:273:in 'worker'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:137:in 'block (2 levels) in spawn_workers'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:137:in 'fork'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:137:in 'block in spawn_workers'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:133:in 'times'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:133:in 'spawn_workers'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cluster.rb:466:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/launcher.rb:184:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/lib/puma/cli.rb:78:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/puma-3.12.0/bin/puma:10:in '<top (required)>'
from /opt/rubies/ruby-2.5.3/bin/puma:23:in 'load'
from /opt/rubies/ruby-2.5.3/bin/puma:23:in '<top (required)>'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:74:in 'load'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:74:in 'kernel_load'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:28:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:424:in 'exec'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/command.rb:27:in 'run'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in 'invoke_command'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor.rb:387:in 'dispatch'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:27:in 'dispatch'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/base.rb:466:in 'start'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:18:in 'start'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.16.2/exe/bundle:30:in 'block in <top (required)>'
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/friendly_errors.rb:124:in 'with_friendly_errors'
from /opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.16.2/exe/bundle:22:in '<top (required)>'
from /opt/rubies/ruby-2.5.3/bin/bundle:23:in 'load'
from /opt/rubies/ruby-2.5.3/bin/bundle:23:in '<main>'

I reviewed the logs again today to make sure I hadn't missed anything and I did see another reference to the same error in a different log file but it still tells me very little.

-------------------------------------
/var/log/eb-commandprocessor.log
-------------------------------------
++ [[ -z /opt/rubies/ruby-2.5.3 ]]
++ shift
++ chruby_use /opt/rubies/ruby-2.5.3 ''
++ [[ ! -x /opt/rubies/ruby-2.5.3/bin/ruby ]]
++ [[ -n '' ]]
++ export RUBY_ROOT=/opt/rubies/ruby-2.5.3
++ RUBY_ROOT=/opt/rubies/ruby-2.5.3
++ export RUBYOPT=
++ RUBYOPT=
++ export PATH=/opt/rubies/ruby-2.5.3/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
++ PATH=/opt/rubies/ruby-2.5.3/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
+++ /opt/rubies/ruby-2.5.3/bin/ruby -
++ eval 'export RUBY_ENGINE=ruby;
export RUBY_VERSION=2.5.3;
export GEM_ROOT="/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0";'
+++ export RUBY_ENGINE=ruby
+++ RUBY_ENGINE=ruby
+++ export RUBY_VERSION=2.5.3
+++ RUBY_VERSION=2.5.3
+++ export GEM_ROOT=/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0
+++ GEM_ROOT=/opt/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0
++ ((  0 != 0  ))
+ cd /var/app/ondeck
+ su -s /bin/bash -c 'bundle exec /opt/elasticbeanstalk/support/scripts/check-for-rake-task.rb assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
+ '[' false == true ']'
+ su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
rake aborted!
Psych::SyntaxError: (<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 83 column 22
/var/app/ondeck/config/environments/production.rb:96:in `block in <top (required)>'
/var/app/ondeck/config/environments/production.rb:1:in `<top (required)>'
/var/app/ondeck/config/environment.rb:5:in `<top (required)>'
/opt/rubies/ruby-2.5.3/bin/bundle:23:in `load'
/opt/rubies/ruby-2.5.3/bin/bundle:23:in `<main>'
Tasks: TOP => environment
(See full trace by running task with --trace) (Executor::NonZeroExitStatus)
Cannon Moyer
  • 3,014
  • 3
  • 31
  • 75
  • what exactly log you are getting while deploying process ? also, can u goto eb dashboard and logs get last 100lines of logs. – 7urkm3n Dec 26 '18 at 22:45
  • @7urkm3n That's the exact error that is in puma.log file. The dashboard says nothing more than a status of `Warning` for my overall instance health and a status of `Degraded` for my single instance status. I get a 504 Gateway Timeout error when trying to access the site from the browser. – Cannon Moyer Dec 26 '18 at 22:54
  • No, you have to goto EB dashboard/logs and get last log. Its supposed tobe different than this as i remember. And i dnt know what's `psych.rb` line `line 83`. Make sure running production app in localhost 1st. – 7urkm3n Dec 26 '18 at 23:01
  • Yep, that's where this error came from "EB dashboard/logs and get last log". Btw I have this app running on a Heroku server but I am moving to AWS for pricing purposes. @7urkm3n – Cannon Moyer Dec 26 '18 at 23:02
  • Please correctly format your stack trace by using a [code block](https://stackoverflow.com/help/formatting) and not inline code. – anothermh Dec 27 '18 at 00:04
  • What is on line 96 of your `config/environments/production.rb` file? – littleforest Dec 29 '18 at 17:18

1 Answers1

0

If you have any .json manifest files under app/shared/assets try to delete them.

Also this error may accrue because of bad YAML file. You can check this via running this little script (in your Rails root directory) that finds all *.yml files recursively in all sub-directories and tests the file.

require 'yaml'

d = Dir["./**/*.yml"]
d.each do |file|
  begin
    puts "checking : #{file}"
    f =  YAML.load_file(file)
  rescue StandardError
    puts "failed to read #{file}: #{$!}"
  end
end
mdegis
  • 2,078
  • 2
  • 21
  • 39