Skip to content

couldNotCreateFileOnServer Error with successful tusd server logs, Unable to retry afterward #203

Open

Description

@miguelespinoza

Overview

I'm encountering this issue on LTE (cellular network) where file uploads occasionally hit the couldNotCreateFileOnServer error. Unfortunately, with this generic message it's hard to understand what truly causes the issue

To further add to the confusion our server logs show a successful upload, we're using tusd Golang server.
It's as if the TUSClient fails prematurely, but the upload task is still running.
Notice server logs indicates a 2 second upload, but on the client we're seeing the error immediately around the time the upload starts. Not able to repro this locally

2025/04/24 15:32:57 INFO UploadCreated method=POST path="" requestId="" id={tus+uploadId} size=9544673 url=https://tus.domain.com/uploads/{tus+uploadId}
2025/04/24 15:32:57 INFO ResponseOutgoing method=POST path="" requestId="" id={tus+uploadId} status=201 body=""
2025/04/24 15:34:22 Received request: Method=PATCH, Path=/uploads/{tus+uploadId}, RemoteAddr=10.x.x.x:x, UserAgent=App/123 CFNetwork/x.x.1.2.1 Darwin/24.0.0
2025/04/24 15:34:22 INFO RequestIncoming method=PATCH path={tus+uploadId} requestId=""
2025/04/24 15:34:22 INFO ChunkWriteStart method=PATCH path={tus+uploadId} requestId="" id={tus+uploadId} maxSize=9544673 offset=0
2025/04/24 15:34:23 INFO ChunkWriteComplete method=PATCH path={tus+uploadId} requestId="" id={tus+uploadId} bytesWritten=9544673
2025/04/24 15:34:23 PostProcessUpload.url: ~[https://app.domain.com/api/tus_file_uploads/](https://app.domain.com/api/tus_file_uploads/)~{upload_id}/post_process
2025/04/24 15:34:24 PostProcessUpload.success: {upload_id}
2025/04/24 15:34:24 onPreFinishResponse.success: {upload_id}, metadata: map[duration:9.63 enable_content_intelligence:true filename:file.mov filetype:video/quicktime height:1920 name:file.mov size:9544673 type:video/quicktime width:1080]
2025/04/24 15:34:24 INFO UploadFinished method=PATCH path={tus+uploadId} requestId="" id={tus+uploadId} size=9544673
2025/04/24 15:34:24 INFO ResponseOutgoing method=PATCH path={tus+uploadId} requestId="" id={tus+uploadId} status=204 body=""
2025/04/24 15:34:24 Handled request: Method=PATCH, Path=/uploads/{tus+uploadId}, Duration=2.08026479s

Lastly, when I retry it fails. I've tried two strategies.

  1. Using client.retry
  2. client.cancel + client.removeFromCache and client.uploadFileAt again.

any clues as to what can cause this?

Activity

  1. donnywals commented on Jun 30, 2025

    @donnywals
    Collaborator

    Hi @miguelespinoza apologies for taking so long to respond to this one. Which TUSKit version are you testing this with?

    Am I correctly understanding that the second request (the retry) never even makes it to the server?

    If possible, could you provide a network log created with either Charles or Proxyman? That would make debugging the request / response pairs on the client side a lot easier.

    It seems like some part of the system is seeing a failing network call which results in us throwing a pretty generic "couldNotCreateFileOnServer". If we could get some info on what's happening in terms of networking on the client that would be immensely helpful.

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