Bug 1118172 - Unexpected warning appears when delete invalid container
Summary: Unexpected warning appears when delete invalid container
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-10 06:43 UTC by Wenjing Zheng
Modified: 2015-05-14 23:13 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-03 17:54:36 UTC


Attachments (Terms of Use)

Description Wenjing Zheng 2014-07-10 06:43:24 UTC
Description:
If delete a container just with name contains the first 4 letters(like rock here, sudo gear delete rock), the first contains which matches with the 4 letters in name will be deleted successfully, but unexpected warnings appears:delete_container: Unable to queue stop unit job: Unit ctr-rock.service not loaded. Deleted rock; 

But if delete with first 3 letters in name(sudo gear delete roc), it fails and valid warning returns like this:You must pass one or more valid service names: identifier must match \A[a-zA-Z0-9\_\-\.]{4,24}\z

Version-Release number of selected component (if applicable):
geard-0-0.13.git6850c8d
fedora20_x86_64

How reproducible:
always

steps to Reproduce:
1. Create a rockmongo.json file to deploy with below contents:
{
  "containers":[
    {
      "name":"rockmongo",
      "count":3,
      "image":"openshift/centos-rockmongo",
      "publicports":[
        {"internal":80, "external":0}
      ],
      "links":[
        {"to":"mongodb"}
      ]
    }
  ]
}
2. sudo gear deploy rockmongo.json
3. sudo gear list-units
ID          SERVER  ACTIVE  SUB     LOAD    TYPE
rockmongo-1         active  running loaded  
rockmongo-2         active  running loaded  
rockmongo-3         active  running loaded 
4. delete with the first 4 letters: rock
sudo gear delete rock
5. stop a container
sudo gear stop rockmongo-1
6. sudo gear delete rock
7. the first contianer begin with rock will be deleted:
sudo gear list-units
ID          SERVER  ACTIVE  SUB     LOAD    TYPE
rockmongo-2         active  running loaded  
rockmongo-3         active  running loaded 

Actual results:
In step 4, this warning appears, nothing is deleted:
delete_container: Unable to queue stop unit job: Unit ctr-rock.service not loaded.
Deleted rock
After step 6, rockmongo-1 is deleted and above warning appears too

Expected results:
1. It should warn like this when delete with first 3 letters:
[vagrant@localhost ~]$ sudo gear delete roc
You must pass one or more valid service names: identifier must match \A[a-zA-Z0-9\_\-\.]{4,24}\z
2. If we intend to delete all contians sharing some same beginning letters in name, we should use wildcards, for example "*".

Additional info:
1. If all rockmongo-* in list are stoped, the warning still appears and they will be all deleted.
2. If delete a non-exist container, the same warning appears and says it is deleted:
[vagrant@localhost ~]$ sudo gear delete 1234
delete_container: Unable to queue stop unit job: Unit ctr-1234.service not loaded.
Deleted 1234

Comment 1 Clayton Coleman 2014-07-10 14:28:29 UTC
What version of systemd do you have on your system?

Comment 2 Wenjing Zheng 2014-07-11 01:55:36 UTC
Below is the version of systemd when meet this issue:
[vagrant@localhost ~]$ rpm -qa systemd
systemd-208-17.fc20.x86_64

Comment 3 Michal Fojtik 2014-07-11 08:30:44 UTC
I don't like this error message:

"identifier must match \A[a-zA-Z0-9\_\-\.]{4,24}\z"

isn't there a better 'human-friendly' way? (identifier must be XYZ character longs and contain alpha letter and number and '-'....) ?


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