internal error 'bz_sha1 did not match data received' on b2.uploadFile
See original GitHub issueI’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:
- Created 8 years ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.Nice! I’ll mark this as a question so people can find it in future 👍