nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.57k stars 4.08k forks source link

[Bug]: Broken uploads overflow the server #47208

Open haeki1 opened 3 months ago

haeki1 commented 3 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

Hi,

I encountered my 1TB nextcloud server to be almost out of space while nextcloud only shows the usage of ~500gb in the user table. As version should only take up to 50% of the free space I asked the cloudprovider (Hetzner) for a list of files. There was a folder with around 500gb which seemed to be empty with 0kb in the browser view. When deleting the folder the space got freed up. We found there were lots of broken uploads hidden inside that folder. All of the same file.

3.7G DJI_0568.MP4.ocTransferId1006277266.part 3.7G DJI_0568.MP4.ocTransferId1031769047.part 3.7G DJI_0568.MP4.ocTransferId103262427.part 3.7G DJI_0568.MP4.ocTransferId1049305076.part 3.7G DJI_0568.MP4.ocTransferId1061398193.part 3.7G DJI_0568.MP4.ocTransferId1085181558.part 3.7G DJI_0568.MP4.ocTransferId1085841304.part 3.7G DJI_0568.MP4.ocTransferId1110290658.part … Summed up: 591GB

I am using the virtual files client (Nextcloud Desktop-Client 3.13.2) on mac and also used the virtual files folder for uploading that file. When using the regular folder without virtual files for uploading everything works fine.

Kind regards, Fabian

Steps to reproduce

  1. Upload a large file via virtual files client (in my case 3.7GB)
  2. Free space at /settings/admin/serverinfo keeps filling up with broken uploads till no space is left
  3. deleting the parentfolder results is freeing up the space

Expected behavior

Upload should work without creating broken files filling up the drive.

Installation method

None

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MySQL

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

provokateurin commented 3 months ago

These "aborted" uploads are normally taken care of and removed after 24 hours. Do you know if uploading that particular file was broken or aborted in some other way? Can you make sure that your cronjobs run normally as expected? You already deleted the folder, but can you check older logs if there were some errors when running cronjobs?

joshtrichards commented 1 week ago

Seems this Issue is about two situations:

  1. Aborted upload remnants / part file handling/clean-up (server-side matter)
  2. Some sort of upload problem (possibly client side or possibly infrastructure related such as web server/proxy timeouts or a client bug)

Item 2 lead to item 1.

I am using the virtual files client (Nextcloud Desktop-Client 3.13.2) on mac and also used the virtual files folder for uploading that file. When using the regular folder without virtual files for uploading everything works fine.

Expected Behavior: Upload should work without creating broken files filling up the drive.

As Kate noted, upload part files go stale after 24 hours and we clean them up (#12227).

Item 2 happening in a short amount of time on a sufficiently space limited server might lead to 1, but not sure there are good options we have for that... since cleaning more aggressively will start to overlap with in progress upload attempts... (side note that just occurred to me: another factor might be your cron mode if it's ajax or web).

Item 2 is your root cause and needs to be deal with via the desktop client repo.

Item 1 is a possible optimization opportunity.

If you can answer the prior query, specifically the following question, I'll move this issue over to the desktop repo:

Do you know if uploading that particular file was broken or aborted in some other way?

(i.e. check your client logs regarding the DJI_0568.MP4 file).

Otherwise I'm afraid this Issue as-is is un-actionable and will, unfortunately, get closed since we lack sufficient information from you regarding both item 1 and 2:

Can you make sure that your cronjobs run normally as expected? You already deleted the folder, but can you check older logs if there were some errors when running cronjobs?