Skip to content

Issue with google-auth #8691

@maelp

Description

@maelp

Please make sure you have searched for information in the following guides.

Library Name

google-cloud-storage

A screenshot that you have tested with "Try this API".

We’re seeing a reproducible failure in the signed URL path of @google-cloud/storage, while
both direct IAM signBlob and direct GoogleAuth.sign() succeed in the same container/runtime.

Environment:

  • Node.js 22.23.0
  • @google-cloud/storage@7.21.0
  • transitive google-auth-library@9.15.1
  • GCE VM / service account auth
  • signed URL generation for GCS objects with V4 signing

Observed behavior:

  • Raw POST to https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/...:signBlob
    succeeds
  • Direct GoogleAuth.sign(blob) succeeds
  • storage.bucket(...).file(...).getSignedUrl({ version: "v4", action: "read", expires }) fails
    with:
Error: Invalid response body while trying to fetch
https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/...:signBlob: Premature
close
    at Gaxios._request ...
    at Compute.requestAsync ...
    at GoogleAuth.signBlob ...
    at sign (.../@google-cloud/storage/.../signer.js:...)

So this seems specific to the @google-cloud/storage -> google-auth-library@9.x -> gaxios signing
path, not to IAM permissions, API enablement, or bucket/object existence.

### Link to the code that reproduces this issue. A link to a **public** Github Repository or gist with a minimal reproduction.


none

### A step-by-step description of how to reproduce the issue, based on the linked reproduction.


Try to sign a blob, it fails

### A clear and concise description of what the bug is, and what you expected to happen.

See above

### A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

It used to work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions