Skip to content
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 : Not Found google cloud storage #2573

Closed
c00kie17 opened this issue Aug 28, 2017 · 9 comments
Closed

Error : Not Found google cloud storage #2573

c00kie17 opened this issue Aug 28, 2017 · 9 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API.

Comments

@c00kie17
Copy link

c00kie17 commented Aug 28, 2017

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)
@stephenplusplus
Copy link
Contributor

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

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

Thanks!

@stephenplusplus stephenplusplus added the api: storage Issues related to the Cloud Storage API. label Aug 28, 2017
@lukesneeringer
Copy link
Contributor

lukesneeringer commented Aug 31, 2017

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.

@stephenplusplus
Copy link
Contributor

@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)

@DennisDukh
Copy link

DennisDukh commented Sep 7, 2017

{ 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 ... } }

@DennisDukh
Copy link

OS: Windows 7
Node.js version: 6.9.5
npm version: 3.10.10

@stephenplusplus
Copy link
Contributor

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?

@c00kie17
Copy link
Author

c00kie17 commented Sep 8, 2017

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

@stephenplusplus
Copy link
Contributor

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')

@lukesneeringer
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

No branches or pull requests

4 participants