Skip to content

Android app truncate large (multi-gigabyte) files during camera upload #181

Open

Description

@4ndr3aR

Hey folks,

sorry to bother you again and again, but I found another possible bug in the camera upload process. I was trying to upload a 5.4 Gb video, the app reported that everything went ok, but on the server the file is only 1.1 Gb. Here is the app log:

D: 2026-06-01 23:51:25:543(UploadFileFromContentUriWorker.kt:185)Upload info: OCTransfer(id=205, localPath=content://com.android.externalstorage.documents/tree/primary%3ADCIM%2FCamera/document/primary%3ADCIM%2FCamera%2FVID_20260531_204548.mp4, remotePath=/InstantUpload//VID_20260531_204548.mp4, accountName=myuser@myserver:8080, fileSize=5832800958, status=TRANSFER_QUEUED, localBehaviour=COPY, forceOverwrite=false, transferEndTimestamp=null, lastResult=null, createdBy=ENQUEUED_AS_AUTOMATIC_UPLOAD_VIDEO, transferId=null, spaceId=<uuid>$<uuid>, sourcePath=content://com.android.externalstorage.documents/tree/primary%3ADCIM%2FCamera/document/primary%3ADCIM%2FCamera%2FVID_20260531_204548.mp4, tusUploadUrl=null, tusUploadLength=null, tusUploadMetadata=null, tusUploadChecksum=null, tusResumableVersion=null, tusUploadExpires=null, tusUploadConcat=null)
D: 2026-06-01 23:53:53:680(UploadFileFromContentUriWorker.kt:185)Upload info: OCTransfer(id=205, localPath=content://com.android.externalstorage.documents/tree/primary%3ADCIM%2FCamera/document/primary%3ADCIM%2FCamera%2FVID_20260531_204548.mp4, remotePath=/InstantUpload//VID_20260531_204548.mp4, accountName=myuser@myserver:8080, fileSize=5832800958, status=TRANSFER_IN_PROGRESS, localBehaviour=COPY, forceOverwrite=false, transferEndTimestamp=null, lastResult=null, createdBy=ENQUEUED_AS_AUTOMATIC_UPLOAD_VIDEO, transferId=null, spaceId=<uuid>$<uuid>, sourcePath=content://com.android.externalstorage.documents/tree/primary%3ADCIM%2FCamera/document/primary%3ADCIM%2FCamera%2FVID_20260531_204548.mp4, tusUploadUrl=null, tusUploadLength=null, tusUploadMetadata=null, tusUploadChecksum=null, tusResumableVersion=null, tusUploadExpires=null, tusUploadConcat=null)
I: 2026-06-02 00:18:45:074(ReadRemoteFileOperation.kt:75)Read remote file /InstantUpload//VID_20260531_204548.mp4 with status 207
I: 2026-06-02 00:18:45:075(TusUploadHelper.kt:230)TUS: upload completed for /InstantUpload//VID_20260531_204548.mp4 (size=1180123136) resulting etag=null
D: 2026-06-02 00:18:45:353(UploadFileFromContentUriWorker.kt:350)TUS upload completed for /InstantUpload//VID_20260531_204548.mp4
D: 2026-06-02 00:21:19:770(AutomaticUploadsWorker.kt:152)Skipping already-tracked file: VID_20260531_204548.mp4
Image

Activity

  1. guruz commented on Jun 4, 2026

    @guruz
    Contributor

    sorry to bother you again and again,

    No bother, it's good you report any bugs and hopefully we fix them or solve them.

    but on the server the file is only 1.1 Gb

    TUS: upload completed for /InstantUpload//VID_20260531_204548.mp4 (size=1180123136) is actually that size.
    Is this for a video file that is uploaded while it's not completely written yet to the phone storage?

    CC @zerox80

  2. 4ndr3aR commented on Jun 4, 2026

    @4ndr3aR
    Author

    TUS: upload completed for /InstantUpload//VID_20260531_204548.mp4 (size=1180123136) is actually that size. Is this for a video file that is uploaded while it's not completely written yet to the phone storage?

    Shouldn't be the case. The logs say the upload started at 2026-06-01 23:51, so more than 24 hours after I finished recording the video (started recording at 20:45 of 2026-05-31 and it's a 20 minutes video).

  3. zerox80 commented on Jun 4, 2026

    @zerox80
    Contributor

    71df562
    is the suspect commit for this bug

    this PR should fix it

  4. zerox80 commented on Jun 4, 2026

    @zerox80
    Contributor

    @4ndr3aR can you give it a test and say if it gives u any issues ?

  5. zerox80 commented on Jun 4, 2026

    @zerox80
    Contributor

    @4ndr3aR can u say which android are u using? Which phone? this bug just seems like your android system is very aggressive with background workers and kills it randomly, thats a very very edge-case bug

  6. 4ndr3aR commented on Jun 4, 2026

    @4ndr3aR
    Author

    @4ndr3aR can u say which android are u using? Which phone? this bug just seems like your android system is very aggressive with background workers and kills it randomly, thats a very very edge-case bug

    Hi @zerox80, my phone is an OnePlus 6T with Android 11 (OxygenOS 11) and the app version I'm running is 1.2.3.

    @4ndr3aR can you give it a test and say if it gives u any issues ?

    Should I upgrade to the latest version in the play store? I don't see any updates at the moment, the last update on the play store is still from 19/05.

  7. zerox80 commented on Jun 4, 2026

    @zerox80
    Contributor

    Nono try running my PR, are u able to compile it? we can run a CI for building the apk

  8. 4ndr3aR commented on Jun 4, 2026

    @4ndr3aR
    Author

    Nono try running my PR, are u able to compile it? we can run a CI for building the apk

    With t→∞, probably yes, but if you want a response within a couple of days, it's better if you run a build for me please :)

  9. guruz commented on Jun 8, 2026

    @guruz
    Contributor

    , it's better if you run a build for me please :)

    I will do a QA build for you, i'll ping you about it.

  10. guruz commented on Jun 12, 2026

    @guruz
    Contributor

    Looks like Google approed v.1.2.4. in Play Store open testing track?

  11. 4ndr3aR commented on Jun 12, 2026

    @4ndr3aR
    Author

    Looks like Google approed v.1.2.4. in Play Store open testing track?

    You're right, I'm updating right now. What happens if I just touch that 5.4 Gb video under Android Termux? Does changing its date make the app attempt a re-upload? Or I'll have to rename it to something else to make it appear a new file in the app DB?

  12. guruz commented on Aug 11, 2026

    @guruz
    Contributor

    Sorry for late reply. Did you have any good or bad news about this issue?

  13. 4ndr3aR commented on Aug 11, 2026

    @4ndr3aR
    Author

    Hey, no problem at all, I kept testing all the time :)

    All in all I'd say "mostly good". The large 5.4 Gb video failed to transfer even after renaming, but after that, I see that I only have another "large file" in opencloud/opencloud-data/storage/users/uploads, a 1.3 Gb video file named fd50a622-5469-4912-94d8-8c83822c9fed, but other files with comparable size transferred (and showed up in InstantUpload/Camera) without problems.

    Looking at the logs, it seems my docker is literally spamming messages like this one:

    {"level":"error","service":"proxy","error":"failed to verify access token: token has invalid claims: token is expired","authenticator":"oidc","path":"/graph/v1.0/me/photo/$value","user_agent":"Mozilla/5.0 (Android) OpenCloud-android/1.2.5","client.address":"","network.peer.address":"IP_addr","network.peer.port":"PORT","time":"2026-08-11T13:26:15Z","message":"failed to authenticate the request"}

    But the app isn't complaining and it seems to upload files "almost normally". Maybe it's better if I re-authenticate, right? Should I delete my user on the app or is there a faster way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions