Project

General

Profile

Bug #14570

after container deletion the container name cannot be reused

Added by Daniel Lobato Garcia about 6 years ago. Updated almost 6 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:

Associated revisions

Revision 2fbd23c3 (diff)
Added by Daniel Lobato Garcia about 6 years ago

Fixes #14570 - Set docker-api to 1.18 to avoid image parsing errors

Parsing of some images, as well as the warning
'circular argument reference - connection' show up because of an
outdated version of docker-api.

Revision 2fbd23c3 (diff)
Added by Daniel Lobato Garcia about 6 years ago

Fixes #14570 - Set docker-api to 1.18 to avoid image parsing errors

Parsing of some images, as well as the warning
'circular argument reference - connection' show up because of an
outdated version of docker-api.

Revision 26c5ba32 (diff)
Added by Daniel Lobato Garcia about 6 years ago

Refs #14570 - Fetch tags from local images properly

We were calling local_images and passing an ID as filter. However,
that didn't work. Instead we can fetch the image just by calling
image(image_id) and that should retrieve the image object so we can call
.info , etc.. on it.

Revision 26c5ba32 (diff)
Added by Daniel Lobato Garcia about 6 years ago

Refs #14570 - Fetch tags from local images properly

We were calling local_images and passing an ID as filter. However,
that didn't work. Instead we can fetch the image just by calling
image(image_id) and that should retrieve the image object so we can call
.info , etc.. on it.

Revision b2f2c848 (diff)
Added by Shlomi Zadok about 6 years ago

Refs #14570 - Destroy Container db object
When deleting with container uuid params, the container object should be destroyed as well

Revision b2f2c848 (diff)
Added by Shlomi Zadok about 6 years ago

Refs #14570 - Destroy Container db object
When deleting with container uuid params, the container object should be destroyed as well

History

#1 Updated by The Foreman Bot about 6 years ago

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

#2 Updated by Daniel Lobato Garcia about 6 years ago

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

#3 Updated by Daniel Lobato Garcia about 6 years ago

  • Bugzilla link changed from 1323235 to 1288048

#4 Updated by The Foreman Bot about 6 years ago

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

#5 Updated by Shlomi Zadok about 6 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

#6 Updated by The Foreman Bot about 6 years ago

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

#7 Updated by Shlomi Zadok almost 6 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF