Closed dpancic closed 1 year ago
In GitLab by @stefanprobst on Apr 6, 2022, 16:32
one way to reproduce:
(1) create new draft item
curl "http://localhost:8080/api/datasets?draft=true" -X POST -H "content-type: application/json" -H "authorization: ${TOKEN}" -d '{"label":"l","description":"d","externalIds":[{"identifier":"123","identifierService":{"code":"GitHub"}}]}'
(2) update draft (persistent id taken from response above)
curl "http://localhost:8080/api/datasets/9faRzb?draft=true" -X PUT -H "content-type: application/json" -H "authorization: ${TOKEN}" -d '{"label":"l","description":"d","externalIds":[{"identifier":"123","identifierService":{"code":"GitHub"}}]}'
In GitLab by @tparkola on Apr 22, 2022, 12:03
Currently I just finished fixing error connected to externalIds, but noticed inaccuracy. So I did as wroted in scenario, but then I encountered error - draft item not found. I was confused -
Unable to find draft eu.sshopencloud.marketplace.model.tools.Tool with id 8P5hKY for the authorized user
It happends after clicking button publish. The backed is called 3 times for item 8P5hKY - twice for not draft, and once for draft whereas the draft item was published therefore deleted from table drafts.
Don't know if the draft item should't be deleted, or front should not call for draft for this item right away?
@KlausIllmayer @stefanprobst @vronk
In GitLab by @stefanprobst on Apr 22, 2022, 14:32
The backed is called 3 times for item 8P5hKY
these calls happen on the item details page (after the user has been redirected there after clicking "Publish"), correct? if so, the reason is that on an item details page, we show potentially three different "Edit" buttons to authenticated users: "Edit the currently approved version", "Edit the latest suggested version", "Edit the latest draft version". If there is a more straightforward way to know whether there are currently suggested or draft item versions saved by a user, i'd be happy to know.
In GitLab by @tparkola on Apr 25, 2022, 08:59
Now I understand, thanks. Unfortunately, I don't think there is.
In GitLab by @KlausIllmayer on Jun 28, 2022, 15:54
I've tried out both approaches (mine and Stefan's) on stage instance (Stefan's also on production) and the error does not occur anymore. Thanks for solving!
In GitLab by @KlausIllmayer on Jun 28, 2022, 15:54
changed the incident status to Resolved by closing the incident
In GitLab by @KlausIllmayer on Apr 6, 2022, 14:21
Every now and then there was an error in the logfiles that also had an effect on publishing an item. The error lead to a 500 error on frontend and in the logfiles it said:
I'm now able to repeat the error on our stage instance (all using the frontend):
In the logfile you will see:
As the same workflow works like a charm if you don't save a draft but immediately publish the item, I suspect that publishing the draft item is done in a way so that it breaks the mentioned constraint.
@tparkola Could you look into this issue? It happend until now not that often, but as it is easy to initiate we need a bugfix for this.
Informing @laureD19 (already having this issue last week - thanks for reporting, it helped me to reconstruct the problem) and @vronk