We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

thedefaultman's avatar
thedefaultman
New member | Level 2
4 months ago

large file upload for github actions

Hi all, I'm trying to integrate my software pipeline with dropbox. I've written this bash script that should be able to use the upload session based on the api doc and upload the files but I think I'm doing something wrong with the chunking logic.  Here is my code https://github.com/thedefaultman/dropbox-large-file-uploader

This is the error I get on github actions side of things.

{"error_summary": "lookup_failed/incorrect_offset/..", "error": {".tag": "lookup_failed", "lookup_failed": {".tag": "incorrect_offset", "correct_offset": 0}}}

 

Cheers,

  • iNeil's avatar
    iNeil
    Icon for Dropbox Engineer rankDropbox Engineer

    Hi thedefaultman ,

    Based on the information you have provided, you are encountering an error message "incorrect_offset" when attempting to upload files using upload sessions. That error can occur regardless of what chunk size you're using, and means:

     

    The specified offset was incorrect. See the value for the correct offset. This error may occur when a previous request was received and processed successfully but the client did not receive the response, e.g. due to a network error.

    To handle this, the app should check the "correct_offset" value from the response, which indicates how many bytes the Dropbox API has successfully received for this upload session so far. When an incorrect offset is sent, the Dropbox API is rejecting the call in order to prevent invalid file data from being committed.

     

    I recommend adding more logging to your code, e.g., to log out exactly what parameters you're sending to each API call, to determine where these values may be going wrong, and add some error handling to automatically catch and handle this error when it occurs. The app can resume the upload session from the correct offset.

     

    • Здравко's avatar
      Здравко
      Legendary | Level 20

      iNeil wrote:

      ..., to determine where these values may be going wrong, and add some error handling to automatically catch and handle this error when it occurs. ...


      Hm...🤔 Where may the values be going wrong? Is there something wrong with the values (as expressed) or some error in the API call (as expressed)? 🙂 There is nothing like that!

      Instead of catch and handle something meaningless and fix... nothing, it may be better not to enumerate (or rather try for enumeration of) non existing file parts (as result of syntax errors and/or misunderstanding of how shell script works). 😀 Try avoid following the same line iNeil ðŸ˜‰

  • Hi thedefaultman,

    Your issue is not Dropbox API. From Dropbox API point of view, everything looks fine. It's not the same about basic bash syntax rules though! 🙂

    Take some time, read about different bash loops and how they may be organized and controlled. Other thing you may improve is understanding of command options you have used. Be aware what every option means and why are you using every one of them. Stepping in this direction (step by step) will let you see where that error message comes form and fix the issue of course.

    Go further (learning bash syntax) with patience and persistence. 😉