Bug 750134

Summary: Error when pushing Content Spec if Skynet Datasource is read-only
Product: [Community] PressGang CCMS Reporter: Joshua Wulf <jwulf>
Component: CSProcessorAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.xCC: jwulf, lcarlon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 0.14.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-07 23:22:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 751250    

Description Joshua Wulf 2011-10-31 06:22:11 UTC
Tested with versions: Webservice 11, Client 10

Use case:

Read-only access to the topics is granted so that users can remix existing topics, but cannot update them.

Scenario: CSProcessor datasource is read/write; Skynet datasource is read-only.

When pushing a content spec in this scenario, the push fails.


Client output:
[jwulf@gaura Content Specs]$ skynet push -cn Management\ API\ Guide
Skynet client version: 10.0
Loading configuration from /home/jwulf/.config/skynet.ini
Web Service at http://localhost:8080/ version: 11.0

INFO:  The Content Specification is valid.
WARN:  Note: All descriptions, tags, source urls and writers will be ignored for existing Topics.
ERROR: Hibernate Transaction rollback.
ERROR: An error occurred when inserting into the database please try again.

Server output:
16:09:24,295 INFO  [com.redhat.contentspec.processor.ContentSpecProcessor] (http--0.0.0.0-8080-1) The Content Specification is valid.
16:09:24,295 WARN  [com.redhat.contentspec.processor.ContentSpecProcessor] (http--0.0.0.0-8080-1) Note: All descriptions, tags, source urls and writers will be ignored for existing Topics.
16:09:24,736 WARN  [org.hibernate.util.JDBCExceptionReporter] (http--0.0.0.0-8080-1) SQL Error: 1142, SQLState: 42000
16:09:24,736 ERROR [org.hibernate.util.JDBCExceptionReporter] (http--0.0.0.0-8080-1) INSERT command denied to user 'readonly'@'vpn1-51-93.bne.redhat.com' for table 'REVINFO'

Comment 1 Lee Newson 2011-11-04 03:21:34 UTC
At the moment, a snapshot of the topics is created when a build is performed. A side-effect of reading the Revision level of the topics is an update to the Rev History table in the topic database.

We can turn off the snapshot on build, and move this functionality to the snapshot command. With that one we'll make snapshot only work with a descriptive, post-processed Content Spec (existing topics only). 

Snapshot functionality shouldn't require write access, so we'll deal with the Rev History side effect there.

Comment 2 Lee Newson 2011-11-04 06:27:12 UTC
Completed. At this stage you can still specify a revision when building, however it will pull topics from the latest revision and not a snapshot. Snapshots still have to be implemented (See bug #750976).

Comment 3 Joshua Wulf 2011-11-07 23:22:50 UTC
Verified with build 14. Pushing a new content spec that is pure reuse when the skynet datasource is read-only, works.