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

When deleting a Strapi folder with a lot of files not all files on Cloud Storage get deleted. #174

Open
westende opened this issue Aug 3, 2023 · 0 comments

Comments

@westende
Copy link

westende commented Aug 3, 2023

Describe the bug
When a Strapi folder containing a large amount (approximately 3400) of files gets removed not all files are removed from Cloud Storage. Approximately 13.000 files remain in object storage including derivative images (small, medium, large, etc). They are however removed from the files table in the database.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Media Library'
  2. Create a folder
  3. Upload 3400 files
  4. Remove folder
  5. Not all files will be removed from Cloud Storage

Expected behavior
All associated files should be removed from cloud storage.

Desktop (please complete the following information):

  • OS: OSx
  • Browser Firefox
  • Version 115

Additional context
During deletion of the folder in Strapi the Strapi backend returned an HTTP 500.
I traced it back to:

KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_PG.acquireConnection (/opt/node_modules/knex/lib/client.js:312:26)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:538:9)
    at process.processTimers (node:internal/timers:512:7)
    at async Runner.ensureConnection (/opt/node_modules/knex/lib/execution/runner.js:287:28)
    at async Runner.run (/opt/node_modules/knex/lib/execution/runner.js:30:19)
    at async Object.execute (/opt/node_modules/@strapi/database/lib/query/query-builder.js:481:22)
    at async Object.findOne (/opt/node_modules/@strapi/database/lib/entity-manager/index.js:178:22)
    at async Object.remove (/opt/node_modules/@strapi/plugin-upload/server/services/upload.js:399:19)
    at async Promise.all (index 27)

In a second run I also see an OOM error:

Memory limit of 2048 MiB exceeded with 2089 MiB used. Consider increasing the memory limit, see https://cloud.google.com/run/docs/configuring/memory-limits

Perhaps the reason not all associated files were removed is related to the removal process being interrupted.

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