FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve error message thrown when missing permission to deploy to hosting by aalej · Pull Request #7490 · firebase/firebase-tools · GitHub

Improve error message thrown when missing permission to deploy to hosting - #7490

Merged
joehan merged 5 commits into
masterfrom
aalej-7190
Jul 30, 2024
Merged

Improve error message thrown when missing permission to deploy to hosting#7490
joehan merged 5 commits into
masterfrom
aalej-7190

Conversation

aalej commented Jul 24, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Description

Fixes #7190

Scenarios Tested

Using the test case provided in #7190

  1. Set GOOGLE_APPLICATION_CREDENTIALS to a service account key that does not have access to the project used in the next command
  2. Try to run firebase deploy --project invalid-project-name-2358923 --only hosting --non-interactive
$ firebase logout
No need to logout, not logged in
$ echo $GOOGLE_APPLICATION_CREDENTIALS
./service-account-invalid.json
$ firebase deploy --project invalid-project-name-2358923 --only hosting --non-interactive

Error: Failed to get Firebase project invalid-project-name-2358923. Please make sure the project exists and your account has permission to access it.

Using an logged in account deploying to a project it has no access to

$ firebase login
Already logged in as EMAIL
Using Google Analytics in DEBUG mode. Emulators (+ UI) events will be shown in GA Debug View only.
$ firebase deploy --project invalid-project-name-2358923 --only hosting --non-interactive
Using Google Analytics in DEBUG mode. Emulators (+ UI) events will be shown in GA Debug View only.

Error: Failed to get Firebase project invalid-project-name-2358923. Please make sure the project exists and your account has permission to access it.

Note: Using a valid service-account and project

$ firebase logout
No need to logout, not logged in
$ echo $GOOGLE_APPLICATION_CREDENTIALS
./service-account-valid.json
$ firebase deploy --project PROJECT_ID --only hosting --non-interactive

=== Deploying to 'PROJECT_ID'...

i  deploying hosting
i  hosting[PROJECT_ID]: beginning deploy...
i  hosting[PROJECT_ID]: found 2 files in public
i  hosting: uploading new files [0/1] (0%)
i  hosting: upload complete
✔  hosting[PROJECT_ID]: file upload complete
i  hosting[PROJECT_ID]: finalizing version...
✔  hosting[PROJECT_ID]: version finalized
i  hosting[PROJECT_ID]: releasing new version...
✔  hosting[PROJECT_ID]: release complete

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/PROJECT_ID/overview
Hosting URL: https://PROJECT_ID.web.app

Sample Commands

joehan self-requested a review July 24, 2024 21:32

aalej commented Jul 26, 2024

Copy link
Copy Markdown
Contributor Author

Oops, didn’t realize I put the wrong log messages in the initial comment. Updated it from

Error: Assertion failed: resolving hosting target of a site with no site name or target name. This should have caused an error earlier

to

Error: Failed to get Firebase project invalid-project-name-2358923. Please make sure the project exists and your account has permission to access it.

joehan requested a review from kmcnellis July 26, 2024 21:59
joehan enabled auto-merge (squash) July 30, 2024 18:05
joehan merged commit 6004e0d into master Jul 30, 2024
aalej deleted the aalej-7190 branch March 25, 2025 14:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running firebase deploy with service account and missing permission errors with "Assertion failed"

4 participants


Back | FazBrowse Home | New Git URL