Description of problem: After deleting container that has been *run*, the container name cannot be reused. Version-Release number of selected component (if applicable): How reproducible: always Steps to Reproduce: 1. Create container named container1 (Content View or Docker hub image source) 2. Power On container1 3. Power Off container1 (optional) 4. Delete container1 5. Create container named container1 once again Error: Name has already been taken 2016-04-01 11:15:23 [app] [I] Started PUT "/wizard_states/61/steps/environment" for <CLIENT_IP> at 2016-04-01 11:15:23 -0400 2016-04-01 11:15:23 [app] [I] Processing by Containers::StepsController#update as HTML 2016-04-01 11:15:23 [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"dMjOnoqlyNKIhe/qULFtl8tdFQWqOChydOjXaz1lpBU=", "docker_container_wizard_states_environment"=>{"tty"=>"0", "attach_stdin"=>"1", "attach_stdout"=>"1", "attach_stderr"=>"1"}, "button"=>"", "wizard_state_id"=>"61", "id"=>"environment"} 2016-04-01 11:15:23 [app] [I] Failed to save: 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/foreman_docker/common_parameters/_environment_variable.html.erb (0.6ms) 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/foreman_docker/common_parameters/_environment_variables.html.erb (2.3ms) 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/foreman_docker/common_parameters/_exposed_port.html.erb (0.6ms) 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/foreman_docker/common_parameters/_exposed_ports.erb (3.1ms) 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/foreman_docker/common_parameters/_dns_entry.html.erb (0.4ms) 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/foreman_docker/common_parameters/_dns.erb (2.8ms) 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/containers/steps/_form_buttons.html.erb (0.4ms) 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/containers/steps/_title.html.erb (11.6ms) 2016-04-01 11:15:23 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.2/app/views/containers/steps/environment.html.erb within layouts/application (11.9ms) 2016-04-01 11:15:23 [app] [I] Rendered layouts/_application_content.html.erb (0.2ms) 2016-04-01 11:15:23 [app] [I] Rendered home/_submenu.html.erb (0.6ms) 2016-04-01 11:15:23 [app] [I] Rendered home/_user_dropdown.html.erb (0.8ms) 2016-04-01 11:15:23 [app] [I] Read fragment views/tabs_and_title_records-3 (0.1ms) 2016-04-01 11:15:23 [app] [I] Rendered home/_topbar.html.erb (2.3ms) 2016-04-01 11:15:23 [app] [I] Rendered layouts/base.html.erb (2.9ms) 2016-04-01 11:15:23 [app] [I] Completed 200 OK in 45ms (Views: 15.7ms | ActiveRecord: 5.1ms) Actual results: name cannot be reused Expected results: name can be reused Additional info:
Version-Release number of selected component (if applicable): @Sat6.2.0-Beta-Snap6
Created redmine issue http://projects.theforeman.org/issues/14570 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/14570 has been closed ------------- Daniel Lobato Garcia Applied in changeset commit:foreman-docker|2fbd23c328e4d0c90ea845e10eb3529135e41250.
FailedQA. @satellite-6.2.0-13.0.el7sat.noarch tfm-rubygem-foreman_docker-2.0.1.9-1.el7sat.noarch Used reproducer in comment #0 and for contaner name 'container1' it is OK But for container name 'centos_hub' it behaves still same Error: Name has already been taken And "docker ps -a" show no such container so there should be no such error. Problem could be that 'centos_hub' container at UI is displayed as "Centos Hub" (i.e. with space)
Now even reproduced with simple container name "busybox" 1) # docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e15da18670ed satelliteqe/robottelo:latest "python -m SimpleHTTP" 2 days ago Up 2 days 22/tcp, 12345/tcp container2 2) UI: creating "busybox" container 2016-05-26 07:48:05 [app] [I] Started PUT "/wizard_states/14/steps/environment" for 10.34.130.242 at 2016-05-26 07:48:05 -0400 2016-05-26 07:48:05 [app] [I] Processing by Containers::StepsController#update as HTML 2016-05-26 07:48:05 [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"Cqowi1wZonkqO3cOzYbZ3ObizudoJypwnRIbgI/519c=", "docker_container_wizard_states_environment"=>{"tty"=>"0", "attach_stdin"=>"1", "attach_stdout"=>"1", "attach_stderr"=>"1"}, "button"=>"", "wizard_state_id"=>"14", "id"=>"environment"} 2016-05-26 07:48:05 [app] [I] Failed to save:
Lukas, do you happen to have a machine where this is reproducible? Daniel mentioned he is unable to reproduce locally.
It got worse. Instead of 'Error: Name has already been taken' it fails at UI: Oops, we're sorry but something went wrong undefined method `full_messages' for #<Array:0x0000000a9ec8c0> 2016-06-17 16:09:20 [app] [I] Started PUT "/wizard_states/14/steps/environment" for <CLIENT_IP> at 2016-06-17 16:09:20 +0200 2016-06-17 16:09:20 [app] [I] Processing by Containers::StepsController#update as HTML 2016-06-17 16:09:20 [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"TUbrIMms+pV+5xmXe4LzmWqGrkT295aq4BOETqbaX0U=", "docker_container_wizard_states_environment"=>{"tty"=>"1", "attach_stdin"=>"1", "attach_stdout"=>"1", "attach_stderr"=>"1"}, "button"=>"", "wizard_state_id"=>"14", "id"=>"environment"} 2016-06-17 16:09:26 [app] [W] Action failed | NoMethodError: undefined method `full_messages' for #<Array:0x0000000a9ec8c0> | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.10/app/controllers/containers/steps_controller.rb:61:in `create_container' | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.10/app/controllers/containers/steps_controller.rb:22:in `update' Though this error a container is created (as show both UI and docker ps -a) While containers with names that are used for the 1st time are created successfully.
VERIFIED. @satellite-6.2.0-19.1.el7sat.noarch tfm-rubygem-foreman_docker-2.0.1.11-1.el7sat.noarch used manual reproducer described in comment #0: ... 5. Create container named container1 once again Container was created successfully
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