nextcloud / nextcloud/ios

Bug in the iOS Nextcloud App 5.2.4.2: Error uploading files when uploading large size file

Open
#2,870 12 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
2.5k
Forks
1k
Avg merge
2d 18h
Merged PRs (30d)
13

Description

Hello, teams,

I am trying to upload large video files from my iOS album and encountered "chunk_enough_memory" = "It seems there is not enough space to send the file" error.
After checking the source code I realize that the file upload is limited by the settings below in NextcloudKit.swift:

        if **freeDisk < fileNameLocalSize * 4** {
            // It seems there is not enough space to send the file
            let error = NKError(errorCode: NKError.chunkNoEnoughMemory, errorDescription: "_chunk_enough_memory_")
            return completion(account, nil, nil, nil, error)
        }

I wonder why the fold is set to 4, which is very troubling as I had to leave enough 4 times free space locally, which is not possible.

If the fold number is irrelevant I hope it can be removed or minimized.

Steps to reproduce
  1. download the iOS nextcloud 5.2.4.2 app
  2. configure the server to enable large file upload.
  3. upload a huge video file from iOS (10GB)
Expected behavior

huge files should be uploaded seamlessly.

Actual behavior

The app would prompt a "not enough space" message on the main page, yet no error message shown in the app log.
Meanwhile, the same amount of space will still be occupied in the cache space.
(shown in the the iOS Nextcloud app - ADVANCED - DELETE FILES TO FREE UP SPACE)
Also, I have tried to disable chunk transmission using php occ config:app:set files max_chunk_size --value 0
but in the communication log it shows that it is still using chunk uploads.

Screenshots

IMG_2616
image
image

Logs

From the communication.log:

2024-04-08 10:01:46 [INFO] PROCESS (UPLOAD) find 1 items
2024-04-08 10:01:47 [INFO] Upload file 24-01-23 22-15-51 1683.mov with Identifier 83A98BE1-20BA-4DA2-BD27-8208B308714B/L0/001 with size 1131992108 [CHUNK 100000000, E2EE false]

Reasoning or why should it be changed/implemented?

It is troublesome to set the fold number to 4 because if I want to upload a 10 GB file I will have to keep 40 GB free space in my iOS device, which is nearly impossible.

Environment data

iOS version: iOS 17.2.1

Nextcloud iOS app version: Nextcloud Hydrogen for iOS 5.2.4.2@2024

Server operating system:

Web server: Apache

Database: redis, mariaDB

PHP version: Version: 8.2.17
image

Nextcloud version: 28.0.4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in NextcloudKit.swift at the freeDisk < fileNameLocalSize * 4 check and review the upload path that reports chunk_enough_memory. Use the 10GB upload reproduction and communication.log entry as the baseline; done means large uploads are not rejected solely because four times the file size is unavailable, while the app still reports genuinely insufficient space.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.