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

can't get rid of "invalid project id" even with "firebase use --clear" #2203

Closed
hlynbech opened this issue May 4, 2020 · 4 comments · Fixed by #2204
Closed

can't get rid of "invalid project id" even with "firebase use --clear" #2203

hlynbech opened this issue May 4, 2020 · 4 comments · Fixed by #2204
Assignees
Labels
Needs: Author Feedback Issues awaiting author feedback type: bug

Comments

@hlynbech
Copy link

hlynbech commented May 4, 2020

[REQUIRED] Environment info

firebase-tools:
8.2.0

Platform:
MacOS 10.15.4
zsh 5.7.1 (x86_64-apple-darwin19.0)

[REQUIRED] Test case

(fails on any project)

[REQUIRED] Steps to reproduce

If accidentally running the use command with an invalid project id, like fxfirebase use . then the CLI gets stuck with the error "Error: Invalid project id: .." even if I try to run the command firebase use --clear. I have to specify some valid project id with --project= for even getting "--clear" to work.

$ firebase use .
Now using project .

$ firebase use --clear
Error: Invalid project id: ..

[REQUIRED] Expected behavior

firebase use --clear should not fail even if an invalid project id was (accidentally) specified previously with firebase use

Even better, firebase use should (maybe?) reject invalid project ids before making the id persistent. All commands seem to fail (even the ones that should alleviate this problem) if the project id is invalid.

[REQUIRED] Actual behavior

$ firebase use .
Now using project .

$ firebase --debug use --clear

Error: Invalid project id: ..
@bkendall
Copy link
Contributor

bkendall commented May 5, 2020

I've made a PR to prevent this in the future (I'm not 100% happy with the fix, but it'll fix it).

To fix your system, open the file ~/.config/configstore/firebase-tools.json with your favorite editor. Look for the activeProjects key, then find the file path that has the invalid project identifier as the value in that collection. Remove it (making sure it remains valid JSON - check the ending commas) and that should remove the issue.

@bkendall bkendall self-assigned this May 5, 2020
@bkendall bkendall added Needs: Author Feedback Issues awaiting author feedback type: bug labels May 5, 2020
@supfam
Copy link

supfam commented Jan 27, 2021

I've made a PR to prevent this in the future (I'm not 100% happy with the fix, but it'll fix it).

To fix your system, open the file ~/.config/configstore/firebase-tools.json with your favorite editor. Look for the activeProjects key, then find the file path that has the invalid project identifier as the value in that collection. Remove it (making sure it remains valid JSON - check the ending commas) and that should remove the issue.

can confirm, this is working ty

@10eputzen
Copy link

2024 and still happening to me

@clementolive
Copy link

Same problem.
I don't understand how to access the file ~/.config/configstore/firebase-tools.json
What does the first character represents ?
I tried changing projet name, changing in angular.json, restarting everything...no luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Issues awaiting author feedback type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants