Google-cloud-node: Error : Not Found google cloud storage

Created on 28 Aug 2017  路  9Comments  路  Source: googleapis/google-cloud-node

OS: Windows10 
Node.js version: 8.4.0
npm version:5.3.0
google-cloud-node  #version:1.2.1
add_file:function(path){
    bucket.upload(path, function(err, file) {
        if (err) {
          console.error(err)
        }
        console.log(file)
    });
  },

thats my function to upload a file the file is a 34 mb .dem protobuf file the error trace im getting is.

Error: Not Found
    at Request._callback (C:\Users\anshu\Desktop\statseeker\node_modules\gcs-resumable-upload\index.js:283:25)
    at Request.self.callback (C:\Users\anshu\Desktop\statseeker\node_modules\request\request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (C:\Users\anshu\Desktop\statseeker\node_modules\request\request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (C:\Users\anshu\Desktop\statseeker\node_modules\request\request.js:1091:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1059:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
storage

Most helpful comment

I believe the path should be: https://www.googleapis.com/upload/storage/v1/b/your_bucket_name

Can you show how you create the Bucket object?

All 9 comments

Hello, @c00kie17, can you fill in the details about your environment?

  • OS:
  • Node.js version:
  • npm version:
  • google-cloud-node version:

Thanks!

Note: The OP edited it into his original post. (I almost missed that.)

With #2582, this is the second report in three days that are npm 5.3.0. Different operating systems, but consistently Node 8.4 and npm 5.3.0.

@c00kie17 would you mind going into the file, C:\Users\anshu\Desktop\statseeker\node_modules\gcs-resumable-upload\index.js, adding a console.log(authorizedReqOpts) on line 275, then pasting the response here? (You can remove the Authorization: 'Bearer y.2....' line from the output)

{ method: 'POST',
  uri: 'https://www.googleapis.com/upload/storage/v1/b/my_project_id/events/new_player/o',
  qs: 
   { name: 'file.csv',
     uploadType: 'resumable',
     predefinedAcl: 'publicRead' },
  json: { contentType: 'image/jpeg', metadata: { custom: 'metadata' } },
  headers: 
   { 'X-Upload-Content-Type': 'image/jpeg',
     Authorization: 'Bearer ... } }
OS: Windows 7
Node.js version: 6.9.5
npm version: 3.10.10

I believe the path should be: https://www.googleapis.com/upload/storage/v1/b/your_bucket_name

Can you show how you create the Bucket object?

The bucket object is already created im not creating it in my code. I created it manually from the google cloud console.

Sorry, I meant the @google-cloud/storage "Bucket", i.e.:

var storage = require('@google-cloud/storage')
var bucket = storage.bucket('...')
var file = bucket.file('...')

It seems like the argument passed to storage.bucket() and/or storage.file() might be incorrect. In a typical scenario, this should look like:

var bucket = storage.bucket('my-bucket-name')
var file = bucket.file('my-file-name')

If the file is in a folder, it would look like:

var bucket = storage.bucket('my-bucket-name')
var file = bucket.file('my-folder-name/my-file-name')

This issue was moved to googleapis/nodejs-storage#25

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jackzampolin picture jackzampolin  路  3Comments

VikramTiwari picture VikramTiwari  路  3Comments

bamapookie picture bamapookie  路  5Comments

jgeewax picture jgeewax  路  4Comments

sabrehagen picture sabrehagen  路  4Comments