Bug 1323077

Summary: "Power on" raises error when entrypoint is not on container's $PATH - uninitialized constant Fog::Errors::Error::NotFound
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: Container ManagementAssignee: Daniel Lobato Garcia <dlobatog>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, bkearney, ehelms, mmccune, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/14368
Whiteboard:
Fixed In Version: foreman-1.11.0.23-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:17:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1333805, 1336748    
Bug Blocks: 1321771    
Attachments:
Description Flags
"Power on" to newly created container on atomic host raises error - uninitialized constant Fog::Errors::Error::NotFound
none
complete traceback when this error appeared: Oops, we're sorry but something went wrong uninitialized constant Fog::Errors::Error::NotFound
none
Fog error on webUI
none
I can power on conatiner successfully none

Description Sachin Ghai 2016-04-01 08:14:11 UTC
Created attachment 1142474 [details]
"Power on" to newly created container on atomic host raises error - uninitialized constant Fog::Errors::Error::NotFound

Description of problem: I created a container on registered atomic host using 'docker hub'. Container was created successfully. But when I click on 'power on' button, I got following error:


Error: Error - uninitialized constant Fog::Errors::Error::NotFound

No error in production.log:


2016-04-01 04:05:42 [app] [I] Started PUT "/containers/1/power" for 10.65.193.200 at 2016-04-01 04:05:42 -0400
2016-04-01 04:05:43 [app] [I] Processing by ContainersController#power as HTML
2016-04-01 04:05:43 [app] [I]   Parameters: {"authenticity_token"=>"PWbuBmdIUUdTJRr9E/nEIW3loH1O6Xf8NGccK3kmsMg=", "id"=>"1"}
2016-04-01 04:05:43 [app] [D] Setting current user thread-local variable to admin
2016-04-01 04:05:43 [app] [D] Setting current organization thread-local variable to Default Organization
2016-04-01 04:05:43 [app] [D] Setting current location thread-local variable to none
2016-04-01 04:05:43 [app] [I] Redirected to https://cloud-qe-15.idmqe.lab.eng.bos.redhat.com/containers/1
2016-04-01 04:05:43 [app] [I] Completed 302 Found in 382ms (ActiveRecord: 12.9ms)

Version-Release number of selected component (if applicable):
sat6.2 beta snap6

How reproducible:
always

Steps to Reproduce:
1. create a container on atomic host
2. Power on the container
3.

Actual results:
Error: Error - uninitialized constant Fog::Errors::Error::NotFound

Expected results:
on clicking 'Power ON" container should be up and running and no error should be raised.

Additional info:

Comment 2 Sachin Ghai 2016-04-01 09:39:04 UTC
Please note that I can run container on docker host via `docker run` cmd. But not using satellite webUI. thanks

Comment 3 Daniel Lobato Garcia 2016-04-01 15:41:29 UTC
It looks like this only happens for certain containers. On that URL you posted (https://cloud-qe-15.idmqe.lab.eng.bos.redhat.com/containers/) I was able to turn on all containers but one. I'll investigate what's wrong.

Comment 4 Daniel Lobato Garcia 2016-04-01 15:56:34 UTC
Apparently it only fails when the container entrypoint is wrong. There's something rescuing the wrong constant, not in Foreman or ForemanDocker though (Fog::Errors::Error::NotFound). I'll fix it to rescue the actual problem and display the error. Removing the blocker tag...

Comment 5 Daniel Lobato Garcia 2016-04-01 19:41:56 UTC
Created redmine issue http://projects.theforeman.org/issues/14442 from this bug

Comment 6 Daniel Lobato Garcia 2016-04-01 20:12:40 UTC
Hmmm looks like I can't reproduce this easily -

Error - Cannot start container 6f64bd5cb629c37d29e2f2b05cf71c2f35cc293ce66b6261a9e2785cb0e52809: [8] System error: exec: "top": executable file not found in $PATH 

is what I get when I try to reproduce with the same container:

http://imgur.com/a/DQG6y

Any other hints?

Comment 7 Sachin Ghai 2016-04-12 07:45:16 UTC
I can reproduce this with Sat6.2 snap7.1.  

I created a container using docker hub and selected fedora 23. here is traceback:

2016-04-12 03:42:42 [app] [W] Action failed
 | NameError: uninitialized constant Fog::Errors::Error::NotFound
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.9/lib/foreman_hooks.rb:83:in `load_missing_constant_with_hooks'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-1.37.0/lib/fog/fogdocker/requests/compute/container_action.rb:16:in `rescue in container_action'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-1.37.0/lib/fog/fogdocker/requests/compute/container_action.rb:6:in `container_action'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-1.37.0/lib/fog/fogdocker/models/compute/server.rb:107:in `start'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.3/app/models/service/containers.rb:101:in `run_container'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.3/app/models/service/containers.rb:11:in `block in start_container!'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
 | /opt/rh

Comment 8 Sachin Ghai 2016-04-12 07:47:56 UTC
Created attachment 1146266 [details]
complete traceback when this error appeared: Oops, we're sorry but something went wrong uninitialized constant Fog::Errors::Error::NotFound

Comment 9 Sachin Ghai 2016-04-12 07:48:54 UTC
Created attachment 1146267 [details]
Fog error on webUI

Comment 10 Daniel Lobato Garcia 2016-04-12 09:33:02 UTC
This bug happened to be fixed in Fog 1.38 by David Davis:
  - https://github.com/fog/fog/commit/9ac62416512501d30ebcf9a1c49dadec1f0cc7cc

Upstream, there's no action we should do to fix it, Foreman nightly asks for Fog 1.38.

Downstream, Foreman uses Fog 1.37, which does NOT include this fix. We're not maintaining our own fork of Fog, so to close this bugzilla I guess we could link it with https://github.com/theforeman/foreman/commit/27ae0a7da15b3b26e85645c4773d15ac3d4d5157

Anyone knows how to proceed with this? I'd say we should link this BZ with the Fog 1.38 commit and let Jenkins cherry pick it, but I'd like someone to confirm that first.

Thanks!

Comment 11 Daniel Lobato Garcia 2016-04-13 07:31:11 UTC
Alright, I'll close the current Redmine linked to this and link to the update to Fog 1.38 one.

Comment 12 Daniel Lobato Garcia 2016-04-13 07:33:01 UTC
Connecting redmine issue http://projects.theforeman.org/issues/14368 from this bug

Comment 14 Sachin Ghai 2016-05-17 11:57:32 UTC
Verification of this bz depends on bz 1336748

Comment 15 Sachin Ghai 2016-05-31 11:02:48 UTC
Verified with sat62 GA snap13.1

The reported issue is fixed. I can create a container of fedora23 from docker hub successfully. and In case I specify some thing wrong, I can see exact error

Comment 16 Sachin Ghai 2016-05-31 11:03:38 UTC
Created attachment 1163174 [details]
I can power on conatiner successfully

Comment 17 Bryan Kearney 2016-07-27 11:17:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501