Red Hat Bugzilla – Bug 1257075
Not possible to add sub step of step via REST
Last modified: 2016-04-19 21:36:31 EDT
Created attachment 1067192 [details]
Description of problem:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1) Create job.
2) Create step under the new job.
3) Create sub step of step cretead in 2).
Reason: Not Found
Detail: Entity not found: 26152fe3-9c56-4e38-811c-73306a3420fe
sub step created successfully
The whole process with debug info is in attachment.
I believe this is another manifestation of the transaction management issues that we have with jobs. When a step is created from the RESTAPI it is first created using the AddExternalStep command, which should return the identifier of the created step, in this case 26152fe3-9c56-4e38-811c-73306a3420fe. Then the RESTAPI retrieves the details of the step, using the GetStepByStepId query. Is this query that is failing, probably because the insert was done in a different transaction, ans wasn't committed.
I used the following script to reproduce:
from ovirtsdk.api import API
from ovirtsdk.xml import params
# Connect to the server:
api = API(
# Create a job:
job = api.jobs.add(
# Create the first step:
first_step = job.steps.add(
# Create the second step:
second_step = job.steps.add(
# Close the connection:
Note that this is probably a duplicate of bug 1253338 or bug 1254230.
After applying the following two patches (the proposed solution for of bug 1253338 and bug 1254230) adding the sub step works correctly:
core: Make JobRepository a @Singleton
core: Index entity managers by transaction
So most probably this is a duplicate. However I'd leave it open so that this specific scenario can be verified by QE.