Skip to content

bucket.getSignedUrl code in docs didn't work #195

@marcgel

Description

@marcgel

Copied this code from storage docs, tried with node interactive prompt, and expected it to work.

var gcloud = require('gcloud');
var storage = gcloud.storage;
var bucket = new storage.Bucket({ bucketName: 'example-bucket' });
var signedUrl = bucket.getSignedUrl({
  action: 'read',
  expires: Math.round(Date.now() / 1000) + (60 * 60 * 24 * 14), // 2 weeks.
  resource: 'test.jpg'
});
TypeError: Cannot read property 'private_key' of null
    at Bucket.getSignedUrl (/home/<my-home-dir>/node_modules/gcloud/lib/storage/index.js:288:50)
    at repl:1:24
    at REPLServer.self.eval (repl.js:110:21)
    at repl.js:249:20
    at REPLServer.self.eval (repl.js:122:7)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
    at Interface._ttyWrite (readline.js:760:14)

Metadata

Metadata

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions