Comments (8)
That's not fun at all. According to these docs: https://cloud.google.com/storage/docs/json_api/v1/status-codes that means somewhere along the way we made a "bad request". I'll jump on a computer later and try to reproduce. If you're up for some console.logging in the mean time, feel free :)
from gcs-resumable-upload.
Would you put a console.log(resp.toJSON())
at this line and paste the output?
from gcs-resumable-upload.
TypeError: Cannot read property 'toJSON' of undefined
(resp
is undefined).
I get the same errors
array when I console.log(JSON.stringify(body));
on line 210 and the resp
object there is a little too big to paste.
I believe that the callback at line 214 is what's causing resp
to be undefined on line 89.
from gcs-resumable-upload.
Woops, sorry for sending you down that road that was clearly wrong. Instead of logging resp
, resp.toJSON()
should produce a much more copy-pastable object.
from gcs-resumable-upload.
Could this be the solution? I've created a bucket with a service account, and I'm trying to access it with that same service account, but do I need to give that service account write permissions? http://stackoverflow.com/a/17978592
I've removed what I believe to be potentially sensitive info, hope I didn't screw anything up.
{ statusCode: 400,
body: { error: { errors: [Object], code: 400, message: 'Required' } },
headers:
{ 'x-guploader-uploadid': 'XXXXXX',
vary: 'Origin, X-Origin',
'content-type': 'application/json; charset=UTF-8',
'content-length': '163',
date: 'Wed, 02 Sep 2015 23:25:46 GMT',
server: 'UploadServer',
'alternate-protocol': '443:quic,p=1',
'alt-svc': 'quic=":443"; p="1"; ma=604800',
connection: 'close' },
request:
{ uri:
{ protocol: 'https:',
slashes: true,
auth: null,
host: 'www.googleapis.com',
port: null,
hostname: 'www.googleapis.com',
hash: null,
search: '?name%5B_bsontype%5D=ObjectID&name%5Bid%5D=U%C3%A7%C2%85ze%C3%98%C3%A232%22%02%C2%A3&uploadType=resumable',
query: 'name%5B_bsontype%5D=ObjectID&name%5Bid%5D=U%C3%A7%C2%85ze%C3%98%C3%A232%22%02%C2%A3&uploadType=resumable',
pathname: '/upload/storage/v1/b/thebucket/o',
path: '/upload/storage/v1/b/thebucket/o?name%5B_bsontype%5D=ObjectID&name%5Bid%5D=U%C3%A7%C2%85ze%C3%98%C3%A232%22%02%C2%A3&uploadType=resumable',
href: 'https://www.googleapis.com/upload/storage/v1/b/thebucket/o?name%5B_bsontype%5D=ObjectID&name%5Bid%5D=U%C3%A7%C2%85ze%C3%98%C3%A232%22%02%C2%A3&uploadType=resumable' },
method: 'POST',
headers:
{ Authorization: 'Bearer XXXXXXX',
accept: 'application/json',
'content-type': 'application/json',
'content-length': 2 } } }
from gcs-resumable-upload.
I think the problem might be the filename:
name%5B_bsontype%5D=ObjectID&name%5Bid%5D=U%C3%A7%C2%85ze%C3%98%C3%A232%22%02%C2%A3&uploadType=resumable
Translated:
name[_bsontype]=ObjectID&name[id]=Uç�zeØâ32"�£&uploadType=resumable"
Looks like maybe you're giving an object as the file
property instead of a string?
from gcs-resumable-upload.
OOOPS! You're totally right. Forgot a simple .toString()
. Sorry for the headache. 😵
from gcs-resumable-upload.
No problem, glad we got it solved! :)
from gcs-resumable-upload.
Related Issues (20)
- gcs-resumable-upload #makeRequest: should execute the callback with a body error & response failed HOT 1
- gcs-resumable-upload #makeRequest: should execute the callback with a body error & response for non-2xx status codes failed HOT 1
- gcs-resumable-upload #makeRequest: should execute the callback failed HOT 1
- end to end: should work failed HOT 1
- end to end: should resume an interrupted upload failed HOT 1
- end to end: should just make an upload URI failed HOT 1
- end to end: should return a non-resumable failed upload failed HOT 1
- end to end: should set custom config file failed HOT 1
- How does to make example work with google auth library? HOT 1
- end to end: should work failed HOT 1
- end to end: should resume an interrupted upload failed HOT 3
- Your .repo-metadata.json file has a problem 🤒
- Your .repo-metadata.json file has a problem 🤒
- end to end: should work failed
- end to end: should resume an interrupted upload failed
- end to end: should just make an upload URI failed
- end to end: should set custom config file failed HOT 1
- Reasons behind gcs-resumable-upload deprecation and recommended alternatives? HOT 2
- end to end: should set custom config file failed HOT 1
- end to end: should work failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcs-resumable-upload.