Project

General

Profile

Actions

Bug #14570

closed

after container deletion the container name cannot be reused

Added by Daniel Lobato Garcia almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1323235
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:

Actions #1

Updated by The Foreman Bot almost 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-docker/pull/158 added
Actions #2

Updated by Daniel Lobato Garcia almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #3

Updated by Daniel Lobato Garcia almost 8 years ago

  • Bugzilla link changed from 1323235 to 1288048
Actions #4

Updated by The Foreman Bot almost 8 years ago

  • Pull request https://github.com/theforeman/foreman-docker/pull/166 added
Actions #5

Updated by Shlomi Zadok almost 8 years ago

  • Status changed from Closed to Assigned
  • Assignee changed from Daniel Lobato Garcia to Shlomi Zadok

Provided solutions (PRs) do not completely solve the issue.
please check with Rails console, deleted Container (the model itself) is not getting deleted:

irb(main):010:0> Container.pluck(:name)
2016-06-21T14:18:29 [sql] [D] (0.4ms) SELECT "containers"."name" FROM "containers"
=> ["Fedora", "mongo"]

-- The associated VM (with container.uuid) does get deleted

Seems that destroy method, deletes the container, does not delete the db model

Actions #6

Updated by The Foreman Bot almost 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-docker/pull/169 added
Actions #7

Updated by Shlomi Zadok over 7 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF