question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

internal error 'bz_sha1 did not match data received' on b2.uploadFile

See original GitHub issue

I’m not sure if this error is the fault of this package, or the b2 API. I’m just trying to upload a file to a bucket, but it seems that it’s failing because the sha1 didn’t match up with what the server received.

I’m unsure if I am able to provide a sha1, or if the library is doing this for me.

Here is the code:

b2.authorize().then( /* authorized */
    (response) => {
        b2.getUploadUrl(bucket).then( /* get url to upload to */
                (response) => {
                    fs.readFile('test.mp3', 'utf8', (err, data) => { /* get data object from fs */
                        b2.uploadFile( { /* upload data to bucket */
                            uploadUrl: response.uploadUrl,
                            uploadAuthToken: response.authorizationToken,
                            filename: 'test.mp3',
                            data: data /* maybe a problem? */
                        }).then(
                            (response) => {console.log(response)},
                            (err) => {console.log(err)} /* error gets logged here )': */
                        );
                    });
                },
                (error) => { console.log(error); }
        );
    },
    (error) => { console.log(error); }
);

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
m4chinationscommented, Dec 17, 2015

I found the error. When I passed ‘utf8’ into readFile it doesn’t return the raw buffer, it returns an encoded string, which makes the sha1 different. Removing it made my original code work.

1reaction
yakovkhalinskycommented, Dec 17, 2015

Nice! I’ll mark this as a question so people can find it in future 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

b2 upload-file does not calculate SHA1 automatically for large ...
Having no error on uploading is actually only half-work and not really helpful to archive integrity when I downloaded the file. Integrity ...
Read more >
Checksum did not match data received error on uploading ...
The docs state: CURLOPT_INFILESIZE. The expected size, in bytes, of the file when uploading a file to a remote site.
Read more >
B2 transfer ceases with some "Checksum did not match data ...
TxR.1.regtrans-ms: Failed to copy: Checksum did not match data received (400 bad_request) ERROR : Users/xyz/NTUSER.
Read more >
b2_upload_file - Backblaze
"upload" means a file that was uploaded to B2 Cloud Storage. "start" means that a large file has been started, but not finished...
Read more >
Resolve errors uploading data to or downloading data ... - AWS
I want to download data from Amazon Aurora and upload it to Amazon S3. How can I resolve an error I received while...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found