Cannot load such file -- apipie/middleware/checksum_in_headers

Cross-posting for better visibility (duplicate of
https://groups.google.com/d/msg/foreman-users/yGDRlmWZnwc/qrw9aMkkCwkJ)

I have a problem while migrating from 1.5.3 to 1.7.1.
As suggested, I tried manual DB migration as well to no avail.

If I try to run db:migrate I get the following error (foreman-installer
gives me the same error):

foreman-rake --trace db:migrate

rake aborted!
cannot load such file – apipie/middleware/checksum_in_
headers
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in
require' /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:inrequire'
/usr/share/foreman/config/application.rb:2:in <top (required)>' /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:inrequire'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in
require&#39; /usr/share/foreman/Rakefile:1:in<top (required)>'
/opt/rh/ruby193/root/usr/share/ruby/rake/rake_module.rb:25:in load&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/rake_module.rb:25:inload_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:501:in
raw_load_rakefile&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:82:inblock in
load_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:81:inload_rakefile'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:65:in block in run&#39; /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:instandard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in run&#39; /opt/rh/ruby193/root/usr/bin/rake:32:in<main>'

foreman-rake db:seed

rake aborted!
cannot load such file – apipie/middleware/checksum_in_headers

(See full trace by running task with --trace)

foreman-rake tmp:cache:clear

rake aborted!
cannot load such file – apipie/middleware/checksum_in_headers

(See full trace by running task with --trace)

··· #

In UI this error results in the following messages:

Oops, we’re sorry but something went wrong

Warning!undefined method `find_by_lower_login’ for
#Class:0x0000000879b2d0

If you feel this is an error with Foreman itself, please open a new issue
with Foreman ticketing system
http://theforeman.org/projects/foreman/issues, You would probably need to
attach the Full trace https://lvs01ppm01.stratus.lvs.ebay.com/users/login#
and relevant log entries.
NoMethodError
*undefined method find_by_lower_login' for #<Class:0x0000000879b2d0>* app/models/user.rb:263:infind_by_login’
app/models/user.rb:188:in try_to_login' app/controllers/users_controller.rb:71:inlogin’
app/models/concerns/foreman/thread_session.rb:33:in clear_thread' lib/middleware/catch_json_parse_errors.rb:9:incall’
Back https://lvs01ppm01.stratus.lvs.ebay.com/

I must be missing some package that installer does not bring in either.
Maybe some GEM or something?

Anyone had and solved this problem?
Thanks!

Hey,

> Cross-posting for better visibility (duplicate of
> https://groups.google.com/d/msg/foreman-users/yGDRlmWZnwc/qrw9aMkkCwkJ)

please don't do that. We do see all the mails.

> I have a problem while migrating from 1.5.3 to 1.7.1.

This is not supported, you should upgrade to 1.6 and then 1.7. But you
can always backup and at least try it if it works.

> cannot load such file – apipie/middleware/checksum_in_
> headers

You must have inocrrect version of apipie gem. Have you followed our
upgrade instructions carefully? You need to do yum upgrade foreman*
packages as well as all rubygem* packages (or ruby193-rubygem*). See the
manual chapter.

··· -- Later, Lukas #lzap Zapletal

>
> > Cross-posting for better visibility (duplicate of
> > https://groups.google.com/d/msg/foreman-users/yGDRlmWZnwc/qrw9aMkkCwkJ)
>
> please don't do that. We do see all the mails.
>

Sorry for extra post. However, the only response I've got was for this 2nd
post.

>
> > I have a problem while migrating from 1.5.3 to 1.7.1.
>
> This is not supported, you should upgrade to 1.6 and then 1.7. But you
> can always backup and at least try it if it works.
>

Hmm, I must have missed that in release nodes. Wanted to double-check, but
can't get to theforeman.org for a second day now - do you know what's going
on?

> > cannot load such file – apipie/middleware/checksum_in_
> > headers
>
> You must have inocrrect version of apipie gem. Have you followed our
> upgrade instructions carefully? You need to do yum upgrade foreman*
> packages as well as all rubygem* packages (or ruby193-rubygem*). See the
> manual chapter.
>

Below is the list of the packages and versions. I did follow the
instructions to upgrade my Foreman VM. However, the issues I'm having must
be related to the fact that I skipped the db:migrate when moving from 1.5.x
to 1.6.x, so packages were properly upgraded, but DB was not.

If you have some suggestions on handling this kind of situation, I'd love
to hear that - I really don't want to build a VM with 1.6.x just to do a
db:migrate. I will, of course, if no other possibilities exist.

Thanks!

-bash-4.1$ rpm -qa | egrep "foreman|ruby193"
ruby193-rubygem-fog-xml-0.1.0-1.el6.noarch
ruby193-rubygem-thin-1.3.1-7.el6.x86_64
ruby193-rubygem-tzinfo-0.3.33-3.el6.noarch
ruby193-rubygem-foreigner-1.4.2-1.el6.noarch
foreman-selinux-1.7.1-1.el6.noarch
ruby193-rubygem-will_paginate-3.0.2-7.el6.noarch
ruby193-rubygem-jquery-ui-rails-4.1.2-1.el6.noarch
foreman-1.7.1-1.el6.noarch
foreman-libvirt-1.7.1-1.el6.noarch
ruby193-rubygem-foreman_discovery-1.4.1-1.el6.noarch
foreman-cli-1.7.1-1.el6.noarch
ruby193-rubygem-net-ssh-2.6.7-1.el6.noarch
ruby193-rubygem-foreman_default_hostgroup-3.0.0-1.el6.noarch
ruby193-rubygem-passenger-native-4.0.18-9.6.el6.x86_64
ruby193-rubygem-minitest-3.5.0-3.el6.noarch
ruby193-rubygem-hirb-unicode-0.0.5-5.el6.noarch
ruby193-rubygem-excon-0.38.0-1.el6.noarch
rubygem-foreman_api-0.1.11-1.el6.noarch
ruby193-rubygem-awesome_print-1.0.2-10.el6.noarch
ruby193-rubygem-jwt-0.1.8-1.el6.noarch
ruby193-rubygem-flot-rails-0.0.3-3.el6.noarch
ruby193-rubygem-signet-0.4.5-1.el6.noarch
ruby193-rubygem-rbovirt-0.0.29-1.el6.noarch
ruby193-rubygem-levenshtein-0.2.2-2.el6.x86_64
ruby193-rubygem-sshkey-1.6.0-2.el6.noarch
ruby193-rubygem-gettext-2.3.7-4.el6.noarch
ruby193-ruby-libs-1.9.3.327-29.el6.x86_64
ruby193-rubygem-rdoc-3.12-12.el6.x86_64
ruby193-rubygems-1.8.24-3.el6.noarch
ruby193-rubygem-archive-tar-minitar-0.5.2-9.el6.noarch
ruby193-rubygem-foreman_memcache-0.0.3-1.el6.noarch
ruby193-rubygem-sass-3.2.13-1.el6.noarch
ruby193-rubygem-builder-3.0.0-3.el6.noarch
ruby193-rubygem-activeresource-3.2.8-3.el6.noarch
ruby193-rubygem-uglifier-1.2.6-3.el6.noarch
ruby193-rubygem-thor-0.15.4-4.el6.noarch
ruby193-rubygem-rack-cache-1.2-3.el6.noarch
ruby193-rubygem-mysql2-0.3.11-4.el6.x86_64
ruby193-rubygem-coffee-script-source-1.3.3-4.el6.noarch
ruby193-rubygem-foreman_setup-2.1.1-1.el6.noarch
ruby193-rubygem-passenger-native-libs-4.0.18-9.6.el6.x86_64
ruby193-rubygem-netrc-0.7.7-5.el6.noarch
ruby193-rubygem-daemons-1.1.4-7.el6.noarch
ruby193-rubygem-fog-radosgw-0.0.3-1.el6.noarch
ruby193-rubygem-gettext_i18n_rails_js-0.0.8-2.el6.noarch
ruby193-rubygem-wicked-1.1.0-1.el6.noarch
ruby193-rubygem-scoped_search-2.7.1-1.el6.noarch
ruby193-rubygem-ldap_fluff-0.3.3-1.el6.noarch
ruby193-rubygem-therubyracer-0.11.0-0.4.beta5.el6.x86_64
ruby193-rubygem-docker-api-1.13.6-1.el6.noarch
foreman-compute-1.7.1-1.el6.noarch
foreman-installer-1.7.1-1.el6.noarch
ruby193-rubygem-foreman_docker-0.2.0-2.el6.noarch
ruby193-rubygem-foreman_salt-1.1.0-1.el6.noarch
ruby193-rubygem-puppetdb_foreman-0.1.2-1.el6.noarch
ruby193-rubygem-formatador-0.2.1-6.el6.noarch
foreman-release-scl-1-1.el6.x86_64
ruby193-rubygem-hirb-0.7.0-6.el6.noarch
ruby193-rubygem-unicode-display_width-0.1.1-6.el6.noarch
ruby193-rubygem-validates_lengths_from_database-0.2.0-1.el6.noarch
ruby193-rubygem-net-ldap-0.3.1-2.el6.noarch
ruby193-rubygem-addressable-2.3.5-1.el6.noarch
ruby193-rubygem-launchy-2.3.0-1.el6.noarch
ruby193-rubygem-faraday-0.8.8-1.el6.noarch
ruby193-rubygem-spice-html5-rails-0.1.4-1.el6.noarch
rubygem-hammer_cli_foreman-0.1.3-1.el6.noarch
ruby193-rubygem-locale-2.0.9-8.el6.noarch
ruby193-rubygem-json-1.5.4-29.el6.x86_64
ruby193-ruby-1.9.3.327-29.el6.x86_64
ruby193-rubygem-ftools-0.0.0-3.el6.noarch
ruby193-rubygem-diffy-3.0.1-1.el6.noarch
ruby193-rubygem-sexp_processor-4.1.3-4.el6.noarch
ruby193-rubygem-foreman_templates-1.4.0-2.el6.noarch
ruby193-rubygem-i18n-0.6.0-4.el6.noarch
ruby193-rubygem-activemodel-3.2.8-3.el6.noarch
ruby193-rubygem-i18n_data-0.2.7-2.el6.noarch
ruby193-rubygem-ruby2ruby-2.0.1-7.el6.noarch
ruby193-rubygem-eventmachine-0.12.10-9.el6.x86_64
ruby193-rubygem-po_to_json-0.0.7-2.el6.noarch
ruby193-rubygem-polyglot-0.3.3-3.el6.noarch
ruby193-rubygem-coffee-script-2.2.0-3.el6.noarch
ruby193-rubygem-actionpack-3.2.8-6.el6.noarch
ruby193-rubygem-coffee-rails-3.2.2-3.el6.noarch
ruby193-rubygem-passenger-4.0.18-9.6.el6.x86_64
ruby193-rubygem-rest-client-1.6.7-2.el6.noarch
ruby193-rubygem-fog-sakuracloud-0.1.1-1.el6.noarch
ruby193-rubygem-bundler-1.1.4-4.el6.noarch
ruby193-rubygem-jquery_pwstrength_bootstrap-1.2.2-1.el6.noarch
ruby193-rubygem-rails-3.2.8-2.el6.noarch
ruby193-rubygem-ref-1.0.0-4.el6.noarch
ruby193-facter-2.2.0-1.1.el6.x86_64
ruby193-rubygem-foreman_abrt-0.0.4-1.el6.noarch
foreman-mysql2-1.7.1-1.el6.noarch
ruby193-rubygem-foreman_dhcp_browser-0.0.6-1.el6.noarch
ruby193-rubygem-net-scp-1.1.0-3.el6.noarch
ruby193-rubygem-sprockets-2.8.2-2.el6.noarch
ruby193-rubygem-fog-brightbox-0.0.1-1.el6.noarch
ruby193-rubygem-wirb-0.4.2-6.el6.noarch
ruby193-rubygem-safemode-1.2.1-1.el6.noarch
ruby193-rubygem-fog-softlayer-0.3.9-1.el6.noarch
ruby193-rubygem-fast_gettext-0.8.0-15.el6.noarch
ruby193-rubygem-bundler_ext-0.3.0-6.el6.noarch
ruby193-rubygem-autoparse-0.3.3-1.el6.noarch
ruby193-rubygem-multipart-post-1.2.0-2.el6.noarch
ruby193-rubygem-pg-0.12.2-8.el6.x86_64
ruby193-rubygem-rbvmomi-1.6.0-2.el6.noarch
ruby193-runtime-1-9.el6.x86_64
ruby193-rubygem-bigdecimal-1.1.0-29.el6.x86_64
ruby193-rubygem-open4-1.3.0-8.el6.noarch
ruby193-rubygem-rake-0.9.2.2-29.el6.noarch
ruby193-rubygem-dalli-2.6.4-1.el6.noarch
ruby193-rubygem-ruby_parser-3.1.1-5.el6.noarch
ruby193-rubygem-activesupport-3.2.8-6.el6.noarch
ruby193-rubygem-gettext_i18n_rails-0.10.0-3.el6.noarch
ruby193-rubygem-rabl-0.9.0-1.el6.noarch
ruby193-v8-3.10.8-7.el6.x86_64
ruby193-rubygem-uuidtools-2.1.3-3.el6.noarch
ruby193-rubygem-erubis-2.7.0-5.el6.noarch
ruby193-rubygem-treetop-1.4.10-6.el6.noarch
ruby193-rubygem-rack-test-0.6.1-3.el6.noarch
ruby193-rubygem-railties-3.2.8-3.el6.noarch
ruby193-rubygem-sass-rails-3.2.5-3.el6.noarch
ruby193-rubygem-net-http-persistent-2.7-3.el6.noarch
ruby193-rubygem-fog-1.24.0-1.el6.noarch
ruby193-rubygem-activerecord-3.2.8-12.el6.noarch
ruby193-rubygem-friendly_id-4.0.10.1-1.el6.noarch
ruby193-rubygem-ancestry-2.0.0-2.el6.noarch
ruby193-rubygem-secure_headers-1.3.3-1.el6.noarch
ruby193-rubygem-audited-activerecord-3.0.0-2.el6.noarch
foreman-proxy-1.7.1-1.el6.noarch
ruby193-rubygem-apipie-rails-0.2.6-1.el6.noarch
foreman-vmware-1.7.1-1.el6.noarch
foreman-console-1.7.1-1.el6.noarch
foreman-postgresql-1.7.1-1.el6.noarch
ruby193-rubygem-fog-json-1.0.0-2.el6.noarch
foreman-assets-1.7.1-1.el6.noarch
ruby193-rubygem-nokogiri-1.5.11-1.el6.x86_64
rhscl-ruby193-epel-6-x86_64-1-2.noarch
ruby193-rubygem-ruby-libvirt-0.5.1-1.el6.x86_64
ruby193-rubygem-ipaddress-0.8.0-6.el6.noarch
ruby193-rubygem-deep_cloneable-2.0.0-4.el6.noarch
ruby193-rubygem-unf_ext-0.0.6-5.el6.x86_64
ruby193-rubygem-unf-0.1.3-4.el6.x86_64
ruby193-rubygem-oauth-0.4.7-6.el6.noarch
ruby193-rubygem-multi_json-1.8.2-2.el6.noarch
ruby193-rubygem-extlib-0.9.16-1.el6.noarch
ruby193-rubygem-multi-select-rails-0.9.10-1.el6.noarch
ruby193-rubygem-google-api-client-0.6.4-1.el6.noarch
ruby193-rubygem-quiet_assets-1.0.2-6.el6.noarch
ruby193-rubygem-trollop-2.0-2.el6.noarch
ruby193-rubygem-gridster-rails-0.1.5-4.el6.noarch
ruby193-ruby-irb-1.9.3.327-29.el6.noarch
ruby193-rubygem-io-console-0.3-29.el6.x86_64
ruby193-rubygem-rack-1.4.1-5.el6.noarch
ruby193-rubygem-deface-0.7.2-6.el6.noarch
ruby193-rubygem-execjs-1.4.0-5.el6.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6.noarch
ruby193-rubygem-tilt-1.3.3-9.el6.noarch
ruby193-rubygem-mime-types-1.19-2.el6.noarch
ruby193-rubygem-bootstrap-sass-3.0.3.0-1.el6.noarch
ruby193-rubygem-diff-lcs-1.1.3-4.el6.noarch
ruby193-rubygem-journey-1.0.4-2.el6.noarch
ruby193-rubygem-rack-ssl-1.3.2-8.el6.noarch
ruby193-rubygem-arel-3.0.2-4.el6.noarch
ruby193-rubygem-audited-3.0.0-2.el6.noarch
ruby193-rubygem-mail-2.4.4-5.el6.noarch
ruby193-rubygem-hike-1.2.1-4.el6.noarch
ruby193-rubygem-jquery-rails-2.0.2-3.el6.noarch
ruby193-rubygem-fog-core-1.24.0-1.el6.noarch
ruby193-rubygem-actionmailer-3.2.8-2.el6.noarch
-bash-4.1$

··· -- > Later, > Lukas #lzap Zapletal >

> Wanted to double-check, but can't get to theforeman.org for a second day
now - do you know what's going on?

Disregard this, something on VPN prevents me from getting to it.

I'm actually getting the error even on freshly-installed VM with 1.6.3
trying to do a missed db:migrate step:

foreman-rake db:migrate

rake aborted!
cannot load such file – apipie/middleware/checksum_in_headers

(See full trace by running task with --trace)

rpm -qa | grep apipie

rubygem-apipie-bindings-0.0.10-1.el6.noarch
ruby193-rubygem-apipie-rails-0.2.5-1.el6.noarch

··· #

Any advice?

> Any advice?

Use foreman-debug tool to upload a debug tarball for us.

It's hard to tell from what you provide here.

··· -- Later, Lukas #lzap Zapletal

foreman-debug-25XAi.tar.xz has been uploaded.

Please note that foreman-debug did not seem to correctly discover a fact
that I'm running puppet and passenger under rvm with ruby 2.1.3p242, but i
don't think it has anything to do with Foreman, which uses ruby 1.9.3 from
ruby193 SCL.

Thanks!

Actually RVM is at play here.

By default each user will get ruby-2.1.3, so before i execute
foreman-installer, for example, I have to run "rvm use system".
Now, foreman-rake script does "su - foreman…" and runs a command within
that, so su'ing to foreman drops back to ruby-2.1.3 and thus not finding a
gem (as the paths different).

I should be able to do the above on production now and proceed further with
1.7.1.

Sometimes just laying the facts for other people to understand the
situation solves the problem :slight_smile:

Ok so it's sorted out.

I don't recommend to use RVM/RBENV on installer-based deployments. We do
fully support several linux distros and our repos contain all the
required dependencies.

LZ

··· On Thu, Feb 05, 2015 at 12:59:23PM -0800, Konstantin Orekhov wrote: > Actually RVM *is* at play here. > > By default each user will get ruby-2.1.3, so before i execute > foreman-installer, for example, I have to run "rvm use system". > Now, foreman-rake script does "su - foreman..." and runs a command within > that, so su'ing to foreman drops back to ruby-2.1.3 and thus not finding a > gem (as the paths different). > > I should be able to do the above on production now and proceed further with > 1.7.1. > > Sometimes just laying the facts for other people to understand the > situation solves the problem :)


Later,
Lukas #lzap Zapletal