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)
Hello, @c00kie17, can you fill in the details about your environment?
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
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?