Project

General

Profile

Actions

Bug #12744

closed

Activating jsonp crashes Application

Added by Volker None over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Debian/Ubuntu
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When activating json with

:support_jsonp: true

in /etc/foreman/settings.yaml the Application crashes:

###
[Tue Dec 08 16:54:21.726041 2015] [mpm_worker:notice] [pid 4613:tid 140482544244608] AH00295: caught SIGTERM, shutting down
[ 2015-12-08 16:54:22.9421 9350/7fae9ead0740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.53', 'pool_idle_time' => '300', 'prestart_urls' => 'aHR0cHM6Ly9mb3JlbWFuMDIuaW50ZXJuLndlYnBhY2suaG9zdGV1cm9wZS5kZQA=', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.53', 'web_server_pid' => '9349', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2015-12-08 16:54:22.9492 9353/7f08d1c81740 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.9349/generation-0/request
[ 2015-12-08 16:54:22.9639 9361/7fea275e6780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.9349/generation-0/logging
[ 2015-12-08 16:54:22.9642 9350/7fae9ead0740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2015-12-08 16:54:23.1003 9376/7fe12974a740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.53', 'pool_idle_time' => '300', 'prestart_urls' => 'aHR0cHM6Ly9mb3JlbWFuMDIuaW50ZXJuLndlYnBhY2suaG9zdGV1cm9wZS5kZQA=', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.53', 'web_server_pid' => '9370', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2015-12-08 16:54:23.1073 9379/7efc4e0ec740 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.9370/generation-0/request
[ 2015-12-08 16:54:23.1220 9387/7f1cfc16b780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.9370/generation-0/logging
[ 2015-12-08 16:54:23.1223 9376/7fe12974a740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Tue Dec 08 16:54:23.123992 2015] [mpm_worker:notice] [pid 9370:tid 140539059177344] AH00292: Apache/2.4.10 (Debian) OpenSSL/1.0.1k Phusion_Passenger/4.0.53 configured -- resuming normal operations
[Tue Dec 08 16:54:23.124107 2015] [core:notice] [pid 9370:tid 140539059177344] AH00094: Command line: '/usr/sbin/apache2'
App 9499 stdout:
App 9499 stderr: Performance on MRI may be improved with the concurrent-ruby-ext gem. Please see http://concurrent-ruby.com
App 9499 stderr: env: /usr/bin/passenger-config: No such file or directory
App 9499 stdout:
[ 2015-12-08 16:54:27.6827 9379/7efc4dff5700 Pool2/Implementation.cpp:287 ]: Could not spawn process for application /usr/share/foreman: An error occured while starting up the preloader.
Error ID: 46fd1695
Error details saved to: /tmp/passenger-error-orVStb.html
Message from application: uninitialized constant Rack::JSONP (NameError)
/usr/share/foreman/vendor/ruby/2.1.0/gems/foreman_hooks-0.3.8/lib/foreman_hooks.rb:83:in `load_missing_constant_with_hooks'
/usr/share/foreman/config/application.rb:154:in `<class:Application>'
/usr/share/foreman/config/application.rb:84:in `<module:Foreman>'
/usr/share/foreman/config/application.rb:83:in `<top (required)>'
/usr/share/foreman/config/environment.rb:2:in `require'
/usr/share/foreman/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.7/lib/rack/builder.rb:51:in `instance_eval'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.7/lib/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'

[ 2015-12-08 16:54:27.6886 9379/7efc3f7fe700 agents/HelperAgent/RequestHandler.h:2306 ]: [Client 20] Cannot checkout session because a spawning error occurred. The identifier of the error is 46fd1695. Please see earlier logs for details about the error.
[ 2015-12-08 16:54:27.6927 9379/7efc3f7fe700 agents/HelperAgent/RequestHandler.h:2306 ]: [Client 21] Cannot checkout session because a spawning error occurred. The identifier of the error is 46fd1695. Please see earlier logs for details about the error. ###

After installing 'rack-jsonp-middleware', which seems to be required here, it still crashes with the same trace.

It seems to fail to load the jsonp-gem:

Message from application: uninitialized constant Rack::JSONP (NameError)

Running Debian Jessie:
Foreman 1.9.3-1
rack-jsonp-middleware (0.0.10)

Actions #1

Updated by Dominic Cleal over 8 years ago

  • Project changed from Salt to Packaging
  • Category set to Debian/Ubuntu

I think this just needs bundler.d/jsonp.rb adding to the Debian package.

Actions #2

Updated by Volker None over 8 years ago

I think this just needs bundler.d/jsonp.rb adding to the Debian package.

If you tell me where to put that line on my running system, i will try and report if that fixes it.

Actions #3

Updated by Dominic Cleal over 8 years ago

https://github.com/theforeman/foreman/blob/develop/bundler.d/jsonp.rb to /usr/share/foreman/bundler.d/jsonp.rb

You'd also need to run sudo -u foreman bundle install from /usr/share/foreman to install the gem.

Actions #4

Updated by Volker None over 8 years ago

Dominic Cleal wrote:

https://github.com/theforeman/foreman/blob/develop/bundler.d/jsonp.rb to /usr/share/foreman/bundler.d/jsonp.rb

You'd also need to run sudo -u foreman bundle install from /usr/share/foreman to install the gem.

$ cd /usr/share/foreman/bundler.d/ && wget https://github.com/theforeman/foreman/blob/develop/bundler.d/jsonp.rb

$ su -foreman -s /bin/bash
$ cd /usr/share/foreman
$ sudo -u foreman bundle install

Restart Apache and JSONP works like a charm. If you're behind a proxy remember, that su/sudo (usually) do not keep environment variables.

Actions #5

Updated by Volker None over 8 years ago

Dominic Cleal wrote:

https://github.com/theforeman/foreman/blob/develop/bundler.d/jsonp.rb to /usr/share/foreman/bundler.d/jsonp.rb

You'd also need to run sudo -u foreman bundle install from /usr/share/foreman to install the gem.

$ cd /usr/share/foreman/bundler.d/ && wget https://github.com/theforeman/foreman/blob/develop/bundler.d/jsonp.rb

$ su -foreman -s /bin/bash
$ cd /usr/share/foreman
$ bundle install

Restart Apache and JSONP works like a charm. If you're behind a proxy remember, that su/sudo (usually) do not keep environment variables.

Actions #6

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Dominic Cleal
  • Pull request https://github.com/theforeman/foreman-packaging/pull/909 added
Actions #7

Updated by Dominic Cleal over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
  • translation missing: en.field_release set to 63
Actions

Also available in: Atom PDF