Bug 623704 - Needs error handling for duplicate packagegroup names
Needs error handling for duplicate packagegroup names
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: John Matthews
Preethi Thomas
: Triaged
Depends On:
Blocks: pulp-verified
  Show dependency treegraph
 
Reported: 2010-08-12 10:57 EDT by Preethi Thomas
Modified: 2011-08-16 09:59 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-08-16 09:59:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Preethi Thomas 2010-08-12 10:57:18 EDT
Description of problem:

[root@preethi pulp]# pulp -u admin -p admin packagegroup list --repoid=f13-1+-------------------------------------------+
Repository: f13-1
Package Group Information 
+-------------------------------------------+
	 pthomas
[root@preethi pulp]# pulp -u admin -p admin packagegroup create  --repoid=f13-1 --id=pthomas --name=pthomas
"Traceback (most recent call last):\n  File \"/usr/lib/python2.6/site-packages/pulp/webservices/controllers/base.py\", line 50, in report_error\n    return method(self, *args, **kwargs)\n  File \"/usr/lib/python2.6/site-packages/pulp/webservices/role_check.py\", line 102, in check_roles\n    ret=f(instance, *fargs, **kw)\n  File \"/usr/lib/python2.6/site-packages/pulp/webservices/controllers/repositories.py\", line 343, in create_packagegroup\n    descrp))\n  File \"/usr/lib/python2.6/site-packages/pulp/auditing.py\", line 186, in _audit\n    result = method(*args, **kwargs)\n  File \"/usr/lib/python2.6/site-packages/pulp/api/repo.py\", line 313, in create_packagegroup\n    (group_id, repoid))\nPulpException: u'Package group pthomas already exists in repo f13-1'\n"
[root@preethi pulp]# 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 John Matthews 2010-10-15 15:49:03 EDT
Will be in pulp testing build 0.75

Git Commit:

http://git.fedorahosted.org/git/?p=pulp.git;a=commit;h=4c863ff66fc9bbed5a4c3522bac7a7fca9caf585


On packagegroup create we now catch the exception and display a generic "Failed" message.  The exception is logged in pulp/client.log


$ sudo pulp-admin -u admin -p admin packagegroup list --repoid vt
+------------------------------------------+
               Repository: vt
          Package Group Information
+------------------------------------------+
	 assamese-support
	 bengali-support
	 brazilian-support
	 chinese-support
	 french-support
	 german-support
	 gujarati-support
	 hindi-support
	 italian-support
	 japanese-support
	 jwm
	 kannada-support
	 korean-support
	 malayalam-support
	 marathi-support
	 oriya-support
	 punjabi-support
	 russian-support
	 sinhala-support
	 spanish-support
	 tamil-support
	 telugu-support
	 xen

Verified package group "jwm" already exists.
Attempt to create a new group of same name (except exception is to be thrown and operation fails).

$ sudo pulp-admin -u admin -p admin packagegroup create --repoid vt --id jwm -n jwm
Unable to create package group [jwm] in repository [vt]


tail /var/log/pulp/client.log
2010-10-15 15:39:44,711 [ERROR][MainThread] run() @ packagegroup.py:113 - Failed on group [jwm] create:
500: "Traceback (most recent call last):\n  File \"/shared/repo/pulp/src/pulp/server/webservices/controllers/base.py\", line 51, in report_error\n    return method(self, *args, **kwargs)\n  File \"/shared/repo/pulp/src/pulp/server/webservices/role_check.py\", line 102, in check_roles\n    result = f(instance, *fargs, **kw)\n  File \"/shared/repo/pulp/src/pulp/server/webservices/controllers/repositories.py\", line 376, in create_packagegroup\n    descrp))\n  File \"/shared/repo/pulp/src/pulp/server/auditing.py\", line 193, in _audit\n    result = method(*args, **kwargs)\n  File \"/shared/repo/pulp/src/pulp/server/api/repo.py\", line 529, in create_packagegroup\n    (group_id, repoid))\nPulpException: u'Package group jwm already exists in repo vt'\n"
Comment 2 Jay Dobies 2010-10-20 12:57:04 EDT
Fixed in 0.75.
Comment 3 Preethi Thomas 2010-10-26 10:57:41 EDT
verified


[root@preethi ~]# pulp-admin packagegroup info --repoid=f13  --id=testing +------------------------------------------+
          Package Group Information
+------------------------------------------+

Name                	testing                  
Id                  	testing                  
Mandatory packages  	[]                       
Default packages    	[]                       
Optional packages   	[]                       
Conditional packages	{}                       


[root@preethi ~]# pulp-admin packagegroup list --repoid=f13 +------------------------------------------+
               Repository: f13
          Package Group Information
+------------------------------------------+
	 admin-tools
	 afrikaans-support
	 albanian-support
	 amazigh-support
	 arabic-support
	 armenian-support
	 assamese-support
	 authoring-and-publishing
	 azerbaijani-support
	 base
	 base-x
	 basque-support
	 belarusian-support
	 bengali-support
	 bhutanese-support
	 books
	 bosnian-support
	 brazilian-support
	 breton-support
	 british-support
	 buildsys-build
	 bulgarian-support
	 burmese-support
	 catalan-support
	 chichewa-support
	 chinese-support
	 clustering
	 coptic-support
	 core
	 critical-path-base
	 critical-path-gnome
	 croatian-support
	 czech-support
	 danish-support
	 development-libs
	 development-tools
	 dial-up
	 directory-server
	 dns-server
	 dogtag
	 dutch-support
	 eclipse
	 editors
	 education
	 electronic-lab
	 engineering-and-scientific
	 esperanto-support
	 estonian-support
	 ethiopic-support
	 faeroese-support
	 fedora-packager
	 fijian-support
	 filesystems
	 filipino-support
	 finnish-support
	 font-design
	 fonts
	 french-support
	 frisian-support
	 friulian-support
	 ftp-server
	 gaelic-support
	 galician-support
	 games
	 georgian-support
	 german-support
	 gnome-desktop
	 gnome-software-development
	 graphical-internet
	 graphics
	 greek-support
	 gujarati-support
	 hardware-support
	 haskell
	 hebrew-support
	 hiligaynon-support
	 hindi-support
	 hungarian-support
	 icelandic-support
	 indonesian-support
	 input-methods
	 interlingua-support
	 inuktitut-support
	 irish-support
	 italian-support
	 japanese-support
	 java
	 java-development
	 kannada-support
	 kashmiri-support
	 kashubian-support
	 kazakh-support
	 kde-desktop
	 kde-software-development
	 khmer-support
	 kinyarwanda-support
	 konkani-support
	 korean-support
	 kurdish-support
	 lao-support
	 latin-support
	 latvian-support
	 legacy-fonts
	 legacy-network-server
	 legacy-software-development
	 legacy-software-support
	 lithuanian-support
	 low-saxon-support
	 luxembourgish-support
	 lxde-desktop
	 macedonian-support
	 mail-server
	 maithili-support
	 malagasy-support
	 malay-support
	 malayalam-support
	 maltese-support
	 manx-support
	 maori-support
	 marathi-support
	 mingw32
	 moblin-desktop
	 mongolian-support
	 mysql
	 nepali-support
	 network-server
	 news-server
	 northern-sotho-support
	 norwegian-support
	 ocaml
	 occitan-support
	 office
	 online-docs
	 openoffice.org-development
	 oriya-support
	 perl
	 persian-support
	 polish-support
	 portuguese-support
	 printing
	 punjabi-support
	 romanian-support
	 ruby
	 russian-support
	 samoan-support
	 sanskrit-support
	 sardinian-support
	 serbian-support
	 server-cfg
	 sindhi-support
	 sinhala-support
	 slovak-support
	 slovenian-support
	 smb-server
	 somali-support
	 sound-and-video
	 southern-ndebele-support
	 southern-sotho-support
	 spanish-support
	 sql-server
	 sugar-desktop
	 swahili-support
	 swati-support
	 swedish-support
	 system-tools
	 tagalog-support
	 tajik-support
	 tamil-support
	 telugu-support
	 testing
	 tetum-support
	 text-internet
	 thai-support
	 tibetan-support
	 tonga-support
	 tsonga-support
	 tswana-support
	 turkish-support
	 turkmen-support
	 ukrainian-support
	 upper-sorbian-support
	 urdu-support
	 uzbek-support
	 venda-support
	 vietnamese-support
	 virtualization
	 walloon-support
	 web-development
	 web-server
	 welsh-support
	 window-managers
	 x-software-development
	 xfce-desktop
	 xfce-software-development
	 xhosa-support
	 z-testing
	 zulu-support

You have new mail in /var/spool/mail/root
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin packagegroup create --repoid=f13 --id=z-testing --name=ztesting
Unable to create package group [z-testing] in repository [f13]

[root@preethi ~]# 

from client.log

010-10-26 11:05:45,350 [ERROR][MainThread] run() @ packagegroup.py:113 - Failed on group [z-testing] create:
500: "Traceback (most recent call last):\n  File \"/usr/lib/python2.6/site-packages/pulp/server/webservices/controllers/base.py\", line 51, in report_error\n    return method(self, *args, **kwargs)\n  File \"/usr/lib/python2.6/site-packages/pulp/server/webservices/role_check.py\", line 102, in check_roles\n    result = f(instance, *fargs, **kw)\n  File \"/usr/lib/python2.6/site-packages/pulp/server/webservices/controllers/repositories.py\", line 406, in create_packagegroup\n    descrp))\n  File \"/usr/lib/python2.6/site-packages/pulp/server/auditing.py\", line 193, in _audit\n    result = method(*args, **kwargs)\n  File \"/usr/lib/python2.6/site-packages/pulp/server/api/repo.py\", line 561, in create_packagegroup\n    (group_id, repoid))\nPulpException: u'Package group z-testing already exists in repo f13'\n"
Comment 4 Preethi Thomas 2011-08-16 09:59:57 EDT
Closing with Community Release 15

pulp-0.0.223-4.

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