Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Due to the following error, AWS cloud image can't be deleted.
Error: The operation "DeregisterImage" could not be performed.
Error Info: AuthFailure
Error from: client-side
Status Code: 400
Message: Not authorized for image:ami-39c28c41
The AWS Cloud Image "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20180617" couldn't delete.
Comment | File | Size | Author |
---|---|---|---|
#16 | 3013583_20181116.patch | 667 bytes | Xiaohua Guan |
| |||
#9 | 3013583_20181115.patch | 14.51 KB | Xiaohua Guan |
|
Comments
Comment #2
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedComment #3
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedI explain my fix as following.
I add code to check the owner of the image before deleting it. If the ower is not the current user, I will skip the operation DeregisterImage.
In addition, because the property "owner" isn't set when creating a new image, I also add code to set the property.
Comment #4
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedComment #5
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedRemove wrong comment.
Errors like below occurred.
Comment #6
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedRemove wrong comment.
I added a composer.json file, where add the dependency to package aws-sdk-php.
Comment #7
yas@xiaohua-guan Thank you for your patch. I tested your patch manually and it looks working fine. However, to make sure that the error does not return, can you make a test for that patch?
Comment #8
Xiaohua Guan CreditAttribution: Xiaohua Guan commented@yas
Ok. I will add a test case for the patch.
Comment #9
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedComment #10
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedComment #11
Xiaohua Guan CreditAttribution: Xiaohua Guan commented@yas
I added a test case to delete image imported, which has different owner.
Please review the patch file 3013583_20181115.patch.
Comment #12
yas@xiaohua-guan Thank you for your update, it looks good to me.
@baldwinlouie How do you think?
Comment #13
baldwinlouie CreditAttribution: baldwinlouie commented@yas, Looks good! Thank you for the patch.
Comment #15
yas@xiaohua-guan
@baldwinlouie
Thank you for your contributions. I pushed the code and close this issue.
Comment #16
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedComment #17
Xiaohua Guan CreditAttribution: Xiaohua Guan commented@yas
Following error occurred in the automated testing of the branch.
https://www.drupal.org/pift-ci-job/1122274
Drupal\Component\Serialization\Exception\InvalidDataTypeException: yaml_parse(): parsing error encountered during parsing: did not find expected node content (line 21, column 20), context while parsing a block node (line 21, column 20)
The error is due to my mistake in the patch 3013583_20181115.patch. I am sorry.
I provided a new patch file 3013583_20181116.patch, could you review it?
Comment #18
Xiaohua Guan CreditAttribution: Xiaohua Guan commentedComment #20
yasOK, I pushed the patch.
Comment #21
yasComment #22
yas