[katello] RuntimeError: Duplicate resource

Hi,

Got something weird again, during the repo sync the filesystem filled up.

I then had some errors with locking. I resumed the locked Centos6 sync
but removed the Centos7 product as it had no repositories listed.

When I now create a new Centos7 product with repo discovery, it gets
created but again without any repositories. Adding them manually with
the same name fails also.

The error I get is:

Action:

Actions::Pulp::Repository::CreateInPlan

Input:

{"content_type"=>"yum",
  "pulp_id"=>"Netbulae-Centos7-os_x86_64",
  "name"=>"os x86_64",
  "feed"=>"http://mirror.centos.org/centos/7/os/x86_64/",
  "ssl_ca_cert"=>nil,
  "ssl_client_cert"=>nil,
  "ssl_client_key"=>nil,
  "unprotected"=>true,
  "checksum_type"=>nil,
  "path"=>"Netbulae/Library/custom/Centos7/os_x86_64",
  "with_importer"=>true}

Output:

{}

Exception:

RuntimeError: Duplicate resource: Netbulae-Centos7-os_x86_64

How do I remove the duplicate? And why didn't it get removed when I
deleted the product?

Met vriendelijke groet, With kind regards,

Jorick Astrego

Netbulae Virtualization Experts

··· ----------------
Tel: 053 20 30 270 	info@netbulae.eu 	Staalsteden 4-3A 	KvK 08198180
Fax: 053 20 30 271 	www.netbulae.eu 	7547 TA Enschede 	BTW NL821234584B01

Hi,
this is definitely strange behavior, could you please provide us
screenshots of Dynflow console showing the task which removed the Centos7
product so we can investigate what went wrong?

··· --- Adam Ruzicka aruzicka@redhat.com

On Monday 03 of November 2014 15:03:46 Jorick Astrego wrote:

Hi,

Got something weird again, during the repo sync the filesystem filled
up.

I then had some errors with locking. I resumed the locked Centos6 sync
but removed the Centos7 product as it had no repositories listed.

When I now create a new Centos7 product with repo discovery, it gets
created but again without any repositories. Adding them manually with
the same name fails also.

The error I get is:

Action:

Actions::Pulp::Repository::CreateInPlan

Input:

{"content_type"=>"yum",
  "pulp_id"=>"Netbulae-Centos7-os_x86_64",
  "name"=>"os x86_64",
  "feed"=>"http://mirror.centos.org/centos/7/os/x86_64/",
  "ssl_ca_cert"=>nil,
  "ssl_client_cert"=>nil,
  "ssl_client_key"=>nil,
  "unprotected"=>true,
  "checksum_type"=>nil,
  "path"=>"Netbulae/Library/custom/Centos7/os_x86_64",
  "with_importer"=>true}

Output:

{}

Exception:

RuntimeError: Duplicate resource: Netbulae-Centos7-os_x86_64

How do I remove the duplicate? And why didn’t it get removed when I
deleted the product?

Met vriendelijke groet, With kind regards,

Jorick Astrego

Netbulae Virtualization Experts


Tel: 053 20 30 270 info@netbulae.eu Staalsteden 4-3A KvK
08198180
Fax: 053 20 30 271 www.netbulae.eu 7547 TA Enschede BTW
NL821234584B01


Here you go, somethings got messed up. The first create is still pending
(the filesystem filled up) and the delete is stopped on an error.

So the system doesn't know what to do anymore. I've noticed the remove
product button doesn't return any messages when error's occur (I see
them in the logs and tasks), but it does remove the product from the view.

I think there should be some error reporting when remove product fails
and the product should only be removed from the view when delete is
successful

Id: bd248e94-fc61-475a-86f7-05987df5caf0
Label: Actions::Katello::Repository::Create
Name: Create
Owner: deployadm
Started at: 2014-10-23 09:57:45 UTC
Ended at:
State: stopped
Result: pending
Params: repository 'os x86_64'; product 'Centos7'; organization 'Netbulae'

Id: 69b5c5dc-a137-4b05-9251-ae124e0b9680
Label: Actions::Katello::Product::Destroy
Name: Delete Product
Owner: cheech
Started at: 2014-11-03 10:55:01 UTC
Ended at: 2014-11-03 10:55:01 UTC
State: stopped
Result: error
Params: product 'Centos7'; organization 'Netbulae'

Action:

Actions::Katello::Product::Destroy

Input:

{"product"=>
{"id"=>2, "name"=>"Centos7", "label"=>"Centos7", "cp_id"=>"1414058263277"},
"provider"=>{"id"=>1, "name"=>"Anonymous"},
"organization"=>{"id"=>1, "name"=>"Netbulae", "label"=>"Netbulae"}}

Exception:

ActiveRecord::DeleteRestrictionError: Cannot delete record because of dependent repositories

I also checked the DB, some duplicates exist it appears, is the name not
supposed to be unique?

candlepin=# select * from cp_product;
id | created | updated |
multiplier | name

··· On 11/04/2014 09:39 AM, Adam Ruzicka wrote: > Hi, > this is definitely strange behavior, could you please provide us > screenshots of Dynflow console showing the task which removed the Centos7 > product so we can investigate what went wrong? > > --- > Adam Ruzicka > aruzicka@redhat.com ---------------+----------------------------+----------------------------+------------+--------- 1414058167257 | 2014-10-23 11:56:07.26+02 | 2014-10-23 11:56:07.26+02 | 1 | Centos6 1414058263277 | 2014-10-23 11:57:43.277+02 | 2014-10-23 11:57:43.277+02 | 1 | Centos7 1415022033266 | 2014-11-03 14:40:33.266+01 | 2014-11-03 14:40:33.266+01 | 1 | Centos7

candlepin=# select * from cp_content;
id | created | updated

      contenturl           | gpgurl |              

label | metadataexpire | name | relea
sever | requiredtags | type | vendor | arches
---------------±---------------------------±---------------------------±-------------------------------±-------±--------------------------------±---------------±---------------±-----
------±-------------±-----±-------±-------
1414058170548 | 2014-10-23 11:56:10.548+02 | 2014-10-23
11:56:10.548+02 | /custom/Centos6/SCL_x86_64 | |
Netbulae_Centos6_SCL_x86_64 | | SCL x86_64 |
> > yum | Custom |
1414058174171 | 2014-10-23 11:56:14.171+02 | 2014-10-23
11:56:14.171+02 | /custom/Centos6/os_x86_64 | |
Netbulae_Centos6_os_x86_64 | | os x86_64 |
> > yum | Custom |
1414058177444 | 2014-10-23 11:56:17.444+02 | 2014-10-23
11:56:17.444+02 | /custom/Centos6/updates_x86_64 | |
Netbulae_Centos6_updates_x86_64 | | updates x86_64 |
> > yum | Custom |
1414058265693 | 2014-10-23 11:57:45.693+02 | 2014-10-23
11:57:45.693+02 | /custom/Centos7/os_x86_64 | |
Netbulae_Centos7_os_x86_64 | | os x86_64 |
> > yum | Custom |
(4 rows)

To fix it, I removed the last created Centos7 product and unlocked the
task and cleaned up the database.

Now it works again.

On Monday 03 of November 2014 15:03:46 Jorick Astrego wrote:

Hi,

Got something weird again, during the repo sync the filesystem filled
up.

I then had some errors with locking. I resumed the locked Centos6 sync
but removed the Centos7 product as it had no repositories listed.

When I now create a new Centos7 product with repo discovery, it gets
created but again without any repositories. Adding them manually with
the same name fails also.

The error I get is:

 Action:

 Actions::Pulp::Repository::CreateInPlan

 Input:

 {"content_type"=>"yum",
   "pulp_id"=>"Netbulae-Centos7-os_x86_64",
   "name"=>"os x86_64",
   "feed"=>"http://mirror.centos.org/centos/7/os/x86_64/",
   "ssl_ca_cert"=>nil,
   "ssl_client_cert"=>nil,
   "ssl_client_key"=>nil,
   "unprotected"=>true,
   "checksum_type"=>nil,
   "path"=>"Netbulae/Library/custom/Centos7/os_x86_64",
   "with_importer"=>true}

 Output:

 {}

 Exception:

 RuntimeError: Duplicate resource: Netbulae-Centos7-os_x86_64

How do I remove the duplicate? And why didn’t it get removed when I
deleted the product?

Met vriendelijke groet, With kind regards,

Jorick Astrego

Netbulae Virtualization Experts


Tel: 053 20 30 270 info@netbulae.eu Staalsteden 4-3A KvK
08198180
Fax: 053 20 30 271 www.netbulae.eu 7547 TA Enschede BTW
NL821234584B01


Met vriendelijke groet, With kind regards,

Jorick Astrego

Netbulae Virtualization Experts


Tel: 053 20 30 270 	info@netbulae.eu 	Staalsteden 4-3A 	KvK 08198180
Fax: 053 20 30 271 	www.netbulae.eu 	7547 TA Enschede 	BTW NL821234584B01