Bug #14860

[API] Cannot modify collection when versioning is enabled and idle time is expired

Added by Lucas Di Pentima almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
-
Start date:
02/19/2019
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-
Release relationship:
Auto

Description

This happens when logged in with a non-admin account and working with on a collection with files.


Subtasks

Task #14867: Review 14860-fix-collection-versioningResolvedLucas Di Pentima

Associated revisions

Revision 9acc7690
Added by Lucas Di Pentima almost 2 years ago

Merge branch '14860-fix-collection-versioning'
Closes #14860

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <>

History

#1 Updated by Lucas Di Pentima almost 2 years ago

  • Status changed from New to In Progress

#2 Updated by Lucas Di Pentima almost 2 years ago

After some more diagnosing, the issue seems to be happening when trying to save the snapshot collection on manage_versioning() callback at Collection class: The check_signatures() callback on the newly created snapshot fails because manifest_text has locators without signatures (fails at line 129)

#3 Updated by Peter Amstutz almost 2 years ago

Lucas Di Pentima wrote:

After some more diagnosing, the issue seems to be happening when trying to save the snapshot collection on manage_versioning() callback at Collection class: The check_signatures() callback on the newly created snapshot fails because manifest_text has locators without signatures (fails at line 129)

From chat:

The brute force solution would be to call signed_manifest_text to get manifest_text for the snapshot. Alternately you could wrap snapshot.save with act_as_system_user so long as that doesn't change any of the metadata fields (modified_by_user_uuid &c) or other behavior.

#4 Updated by Lucas Di Pentima almost 2 years ago

Updates at c1e1a7546 - branch 14860-fix-collection-versioning
Test run: https://ci.curoverse.com/job/developer-run-tests/1077/

Fixed the bug by assigning the signed manifest text to the snapshot being saved, as suggested by Peter. The act_as_system_user approach didn't worked because the modified_by_user_uuid field was being updated.

#5 Updated by Peter Amstutz almost 2 years ago

Lucas Di Pentima wrote:

Updates at c1e1a7546 - branch 14860-fix-collection-versioning
Test run: https://ci.curoverse.com/job/developer-run-tests/1077/

Fixed the bug by assigning the signed manifest text to the snapshot being saved, as suggested by Peter. The act_as_system_user approach didn't worked because the modified_by_user_uuid field was being updated.

This LGTM.

#6 Updated by Peter Amstutz almost 2 years ago

  • Release set to 23

#7 Updated by Lucas Di Pentima almost 2 years ago

  • Status changed from In Progress to Resolved

#8 Updated by Tom Morris almost 2 years ago

  • Release changed from 23 to 21

Also available in: Atom PDF