GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Error: Invalid request. The number of bytes uploaded is required to be equal or greater than 262144 , While trying to upload file · Issue #1044 · googleapis/google-cloud-node

Error: Invalid request. The number of bytes uploaded is required to be equal or greater than 262144 , While trying to upload file  #1044

New issue
Copy link
New issue
Copy link
Closed
Closed
Error: Invalid request. The number of bytes uploaded is required to be equal or greater than 262144 , While trying to upload file #1044
Copy link
Assignees
aneesv
Labels
api: storageIssues related to the Cloud Storage API.

Description

@aneesv
aneesv
opened on Jan 4, 2016
Issue body actions

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

Activity

  1. stephenplusplus commented on Jan 4, 2016

    @stephenplusplus
    stephenplusplus
    on Jan 4, 2016
    Contributor
    More actions

    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?

  2. stephenplusplus
    added
    api: storageIssues related to the Cloud Storage API.
    on Jan 4, 2016
  3. aneesv commented on Jan 4, 2016

    @aneesv
    aneesv
    on Jan 4, 2016
    Author
    More actions

    @stephenplusplus Its occuring with one particular file (9.4 MB)

    I have attached error trace

    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. at Request._callback (/node_modules/gcloud/node_modules/gcs-resumable-upload/index.js:218:25) at Request.self.callback (/node_modules/request/request.js:198:22) at Request.emit (events.js:110:17) at Request.<anonymous> (/node_modules/request/request.js:1082:10) at Request.emit (events.js:129:20) at IncomingMessage.<anonymous> (/node_modules/request/request.js:1009:12) at IncomingMessage.emit (events.js:129:20) at _stream_readable.js:908:16 at process._tickDomainCallback (node.js:381:11)

  4. stephenplusplus commented on Jan 4, 2016

    @stephenplusplus
    stephenplusplus
    on Jan 4, 2016
    Contributor
    More actions

    Can you show the gcloud-node code you're using?

  5. aneesv commented on Jan 4, 2016

    @aneesv
    aneesv
    on Jan 4, 2016
    Author
    More actions

    @stephenplusplus
    I am using a wrapper , Code is working perfectly for all files expect one file. I tried reuploading it same error

    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;
    };
  6. stephenplusplus commented on Jan 4, 2016

    @stephenplusplus
    stephenplusplus
    on Jan 4, 2016
    Contributor
    More actions

    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 ~/.config/configstore/gcloud-node.json and remove it to see if that solves it?

  7. aneesv commented on Jan 4, 2016

    @aneesv
    aneesv
    on Jan 4, 2016
    Author
    More actions

    @stephenplusplus Thanks it worked ! Between name of file was ~/.config/configstore/gcs-resumable-upload.json

  8. aneesv
    closed this as completedon Jan 4, 2016
  9. stephenplusplus commented on Jan 4, 2016

    @stephenplusplus
    stephenplusplus
    on Jan 4, 2016
    Contributor
    More actions

    Oh, sorry, thanks for correcting. Glad it worked!

  10. JustinBeckwith
    assigned
    aneesv
    on Feb 1, 2021
  11. sofisl
    added 2 commits that reference this issue on Jan 17, 2023

    fix: preserve default values in x-goog-request-params header (#1044)

    54fa772

    chore(main): release 3.0.1 (#1066)

    12307e7
  12. sofisl
    added a commit that references this issue on Feb 24, 2026

    feat!: Drop Node 8 support (#1006)

    2500a99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @aneesv
    aneesv

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.