Bug 1323235 - after container deletion the container name cannot be reused
Summary: after container deletion the container name cannot be reused
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Container Management
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Shlomi Zadok
QA Contact: Lukas Pramuk
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-01 15:33 UTC by Lukas Pramuk
Modified: 2019-09-26 14:47 UTC (History)
5 users (show)

Fixed In Version: rubygem-foreman_docker-2.0.1.11-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:27:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14570 0 None None None 2016-04-22 16:55:23 UTC

Description Lukas Pramuk 2016-04-01 15:33:08 UTC
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:

Comment 1 Lukas Pramuk 2016-04-01 15:33:44 UTC
Version-Release number of selected component (if applicable):
@Sat6.2.0-Beta-Snap6

Comment 3 Daniel Lobato Garcia 2016-04-11 08:30:37 UTC
Created redmine issue http://projects.theforeman.org/issues/14570 from this bug

Comment 4 Bryan Kearney 2016-04-15 12:09:02 UTC
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.

Comment 5 Lukas Pramuk 2016-05-26 11:37:21 UTC
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)

Comment 6 Lukas Pramuk 2016-05-26 11:56:20 UTC
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:

Comment 7 Ohad Levy 2016-06-16 07:41:29 UTC
Lukas, do you happen to have a machine where this is reproducible? Daniel mentioned he is unable to reproduce locally.

Comment 8 Lukas Pramuk 2016-06-17 14:17:35 UTC
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.

Comment 16 Lukas Pramuk 2016-07-09 09:45:37 UTC
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

Comment 17 Bryan Kearney 2016-07-27 11:27:27 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


Note You need to log in before you can comment on or make changes to this bug.