Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1318549 - Validation error: Content type must be one of the following: docker, file, puppet, yum on creating ostree repo
Validation error: Content type must be one of the following: docker, file, pu...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Installer (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity high (vote)
: Beta
: Unused
Assigned To: Partha Aji
Sachin Ghai
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks: 1321771
  Show dependency treegraph
 
Reported: 2016-03-17 04:34 EDT by Sachin Ghai
Modified: 2018-08-31 11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 05:07:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Validation error: Content type must be one of the following: docker, file, puppet, yum on creating ostree repo (67.52 KB, image/png)
2016-03-17 04:34 EDT, Sachin Ghai
no flags Details
ostree repo created but webUI raises valdation error (57.14 KB, image/png)
2016-03-17 04:36 EDT, Sachin Ghai
no flags Details
ostree repo created successfully from webUI (47.86 KB, image/png)
2016-03-31 04:12 EDT, Sachin Ghai
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 14324 None None None 2016-04-22 12:43 EDT
Red Hat Product Errata RHBA-2016:1500 normal SHIPPED_LIVE Red Hat Satellite 6.2 Base Libraries 2016-07-27 08:24:38 EDT

  None (edit)
Description Sachin Ghai 2016-03-17 04:34:46 EDT
Created attachment 1137328 [details]
Validation error: Content type must be one of the following: docker, file, puppet, yum on creating ostree repo

Description of problem:
I was trying to create ostree type repo from webUI with sat6.2 snap4 and found below error:

ActiveRecord::RecordInvalid: Validation failed: Content type must be one of the following: docker, file, puppet, yum


2016-03-17 04:26:37 [app] [I] Started POST "/katello/api/v2/repositories?organization_id=1" for 10.65.193.200 at 2016-03-17 04:26:37 -0400
2016-03-17 04:26:37 [app] [I] Processing by Katello::Api::V2::RepositoriesController#create as JSON
2016-03-17 04:26:37 [app] [I]   Parameters: {"product_id"=>"7", "unprotected"=>true, "checksum_type"=>nil, "download_policy"=>nil, "mirror_on_sync"=>true, "name"=>"fedoratree22", "label"=>"fedoratree22", "content_type"=>"ostree", "url"=>"https://dl.fedoraproject.org/pub/fedora/linux/atomic/22/", "organization_id"=>"1", "api_version"=>"v2", "repository"=>{"name"=>"fedoratree22", "label"=>"fedoratree22", "url"=>"https://dl.fedoraproject.org/pub/fedora/linux/atomic/22/", "unprotected"=>true, "content_type"=>"ostree", "product_id"=>"7", "checksum_type"=>nil, "mirror_on_sync"=>true, "download_policy"=>nil}}
2016-03-17 04:26:38 [foreman-tasks/action] [E] Validation failed: Content type must be one of the following: docker, file, puppet, yum (ActiveRecord::RecordInvalid)
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `block in save!'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'

Please note that I've seelcted ostree type and even on submit the add_repo form, UI raises error. but repo created successfully.

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

How reproducible:
always

Steps to Reproduce:
1. create a ostree type repo
2.
3.

Actual results:
ActiveRecord::RecordInvalid: Validation failed: Content type must be one of the following: docker, file, puppet, yum

Expected results:
there shoudn't be any error on creating ostree repository

Additional info:
Comment 1 Sachin Ghai 2016-03-17 04:36 EDT
Created attachment 1137329 [details]
ostree repo created but webUI raises valdation error
Comment 3 Sachin Ghai 2016-03-17 05:00:11 EDT
Raising blocker? flag as it leave the setup in a state where repository::create foreman_tasks remains in pending state and if user tries to perform any other operation gets:

[foreman-tasks/action] [E] Required lock is already taken by other running tasks.
 | Please inspect their state, fix their errors and resume them.
Comment 4 Partha Aji 2016-03-17 22:48:44 EDT
So I reproduced this issue once after installing satellite 6.2 snap 4, then running foreman-installer --katello-enable-ostree=true, and directly logging into sat creating an ostree repo via the UI.  
But did the following to fix this. 

1) "katello-service restart"
2) Monitor -> Tasks -> Select the Paused-> error task and resume.

I am going to figure out why the first time the classes were not fully loaded. My guess is foreman-tasks did not get fully restarted the first time and katello-service restart cleanly restarted foreman-tasks.

These steps should at least get you off blocker.
Comment 5 Sachin Ghai 2016-03-18 01:04:34 EDT
Yes.. That's how I fix my setup too. I skipped the paused task and later resume it to fix that. Thanks for the update.
Comment 6 Partha Aji 2016-03-22 18:39:14 EDT
Created redmine issue http://projects.theforeman.org/issues/14324 from this bug
Comment 7 Partha Aji 2016-03-22 18:46:41 EDT
Being tracked by https://github.com/Katello/puppet-katello/pull/11
Comment 8 Partha Aji 2016-03-22 18:47:37 EDT
Basic fix here is that doing a "foreman-installer  --katello-enable-ostree" should restart foreman-tasks and httpd.
Comment 9 Adam Ruzicka 2016-03-23 06:31:12 EDT
Upstream bug component is Installer
Comment 10 Bryan Kearney 2016-03-23 12:02:34 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/14324 has been closed
Comment 11 Partha Aji 2016-03-23 12:30:57 EDT
Correction:

Being tracked by https://github.com/Katello/puppet-katello/pull/118 not 11
Comment 15 Sachin Ghai 2016-03-31 04:12:09 EDT
Verified with sa6.2 beta snap6.

I don't see the reported issue on creating ostree repo.

2016-03-31 04:06:01 [app] [I] Started POST "/katello/api/v2/repositories?organization_id=1" for 10.65.193.200 at 2016-03-31 04:06:01 -0400
2016-03-31 04:06:01 [app] [I] Processing by Katello::Api::V2::RepositoriesController#create as JSON
2016-03-31 04:06:01 [app] [I]   Parameters: {"product_id"=>"7", "unprotected"=>false, "checksum_type"=>nil, "download_policy"=>nil, "mirror_on_sync"=>true, "name"=>"rhel7_ostree", "label"=>"rhel7_ostree", "content_type"=>"ostree", "url"=>"http://download.eng.bos.redhat.com/rel-eng/Atomic-7.2-tree-20160324.1/ostree/repo/", "organization_id"=>"1", "api_version"=>"v2", "repository"=>{"name"=>"rhel7_ostree", "label"=>"rhel7_ostree", "url"=>"http://download.eng.bos.redhat.com/rel-eng/Atomic-7.2-tree-20160324.1/ostree/repo/", "unprotected"=>false, "content_type"=>"ostree", "product_id"=>"7", "checksum_type"=>nil, "mirror_on_sync"=>true, "download_policy"=>nil}}
2016-03-31 04:06:03 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.12/app/views/katello/api/v2/repositories/show.json.rabl within katello/api/v2/layouts/resource (66.5ms)
2016-03-31 04:06:03 [app] [I] Completed 200 OK in 1724ms (Views: 52.4ms | ActiveRecord: 69.9ms)
20
Comment 16 Sachin Ghai 2016-03-31 04:12 EDT
Created attachment 1142094 [details]
ostree repo created successfully from webUI
Comment 17 Sachin Ghai 2016-03-31 04:14:14 EDT
]# hammer -u admin -p changeme repository create --name f23_ostree --organization-id 1 --product ostree --url https://dl.fedoraproject.org/pub/fedora/linux/atomic/23/ --publish-via-http no --content-type ostree
Repository created
Comment 19 errata-xmlrpc 2016-07-27 05:07:15 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1500

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