Project

General

Profile

Actions

Bug #25310

open

Unable to version content view: Validation failed: Name has already been taken

Added by Daniel Kimsey about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Category:
Content Views
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

In Katello 3.8 I am unable to create new versions of my content view. I do not know if this extends to other content views.

This content view is published in almost all of our Lifecycles as v150.0. I was attempting to publish a new version to include a recently update Puppet module. The puppet modules are a collection of "latest" and version pinned modules.

From the content view page, I selected the publish new version button and hit submit.

2018-10-25T11:45:34 [I|app|6ac7d] Processing by Katello::Api::V2::ContentViewsController#publish as JSON
2018-10-25T11:45:34 [I|app|6ac7d]   Parameters: {"id"=>"13", "description"=>"Update admins-1.2.0", "organization_id"=>"1", "api_version"=>"v2", "content_view"=>{"id"=>"13", "description"=>"Update admins-1.2.0"}}
2018-10-25T11:45:34 [I|app|6ac7d] Current user set to dkimsey (admin)
2018-10-25T11:45:34 [I|aud|6ac7d] create event for Katello::ContentViewVersion with id 501
2018-10-25T11:45:35 [I|aud|6ac7d] update event for Katello::ContentViewEnvironment with id 57
2018-10-25T11:45:35 [I|app|6ac7d] Current user set to dkimsey (admin)
2018-10-25T11:45:35 [I|kat|6ac7d] GET: https://katello.trustwave.com/pulp/api/v2/users/: {"content_type"=>"application/json", "accept"=>"application/json"}
2018-10-25T11:45:35 [I|app|6ac7d] Current user set to dkimsey (admin)
2018-10-25T11:45:35 [E|bac|6ac7d] Validation failed: Name has already been taken (ActiveRecord::RecordInvalid)
<stacktrace>
2018-10-25T11:45:35 [E|bac|6ac7d] Validation failed: Name has already been taken (ActiveRecord::RecordInvalid)
2018-10-25T11:45:35 [E|app|6ac7d] <Class> ActiveRecord::RecordInvalid
2018-10-25T11:45:35 [E|app|6ac7d] name: ["has already been taken"]
2018-10-25T11:45:35 [I|app|6ac7d] Completed 422 Unprocessable Entity in 866ms (Views: 0.3ms | ActiveRecord: 192.7ms)

Files

stacktrace.txt stacktrace.txt 45.7 KB stacktrace from logs Daniel Kimsey, 10/25/2018 04:56 PM
Screen Shot 2018-10-25 at 11.56.31.png View Screen Shot 2018-10-25 at 11.56.31.png 77.1 KB error screen on ui Daniel Kimsey, 10/25/2018 04:56 PM
Actions #1

Updated by Daniel Kimsey about 6 years ago

With @jsherril's help, I was able to determine that my current Organization lost it's association to the Lifecycle/Puppet Environment.

Fix:
1. Switch to Any Organization.
2. Go to Puppet Environments.
3. Edit the corresponding puppet environment, `name ~ cv_operations and name ~ Library`
4. Add my organization.
5. Save
6. Publish new CV version.

Actions #2

Updated by Jonathon Turel about 6 years ago

  • Assignee deleted (Justin Sherrill)
  • Target version set to Katello 3.11.0
  • Triaged changed from No to Yes
Actions #3

Updated by Justin Sherrill about 6 years ago

  • Assignee set to Justin Sherrill
  • Target version deleted (Katello 3.11.0)

The fix i would recommend:

Whenever we do a publish or promote, we first do something like this:

1. does the puppet environment exist?
2. if not create it

step 1. is not finding it because of default scoping based on the current org, and the fact that the puppet env is not in the org. We should do an unscoped query and assign the env to the org if its not already

Actions #4

Updated by Daniel Kimsey about 6 years ago

So just an update on this issue. Whatever happened, it went nuts.

No puppet classes were listed in the Puppet Environments for the last few days after these promotions were done. I ended up re-importing from the Smart Proxies which generated new puppetclass IDs and wiped out every single smart class parameter we had set. I'm in the process of digging through the Postgres database from the pre-3.4 upgrade to try to resurrect what I can.

I don't know if its related to whatever happened here, but the audit log only shows my "fix" and the promotion that day. After the new CV hit each lifecycle, hosts lost their modules.

Actions

Also available in: Atom PDF