The web application could not be started following upgrade to 1.9.3

I'm having a problem following an upgrade from 1.7 to 1.9.3.

When editing a host, I will occasionally get this error:

/usr/share/foreman/config/application.rb:

180: syntax error, unexpected ')'
))
^ (SyntaxError)
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require'
/usr/share/foreman/config/environment.rb:2
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require'
config.ru:3
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in instance_eval' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in initialize'
config.ru:1:in `new'
config.ru:1

This seemed to start after I applied the following changes, to fix an issue
that was introduced during the upgrade:


https://github.com/theforeman/foreman/commit/35241dd65a6b4f426374a03e83d6f796f59a9d35

The upgrade seemed to create interfaces with duplicate IP's on the same
host records (anything that had a bond).

I applied the changes of those three files, and now I'm intermittently
getting that web application error above.

Could this change have caused corruption in my database? I don't see a
syntax error in /usr/share/foreman/config/application.rb.

It exactly matches the file in the 1.9-stable branch.

The piece of code it's complaining about is here:

# Check that the loggers setting exist to configure the app and sql 

loggers
Foreman::Logging.add_loggers((SETTINGS[:loggers] || {}).reverse_merge(
:app => {:enabled => true},
:ldap => {:enabled => false},
:permissions => {:enabled => false},
:sql => {:enabled => true},
))

Line 180 is the last line, "))". It doesn't look invalid to me, and again,
I compared it to what's in 1.9-stable, and it matches. So it's a little
confusing why I'd be seeing a syntax error here?

··· On Tuesday, December 15, 2015 at 8:53:53 AM UTC-8, Kyle Flavin wrote: > > I'm having a problem following an upgrade from 1.7 to 1.9.3. > > When editing a host, I will occasionally get this error: > > /usr/share/foreman/config/application.rb: > > 180: syntax error, unexpected ')' > )) > ^ (SyntaxError) > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' > /usr/share/foreman/config/environment.rb:2 > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' > config.ru:3 > /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval' > /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize' > config.ru:1:in `new' > config.ru:1 > > > This seemed to start after I applied the following changes, to fix an > issue that was introduced during the upgrade: > > http://projects.theforeman.org/issues/12486 > > https://github.com/theforeman/foreman/commit/35241dd65a6b4f426374a03e83d6f796f59a9d35 > > The upgrade seemed to create interfaces with duplicate IP's on the same > host records (anything that had a bond). > > I applied the changes of those three files, and now I'm intermittently > getting that web application error above. > > Could this change have caused corruption in my database? I don't see a > syntax error in /usr/share/foreman/config/application.rb. > > It exactly matches the file in the 1.9-stable branch. > >

This indicates that Foreman is running under Ruby 1.8.7, but this
version isn't supported. It wasn't supported in 1.7 either, so I
suspect there's a misconfiguration somewhere.

If you used the Foreman installer to set it all up, then we'd need to
see the relevant Apache virtualhost config (especially the value of
PassengerRuby, if set) and to know precisely which OS you're using to
know what to check.

If not, ensure the Ruby interpreter used by your app server is 1.9 or
higher.

··· On 15/12/15 16:53, Kyle Flavin wrote: > I'm having a problem following an upgrade from 1.7 to 1.9.3. > > When editing a host, I will occasionally get this error: > > /usr/share/foreman/config/application.rb: > > 180: syntax error, unexpected ')' > )) > ^ (SyntaxError) > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' > /usr/share/foreman/config/environment.rb:2 > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' > config.ru:3 > /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval' > /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize' > config.ru:1:in `new' > config.ru:1


Dominic Cleal
dominic@cleal.org

cat passenger.conf
LoadModule passenger_module modules/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/locations.ini
PassengerRuby /usr/bin/ruby
</IfModule>

cat /etc/redhat-release

Red Hat Enterprise Linux Server release 6.6 (Santiago)

uname -r

2.6.32-504.el6.x86_64

Followed the instructions here and did a "yum upgrade foreman* ruby*
http://theforeman.org/manuals/1.9/index.html#3.6Upgrade

It looks like ruby193 was installed via RHSCL. If I do an rpm -qa, I see
many ruby193-* packages. I do see that 1.8 is still on there. It looks
like Foreman isn't using the RHCSL packages? Is it as simple as modifying
the passenger.conf configuration to use the new Ruby?

I believe it was setup with foreman-installer originally. When I upgraded,
I did not run foreman-installer again.

··· On Tuesday, December 15, 2015 at 8:58:57 AM UTC-8, Dominic Cleal wrote: > > On 15/12/15 16:53, Kyle Flavin wrote: > > I'm having a problem following an upgrade from 1.7 to 1.9.3. > > > > When editing a host, I will occasionally get this error: > > > > /usr/share/foreman/config/application.rb: > > > > 180: syntax error, unexpected ')' > > )) > > ^ (SyntaxError) > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require' > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' > > /usr/share/foreman/config/environment.rb:2 > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require' > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' > > config.ru:3 > > /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in > `instance_eval' > > /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in > `initialize' > > config.ru:1:in `new' > > config.ru:1 > > This indicates that Foreman is running under Ruby 1.8.7, but this > version isn't supported. It wasn't supported in 1.7 either, so I > suspect there's a misconfiguration somewhere. > > If you used the Foreman installer to set it all up, then we'd need to > see the relevant Apache virtualhost config (especially the value of > PassengerRuby, if set) and to know precisely which OS you're using to > know what to check. > > If not, ensure the Ruby interpreter used by your app server is 1.9 or > higher. > > -- > Dominic Cleal > dom...@cleal.org >

PassengerRuby should be set to /usr/bin/ruby193-ruby and it should then
work correctly.

For future reference, as of Foreman 1.10, it should be /usr/bin/tfm-ruby
(though the old one will continue to work for a some time).

As you say, Foreman is probably entirely running under 1.8 there, which
means it was probably not using the dependencies/packages we supply, it
must have had some others installed via Bundler or similar.

··· -- Dominic Cleal dominic@cleal.org

On 15/12/15 17:08, Kyle Flavin wrote:

cat passenger.conf
LoadModule passenger_module modules/mod_passenger.so

PassengerRoot
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/locations.ini
PassengerRuby /usr/bin/ruby

cat /etc/redhat-release

Red Hat Enterprise Linux Server release 6.6 (Santiago)

uname -r

2.6.32-504.el6.x86_64

Followed the instructions here and did a "yum upgrade foreman* ruby*
Foreman :: Manual

It looks like ruby193 was installed via RHSCL. If I do an rpm -qa, I
see many ruby193-* packages. I do see that 1.8 is still on there. It
looks like Foreman isn’t using the RHCSL packages? Is it as simple as
modifying the passenger.conf configuration to use the new Ruby?

I believe it was setup with foreman-installer originally. When I
upgraded, I did not run foreman-installer again.

On Tuesday, December 15, 2015 at 8:58:57 AM UTC-8, Dominic Cleal wrote:

On 15/12/15 16:53, Kyle Flavin wrote:
> I'm having a problem following an upgrade from 1.7 to 1.9.3.
>
> When editing a host, I will occasionally get this error:
>
> /usr/share/foreman/config/application.rb:
>
> 180: syntax error, unexpected ')'
>     ))
>      ^ (SyntaxError)
>   /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
>   /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
>   /usr/share/foreman/config/environment.rb:2
>   /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
>   /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
>   config.ru:3 <http://config.ru:3>
>   /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in
`instance_eval'
>   /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in
`initialize'
>   config.ru:1:in `new'
>   config.ru:1 <http://config.ru:1>

This indicates that Foreman is running under Ruby 1.8.7, but this
version isn't supported.  It wasn't supported in 1.7 either, so I
suspect there's a misconfiguration somewhere.

If you used the Foreman installer to set it all up, then we'd need to
see the relevant Apache virtualhost config (especially the value of
PassengerRuby, if set) and to know precisely which OS you're using to
know what to check.

If not, ensure the Ruby interpreter used by your app server is 1.9 or
higher.

-- 
Dominic Cleal
dom...@cleal.org <javascript:>


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto:foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Thanks Dominic.

I changed the passenger config from this:

LoadModule passenger_module modules/mod_passenger.so

<IfModule mod_passenger.c>

PassengerRoot
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/locations.ini

PassengerRuby /usr/bin/ruby

</IfModule>

To this:

LoadModule passenger_module modules/mod_passenger.so

<IfModule mod_passenger.c>

PassengerRoot
/opt/rh/ruby193/root/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/locations.ini

PassengerRuby /opt/rh/ruby193/root/usr/bin/ruby

</IfModule>

And it seems to be working. Appreciate the assistance.

··· On Tuesday, December 15, 2015 at 9:11:01 AM UTC-8, Dominic Cleal wrote: > > PassengerRuby should be set to /usr/bin/ruby193-ruby and it should then > work correctly. > > For future reference, as of Foreman 1.10, it should be /usr/bin/tfm-ruby > (though the old one will continue to work for a some time). > > As you say, Foreman is probably entirely running under 1.8 there, which > means it was probably not using the dependencies/packages we supply, it > must have had some others installed via Bundler or similar. > > -- > Dominic Cleal > dom...@cleal.org > > On 15/12/15 17:08, Kyle Flavin wrote: > > cat passenger.conf > > LoadModule passenger_module modules/mod_passenger.so > > > > PassengerRoot > > > /usr/lib/ruby/gems/1.8/gems/passenger-4.0.18/lib/phusion_passenger/locations.ini > > > PassengerRuby /usr/bin/ruby > > > > > > # cat /etc/redhat-release > > Red Hat Enterprise Linux Server release 6.6 (Santiago) > > # uname -r > > 2.6.32-504.el6.x86_64 > > > > Followed the instructions here and did a "yum upgrade foreman\* ruby\* > > http://theforeman.org/manuals/1.9/index.html#3.6Upgrade > > > > It looks like ruby193 was installed via RHSCL. If I do an rpm -qa, I > > see many ruby193-* packages. I do see that 1.8 is still on there. It > > looks like Foreman isn't using the RHCSL packages? Is it as simple as > > modifying the passenger.conf configuration to use the new Ruby? > > > > I believe it was setup with foreman-installer originally. When I > > upgraded, I did not run foreman-installer again. > > > > > > > > > > On Tuesday, December 15, 2015 at 8:58:57 AM UTC-8, Dominic Cleal wrote: > > > > On 15/12/15 16:53, Kyle Flavin wrote: > > > I'm having a problem following an upgrade from 1.7 to 1.9.3. > > > > > > When editing a host, I will occasionally get this error: > > > > > > /usr/share/foreman/config/application.rb: > > > > > > 180: syntax error, unexpected ')' > > > )) > > > ^ (SyntaxError) > > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > `gem_original_require' > > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > `require' > > > /usr/share/foreman/config/environment.rb:2 > > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > `gem_original_require' > > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > `require' > > > config.ru:3 > > > /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in > > `instance_eval' > > > /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in > > `initialize' > > > config.ru:1:in `new' > > > config.ru:1 > > > > This indicates that Foreman is running under Ruby 1.8.7, but this > > version isn't supported. It wasn't supported in 1.7 either, so I > > suspect there's a misconfiguration somewhere. > > > > If you used the Foreman installer to set it all up, then we'd need > to > > see the relevant Apache virtualhost config (especially the value of > > PassengerRuby, if set) and to know precisely which OS you're using > to > > know what to check. > > > > If not, ensure the Ruby interpreter used by your app server is 1.9 > or > > higher. > > > > -- > > Dominic Cleal > > dom...@cleal.org > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to foreman-user...@googlegroups.com > > <mailto:foreman-users+unsubscribe@googlegroups.com >. > > To post to this group, send email to forema...@googlegroups.com > > > <mailto:forema...@googlegroups.com >. > > Visit this group at https://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > > >