invalid byte sequence in US-ASCII (ArgumentError)

58 views
Skip to first unread message

Gam Ov

unread,
Jun 16, 2016, 12:42:41 AM6/16/16
to phusion-...@googlegroups.com, gama...@fastmail.fm
Hello,
I've an app running properly on a server. When I'm trying to run a second instance (same app, for staging on a different port). Passenger cannot start the app with the following error: 
invalid byte sequence in US-ASCII (ArgumentError)
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler/settings.rb:229:in `scan'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler/settings.rb:229:in `block in load_config'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler/shared_helpers.rb:105:in `filesystem_access'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler/settings.rb:225:in `load_config'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler/settings.rb:12:in `initialize'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler.rb:198:in `new'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler.rb:198:in `settings'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler.rb:412:in `configure_gem_home_and_path'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler.rb:60:in `configure'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler.rb:121:in `definition'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler.rb:91:in `setup'
  /usr/local/rvm/gems/ruby-2.2.5@ector/gems/bundler-1.12.5/lib/bundler/setup.rb:19:in `<top (required)>'
  /usr/local/rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /usr/local/rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:430:in `activate_gem'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:297:in `block in run_load_path_setup_code'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:435:in `running_bundler'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:296:in `run_load_path_setup_code'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

I don't understand why one app can run but not the other... Everything is configured the same it seems.
Ubuntu 14.04.4 LTS, Apache 2.4.7, Ruby 2.2.5 (via RVM), Rails 4.2.6.
It would be great to have a pointer (e.g. which file is problematic)

UPDATE: If I run passenger standalone, I don't get this error with the second instance.

Thanks in advance,
Gam

Daniel Knoppel

unread,
Jun 16, 2016, 5:58:02 AM6/16/16
to Phusion Passenger Discussions, gama...@fastmail.fm
It doesn't look like a Passenger problem. One of the potentially relevant differences between running standalone and via apache is that the user and environment may be different, e.g. locale, paths.

You can see in the bundler source that the scan from your error tries to load the bundler config: https://github.com/bundler/bundler/blob/1-12-stable/lib/bundler/settings.rb#L229

- Daniel

Gam Ov

unread,
Jun 16, 2016, 6:12:02 AM6/16/16
to Phusion Passenger Discussions, gama...@fastmail.fm
Thank you Daniel for your answer.
It looks like a non-ascii character ended up in the .bundle/config file!! I removed it and the app started

It's strange that passenger loads that file through Apache but not in standalone.

Regards,
Gam.
Reply all
Reply to author
Forward
0 new messages