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

Version 6.5.3 breaks emulator usage #2086

Closed
flovouin opened this issue Oct 19, 2022 · 0 comments · Fixed by #2087
Closed

Version 6.5.3 breaks emulator usage #2086

flovouin opened this issue Oct 19, 2022 · 0 comments · Fixed by #2087
Assignees
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@flovouin
Copy link

Environment details

  • OS: macOS
  • Node.js version: 16
  • npm version: 8
  • @google-cloud/storage version: 6.5.3

Steps to reproduce

Run the following code against the Firebase Storage emulator:

process.env.STORAGE_EMULATOR_HOST = "http://localhost:9199";

const { Storage } = require("@google-cloud/storage");

const s = new Storage();

s.bucket("demo-test.appspot.com")
  .file("test")
  .delete()
  .then(() => console.log("Done"))
  .catch((error) => console.error(error.stack));

With version 6.5.2 you'll get a "no such object" error (which is normal):

Error: No such object: demo-test.appspot.com/test
    at new ApiError (/workspace/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:79:15)
    at Util.parseHttpRespBody (/workspace/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:214:38)
    at Util.handleResp (/workspace/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:155:117)
    at /workspace/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:536:22
    at onResponse (/workspace/node_modules/retry-request/index.js:240:7)
    at /workspace/node_modules/teeny-request/build/src/index.js:217:17
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

With version 6.5.3 you'll get a "not implemented" error:

Error: Not Implemented
    at new ApiError (/workspace/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:79:15)
    at Util.parseHttpRespMessage (/workspace/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:181:41)
    at Util.handleResp (/workspace/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:155:76)
    at /workspace/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:536:22
    at onResponse (/workspace/node_modules/retry-request/index.js:240:7)
    at /workspace/node_modules/teeny-request/build/src/index.js:226:13
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

This is a minimal reproducible example, however I encountered this bug while using the Storage client through the firebase-admin/storage package. Everything else equal (firebase-admin version included), my tests pass with version 6.5.2 of the client, and fail with "Not Implemented" errors when using 6.5.3.
If the new behaviour / URLs are indeed the expected ones, then this could also be a bug in the Firebase Storage emulator.

Probably related:

@flovouin flovouin added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 19, 2022
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Oct 19, 2022
@danielbankhead danielbankhead self-assigned this Oct 19, 2022
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 googleapis/nodejs-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants