Created attachment 988821 [details] searching image from new container page raises 500: ISE Description of problem: I was trying to create new conatiner but when I tried to search the image from new container page, firebug raises error: --- "NetworkError: 500 Internal Server Error - https://hp-ml370g5-01.rhts.eng.bos.redhat.com/image_search/2/auto_complete_repository_name?search=bus®istry_id=" --- production.log: =============== Processing by ImageSearchController#auto_complete_image_tag as JSON Parameters: {"search"=>"busybox", "registry_id"=>"", "id"=>"2"} String does not start with the prefix 'encrypted-', so ForemanDocker::Docker test was not decrypted Completed 200 OK in 197ms (Views: 0.7ms | ActiveRecord: 5.9ms) Rendered common/500.html.erb (100.5ms) Completed 500 Internal Server Error in 2653ms (Views: 1155.9ms | ActiveRecord: 93.4ms) Version-Release number of selected component (if applicable): * apr-util-ldap-1.3.9-3.el6_0.1.x86_64 * candlepin-0.9.41-1.el6.noarch * candlepin-common-1.0.20-1.el6.noarch * candlepin-scl-1-5.el6_4.noarch * candlepin-scl-quartz-2.1.5-5.el6_4.noarch * candlepin-scl-rhino-1.7R3-1.el6_4.noarch * candlepin-scl-runtime-1-5.el6_4.noarch * candlepin-selinux-0.9.41-1.el6.noarch * candlepin-tomcat6-0.9.41-1.el6.noarch * elasticsearch-0.90.10-7.el6.noarch * foreman-1.7.2.3-1.el6_6sat.noarch * foreman-compute-1.7.2.3-1.el6_6sat.noarch * foreman-gce-1.7.2.3-1.el6_6sat.noarch * foreman-libvirt-1.7.2.3-1.el6_6sat.noarch * foreman-ovirt-1.7.2.3-1.el6_6sat.noarch * foreman-postgresql-1.7.2.3-1.el6_6sat.noarch * foreman-proxy-1.7.2.1-1.el6_6sat.noarch * foreman-selinux-1.7.2.8-1.el6_6sat.noarch * foreman-vmware-1.7.2.3-1.el6_6sat.noarch * katello-2.2.0.2-1.el6_6sat.noarch * katello-certs-tools-2.2.1-1.el6_6sat.noarch * katello-common-2.2.0.2-1.el6_6sat.noarch * katello-default-ca-1.0-1.noarch * katello-installer-2.2.0.3-1.el6_6sat.noarch * katello-installer-base-2.2.0.3-1.el6_6sat.noarch * katello-server-ca-1.0-1.noarch * openldap-2.4.39-8.el6.x86_64 * openldap-devel-2.4.39-8.el6.x86_64 * pulp-docker-plugins-0.2.1-0.2.beta.el6_6sat.noarch * pulp-katello-0.3-4.el6sat.noarch * pulp-nodes-common-2.5.0-0.7.beta.el6_6sat.noarch * pulp-nodes-parent-2.5.0-0.7.beta.el6_6sat.noarch * pulp-puppet-plugins-2.5.0-0.7.beta.el6sat.noarch * pulp-puppet-tools-2.5.0-0.7.beta.el6sat.noarch * pulp-rpm-plugins-2.5.0-0.7.beta.el6_6sat.noarch * pulp-selinux-2.5.0-0.7.beta.el6_6sat.noarch * pulp-server-2.5.0-0.7.beta.el6_6sat.noarch * python-ldap-2.3.10-1.el6.x86_64 * ruby193-rubygem-ldap_fluff-0.3.2-1.el6_6sat.noarch * ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch * ruby193-rubygem-runcible-1.3.0-1.el6_6sat.noarch * rubygem-hammer_cli-0.1.4.3-1.el6_6sat.noarch * rubygem-hammer_cli_foreman-0.1.4.3-1.el6_6sat.noarch * rubygem-hammer_cli_foreman_bootdisk-0.1.2.4-1.el6_6sat.noarch * rubygem-hammer_cli_foreman_tasks-0.0.3.1-1.el6_6sat.noarch * rubygem-hammer_cli_gutterball-0.0.1.1-1.el6_6sat.noarch * rubygem-hammer_cli_import-0.10.6-1.el6sat.noarch * rubygem-hammer_cli_katello-0.0.7.1-1.el6_6sat.noarch How reproducible: always Steps to Reproduce: 1. search the image from new container page 2. 3. Actual results: --- "NetworkError: 500 Internal Server Error - https://hp-ml370g5-01.rhts.eng.bos.redhat.com/image_search/2/auto_complete_repository_name?search=bus®istry_id=" --- Expected results: there shouldn't be any error on searching image from container page Additional info:
I've encountered a similar issue. Searching for a container fails, regardless of whether the compute resource in question is internal to the satellite or on an external machine. Here's some relevant entries from /var/log/foreman/production.log: Processing by ImageSearchController#search_repository as TEXT Parameters: {"search"=>"busybox", "registry_id"=>"", "id"=>"3"} String does not start with the prefix 'encrypted-', so ForemanDocker::Docker this-sat was not decrypted Processing by ImageSearchController#search_repository as TEXT Parameters: {"search"=>"nginx", "registry_id"=>"", "id"=>"2"} String does not start with the prefix 'encrypted-', so ForemanDocker::Docker sesame was not decrypted
Created redmine issue http://projects.theforeman.org/issues/9271 from this bug
Hey Sachinji, I have seen similar errors when the connection to compute resource is not working. We should probably not let you select a Docke rHost if the connection is not working, but that would be a different bug. Have a couple of suggestions that will tell us more from the production log as to why it exactly failed. Uncomment the following line in /usr/share/foreman/config/environments/production.rb #config.log_level = :debug to config.log_level = :debug and then try this again. That will give us exactly why your search did not workout (if its due to bad connection or any other reason). I 'll file an issue to say new container page should not let you select a docker host that has a bad connection. In Jeremy's case going by his logs, it looks like the failure is happening because he has been unable to connect to his docker host. So fixing the "Cant see/select bad docker host to provision to, should fix that."
Created an issue with the alernate headline ... http://projects.theforeman.org/issues/9365
We should handle these errors gracefully and in an informative way that explains to the user what is going on. 500 ISE is an unexpected situation when in fact, remote computing resources being unavailable, misconfigured or not supporting the requested query is highly likely and not uncommon. For 6.1 I'd say we trap these errors and tell user what is going and what they may do to resolve it.
Moving to POST since upstream bug http://projects.theforeman.org/issues/9271 has been closed ------------- Anonymous Applied in changeset commit:foreman-docker|70dd1b818ffb1f9d812ad69f04a2f941e24451a0.
Verified with snap11/RC5. (Satellite-6.1.0-RHEL-7-20150407.1). case 1: when docker compute-resource is correctly configured. I can search the image from new container page. Please see the screenshot.
Created attachment 1012111 [details] success on seraching image from new container page
when no docker type compute-resource is defined then on selecting new container, UI says: "You need a Docker compute resource in order to create containers. Please add a new one and try again."
case3: In case we set incorrect docker host, getting error: An error occured during repository search: 'getaddrinfo: Name or service not known (SocketError)' along with NetworkError: 500 Internal Server Error - https://host_name/image_search/5/auto_complete_repository_name?search=b®istry_id=" I think we can raise here more user friendly error when docker host is not reachable as per comment 5 and 7.
Created attachment 1012124 [details] when docker_host is not reachable, image search on new container page fails with error: 'getaddrinfo: Name or service not known (SocketError)'
I'd say the above error handling is acceptable, 'getaddrinfo: Name or service not known (SocketError)' is a fairly standard error message indicating that the hostname can not be resolved. We correctly show this error in the error dialog. Perhaps it could be a bit more friendly and state that the user should check the Hostname/URL for the compute resource but we are at least trapping the condition and showing the error to the user. For 6.1 I'd argue this is acceptable.
verified with sat6.1.1 GA snap13. As per comment 16, 'getaddrinfo: Name or service not known (SocketError)' is a standard error, so moving this verified.
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/RHSA-2015:1592