GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — FirestoreOptions .setCredentials() seems to be ignored · Issue #3458 · googleapis/google-cloud-java

FirestoreOptions .setCredentials() seems to be ignored #3458

New issue
Copy link
New issue
Copy link
Closed
Closed
FirestoreOptions .setCredentials() seems to be ignored#3458
Copy link
Assignees
pongad
Labels
api: firestoreIssues related to the Firestore API.authpriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@andrewparmet
andrewparmet
opened on Jul 12, 2018
Issue body actions

I recently upgraded Firestore from version 0.51.0-beta to 0.52.0-beta, which allows overriding of various options. My instantiation broke and now throws this exception:
com.google.cloud.firestore.FirestoreException: java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

My previous service instantiation code looked like this:

GoogleCredentials creds = getServiceAccountCredentialsFromFile();
Firestore firestore = new DefaultFirestoreFactory()
    .create(
        FirestoreOptions.newBuilder()
            .setCredentials(creds)
            .setProjectId(projectId)
            .build());

After upgrading this config no longer works; I have to do something like this:

Firestore firestore = new DefaultFirestoreFactory()
    .create(
        FirestoreOptions.newBuilder()
            .setCredentialsProvider(FixedCredentialsProvider.create(creds))
            .setProjectId(projectId)
            .build());

I have also tried this:

Firestore firestore = new DefaultFirestoreFactory()
    .create(
        FirestoreOptions.newBuilder()
            .setCredentials(creds)
            .setProjectId(config.getString("firestore.projectId"))
            .setCredentialsProvider(FirestoreOptions.getDefaultCredentialsProviderBuilder().build())
            .build());

but this also did not work.

Is it expected that setCredentials() is effectively ignored?

Activity

  1. andreamlin
    added
    auth
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jul 12, 2018
  2. JustinBeckwith
    added
    triage meI really want to be triaged.
    on Jul 13, 2018
  3. yihanzhen commented on Jul 16, 2018

    @yihanzhen
    yihanzhen
    on Jul 16, 2018
    Contributor
    More actions

    @chingor13 Jeff, this seems to be related to the changes you made to ServiceOptions. Would you mind taking a look?

  4. yihanzhen
    assigned
    chingor13
    on Jul 16, 2018
  5. yihanzhen
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    api: firestoreIssues related to the Firestore API.
    and removed
    triage meI really want to be triaged.
    on Jul 16, 2018
  6. andrewparmet commented on Jul 16, 2018

    @andrewparmet
    andrewparmet
    on Jul 16, 2018
    Author
    More actions

    From my investigation this was caused by a change in GrpcFirestoreRpc; I've opened a PR #3460 that does the "minimal thing" to get correct overriding behavior if that's the direction y'all want to go.

  7. yihanzhen commented on Jul 16, 2018

    @yihanzhen
    yihanzhen
    on Jul 16, 2018
    Contributor
    More actions

    cc/ @schmidt-sebastian

  8. yihanzhen
    unassigned
    chingor13
    on Jul 16, 2018
  9. pongad
    closed this as completedin #3472on Jul 16, 2018
  10. JustinBeckwith
    assigned
    pongad
    on Feb 1, 2021
  11. suztomo
    added a commit that references this issue on Mar 9, 2026

    chore(main): release 2.42.2-SNAPSHOT (#3458)

    fd67f50
  12. chingor13
    added 2 commits that reference this issue on Mar 24, 2026

    deps: update repo-automation-bots digest to 8b7d94b (#3458)

    a9acc11

    chore(main): release 2.51.1 (#3462)

    522d76d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @pongad
    pongad

Labels

api: firestoreIssues related to the Firestore API.authpriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.