Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Kernel::System::Storage::S3::DiscardObjects #1745

Closed
1 task done
bschmalhofer opened this issue Apr 30, 2022 · 4 comments
Closed
1 task done

Fix Kernel::System::Storage::S3::DiscardObjects #1745

bschmalhofer opened this issue Apr 30, 2022 · 4 comments
Assignees
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented Apr 30, 2022

When MinIO is used as a S3 backend that the console command Maint::Loader::CacheCleanup does not delete the files in MinIO.

TODO:

  • make it work for MinIO
@bschmalhofer bschmalhofer added this to the OTOBO 10.1 milestone Apr 30, 2022
@bschmalhofer bschmalhofer self-assigned this Apr 30, 2022
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented May 4, 2022

Tried to debug this. The request that should delete cached JS and CSS looks OK.

<Delete xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Object><Key>OTOBO/var/httpd/htdocs/js/js-cache/CommonJS_0ead0e67127bed1894c4b23ffc892a1e.js</Key></Object><Object><Key>OTOBO/var/httpd/htdocs/js/js-cache/ModuleJS_499b835124455679ccbb66f93cf7cabc.js</Key></Object><Object><Key>OTOBO/var/httpd/htdocs/js/js-cache/ModuleJS_80d23e9b9b514232da457bc0092bf14c.js</Key></Object><Object><Key>OTOBO/var/httpd/htdocs/js/js-cache/ModuleJS_cc7ef0dcaf580b80218558a44c3fb8fc.js</Key></Object><Object><Key>OTOBO/var/httpd/htdocs/js/js-cache/TemplateJS_Standard_2658bd764ae451070900369acc855e32.js</Key></Object><Object><Key>OTOBO/var/httpd/htdocs/js/js-cache/TranslationJS_de_303d3d8d9a99e83beb7beae9b3f9164f.js</Key></Object><Object><Key>OTOBO/var/httpd/htdocs/skins/Agent/default/css-cache/CommonCSS_75f59159f757a591d12adaefed83dce1.css</Key></Object><Object><Key>OTOBO/var/httpd/htdocs/skins/Agent/default/css-cache/ModuleCSS_35d1d367d1cd619c28fff2b2fea1dd96.css</Key></Object><Object><Key>OTOBO/var/httpd/htdocs/skins/Agent/default/css-cache/ResponsiveCSS_05e96d82a496003a37c11cea53ba7893.css</Key></Object></Delete>
The method is POST and the query is delete. Just like it is documented in https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html .
But the actual request returns a HTTP status code 400. This is also visible in the Minio Trace log at http://localhost:9001/tools/trace. But the message is a not so helpful 'Bad Request'

@bschmalhofer
Copy link
Contributor Author

Still no idea why this does not work. It's likely not a privilege issue, as MinIO should return an Error for each element it can't delete.

@bschmalhofer bschmalhofer changed the title Clean up loader files in MinIO for Maint::Loader::CacheCleanup Fix Kernel::System::Storage::S3::DiscardObjects May 9, 2022
@bschmalhofer
Copy link
Contributor Author

This bug has not only bad effects for the cleanup of loader files. There are also problems when dealing with encrypted emails. Because the objects are not cleared out in Kernel/Output/HTML/ArticleCheck/PGP.pm the decrypted files end up with unexpected name. E.g. file1.txt is stored as file1-1.txt .

bschmalhofer added a commit that referenced this issue May 9, 2022
bschmalhofer added a commit that referenced this issue May 9, 2022
if DeleteMultipleObjects is assumed to have problems
bschmalhofer added a commit that referenced this issue May 9, 2022
@bschmalhofer
Copy link
Contributor Author

Added fallback to delete the single objects in a loop. Verified manually that Maint::Loader::CacheCleanUp is sensible now.
scripts/test/PGP/EmailHandling.t is successful again. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant