tus / tus/tus-android-client

Upload stuck after few seconds without showing error

Open
#39 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Java
Stars
182
Forks
49
Avg merge
7d 20h
Merged PRs (30d)
2

Description

Question
After a few seconds from the beginning of the video upload process, the progress bar stops without displaying any errors. Sometimes (when I debug my code and it stops on breakpoint) I got
ssl=0xc5934ed8: I/O error during system call, Broken pipe I try to solve this problem with https://github.com/tus/tus-android-client/issues/33
and
https://github.com/tus/tus-android-client#i-get-tlsssl-errors-on-older-android-versions
but without any success. For some reason, program never reach uploader.finish() or anything below that line of code (that is strange because do-while code is not in infinity loop).

Code sample:
`

            HashMap<String, String> headers = new HashMap<>();
            headers.put("Tus-Resumable", "1.0.0");
            headers.put("Authorization", getAuthHeader());
            headers.put("Accept", getAcceptHeader());
            headers.put("Content-Type", "application/offset+octet-stream");
            headers.put("Upload-Length", "" + upload.getSize());
            headers.put("Connection", "Keep-Alive");
            client.setHeaders(headers);

            TusUploader uploader = client.beginOrResumeUploadFromURL(upload, client.getUploadCreationURL());
            long totalBytes = upload.getSize();
            long uploadedBytes = uploader.getOffset();

            uploader.setChunkSize(1024);

            while (!isCancelled() && uploader.uploadChunk() > 0) {
                uploadedBytes = uploader.getOffset();
                publishProgress(uploadedBytes, totalBytes);
            }
            
            uploader.finish();
            return uploader.getUploadURL();

`
device-2020-05-18-130543

Setup details
Please provide following details, if applicable to your situation:

  • Runtime environment: [Android version 7]
  • Used tus-android-client version: [v0.1.9]
  • Used tus-java-client version: [ev0.4.2]

Contributor guide

No contributing guide indexed for this repository

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 with the upload loop shown in the issue, especially TusUploader.uploadChunk() and the path before uploader.finish(), using Android 7 with tus-android-client v0.1.9 and tus-java-client ev0.4.2. Reproduce the stalled upload and trace the reported broken-pipe condition; done means the failure is surfaced appropriately or the upload completes and reaches finish().

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.