-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Invalid request. The number of bytes uploaded is required to be equal or greater than 262144 , While trying to upload file #1044
Comments
Is this reproducible every time? (can you retry the upload?) Does this occur with other files? What type of file is it? If possible, can you share the file or another one that fails consistently? |
@stephenplusplus Its occuring with one particular file (9.4 MB) I have attached error trace
|
Can you show the gcloud-node code you're using? |
@stephenplusplus CloudStorage.prototype.uploadFile = function(localPath,cloudPath,options){
options = options || {};
var q = Q.defer();
cloudPath = this.parseUrl(cloudPath);
if(!options.destination)
options.destination = cloudPath.path;
this.gcs.bucket(cloudPath.bucket).upload(localPath,options,function(err, file) {
if (!err) {
q.resolve(file);
}else{
q.reject(err);
}
});
return q.promise;
};
CloudStorage.prototype.parseUrl = function(url) {
if(typeof url !== 'string') {
throw new Error('only string parameter supported! ');
}
url = url.replace('gs://', '');
var data = {};
var bits = url.split('/');
data.bucket = bits.shift();
data.path = bits.join('/');
return data;
}; |
I haven't been able to reproduce using a file of the same size. The library reporting the error is actually gcs-resumable-upload. It creates/re-uses a JSON file to store the progress of the resumable upload. Can you check |
@stephenplusplus Thanks it worked ! Between name of file was |
Oh, sorry, thanks for correcting. Glad it worked! |
* chore: remove obsolete service config files PiperOrigin-RevId: 472492863 Source-Link: googleapis/googleapis@725381d Source-Link: googleapis/googleapis-gen@16aebe2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZhZWJlMjRlODE3YzI0ZTYxOTI3NDZlZGM1MjJkNzAwMzZkZDc3MiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: update comments for image annotator OCR models PiperOrigin-RevId: 474070246 Source-Link: googleapis/googleapis@346e2f2 Source-Link: googleapis/googleapis-gen@50b3451 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTBiMzQ1MTVmYTg5NTI1OTg5MDIxYmU0YjY5ODlkNDkwNTlkOGQyNiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: use gapic-generator-typescript v2.17.0 PiperOrigin-RevId: 474338479 Source-Link: googleapis/googleapis@d5d35e0 Source-Link: googleapis/googleapis-gen@efcd3f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: googleapis/googleapis@7a12973 Source-Link: googleapis/googleapis-gen@370c729 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: make test pass Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Alexander Fenster <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [3.0.1](googleapis/nodejs-vision@v3.0.0...v3.0.1) (2022-09-21) ### Bug Fixes * Preserve default values in x-goog-request-params header ([#1044](googleapis/nodejs-vision#1044)) ([a5baeca](googleapis/nodejs-vision@a5baeca)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Getting error
Error: Invalid request. The number of bytes uploaded is required to be equal or greater than 262144, except for the final request (it's recommended to be the exact multiple of 262144). The received request contained 229591 bytes, which does not meet this requirement.
while trying to upload file
The text was updated successfully, but these errors were encountered: