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 no longer run emulators with --project=dummy #5170

Open
athoma13 opened this issue Oct 25, 2022 · 17 comments · Fixed by #5780
Open

Can no longer run emulators with --project=dummy #5170

athoma13 opened this issue Oct 25, 2022 · 17 comments · Fixed by #5780
Assignees

Comments

@athoma13
Copy link

In Version 11.13.0 of firebase-tools (and previous versions), I was able to launch the emulator with
firebase emulators:start --import my-backup --inspect-functions --project=dummy

Since upgrading to 11.15.0, I get
Error: Deploy target xxx not configured for project dummy. Configure with...
(where xxx is a real deployment target).

I don't want the emulators to start with the same project name as a 'real' project (as I was doing previously)...

@akauppi
Copy link

akauppi commented Oct 25, 2022

Have you tried demo-dummy?

Somewhere in the documentation, Firebase mentions that any locally used projects should be named demo-{something}. This ensures they are not intertwined with the actual Firebase projects online.

@athoma13
Copy link
Author

athoma13 commented Oct 27, 2022 via email

@ludwig432
Copy link

Yes I experience the same. Although I've used a dummy project name that was not corresponding to a real Firebase project. So that without the demo- prefix (as I've had it previously) I now get
Error: Failed to get Firebase project dummy.

With the demo- prefix same as @athoma13.

@ruben-sch
Copy link

I have the same issue. Is there an update on this? @athoma13 @ludwig432 did you find any workaround?

@christhompsongoogle
Copy link
Contributor

Please include a full set of repro instructions so we can track this down:

firebase.json
Which projects are initialized
Full output with --debug flag emabled

Thank you

@christhompsongoogle christhompsongoogle self-assigned this Dec 5, 2022
@norkje
Copy link

norkje commented Dec 14, 2022

I have created a simple sample project that showcases the issue between two versions of firebase-tools.

https://github.com/norkje/firebase-tools-5170

@christhompsongoogle
Copy link
Contributor

christhompsongoogle commented Dec 16, 2022

Thank you norkje that's helpful. I narrowed down the issue to this line in the hosting config: "target": "public"

The actual error is being thrown inside of rc.ts

@athoma13
Copy link
Author

athoma13 commented Feb 15, 2023

Sorry been away... I can confirm that @norkje repo accurately depicts my issue too. Thank you so much for posting!
additional: Still happening in version 11.23.1

@gugahoi
Copy link

gugahoi commented Feb 20, 2023

This is a pretty annoying problem. I've found out this was introduced on v11.14.2 so rolling back to v11.14.1 makes the emulators work again.

npm i -g firebase-tools@11.14.1

@gugahoi
Copy link

gugahoi commented Feb 20, 2023

To further help in finding the fix, the debug logs when running the emulator fail after a call to firebase gets a 403. This is the relevant info I guess:

[2023-02-20T23:54:12.138Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux [none]
[2023-02-20T23:54:13.132Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux 403
[2023-02-20T23:54:13.132Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux {"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED"}}
[2023-02-20T23:54:13.133Z] HTTP Error: 403, The caller does not have permission

I have no idea why this call would be attempted as the logs correctly identify that this is a demo project

i  emulators: Detected demo project ID "demo-flux", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail. {"metadata":{"emulator":{"name":"hub"}
,"message":"Detected demo project ID \"demo-flux\", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail."}}

@bkendall bkendall assigned joehan and unassigned bkendall Mar 7, 2023
@gugahoi
Copy link

gugahoi commented May 2, 2023

This is completely blocking me from updating to newer versions of the Firebase CLI. Given this seems to be a regression and there are 0 instructions on what the correct process is to rectify this problem, it's quite disappointing that it's not been given any attention in quite some time. Is there anything that can be done regarding this? What are the instructions for using local only projects (demo-...) with the emulators?

@gugahoi
Copy link

gugahoi commented May 4, 2023

@joehan thanks for submitting a fix, I've tried the latest version and I am still having problems. It is still failing on the same request as above:

[2023-05-04T00:58:26.669Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux [none]
[2023-05-04T00:58:27.232Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux 403
[2023-05-04T00:58:27.233Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux {"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED"}}
[2023-05-04T00:58:27.235Z] HTTP Error: 403, The caller does not have permission

And to make sure it is using the correct version, I created an npm task to print the output of firebase --version:

❯ npm run version

> version
> firebase --version

11.30.0

@joehan
Copy link
Contributor

joehan commented May 4, 2023

Looks like I missed somewhere we're making a prod call - reopening this.

@gugahoi
Copy link

gugahoi commented May 9, 2023

Soo sorry to do this again but the problem still stands. Am I doing something wrong?

❯ npm run version

> version
> firebase --version

12.0.0
[2023-05-09T23:32:14.720Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"storage"},"message":"Ignoring unsupported arg: port"}}
[2023-05-09T23:32:15.125Z] Temp file directory for storage emulator: /var/folders/nm/9bwr1b6554z0gw080h83_2g00000gn/T/firebase/storage/blobs {"metadata":{"emulator":{"name":"storage"},"message":"Temp file directory for storage emulator: /var/folders/nm/9bwr1b6554z0gw080h83_2g00000gn/T/firebase/storage/blobs"}}
[2023-05-09T23:32:15.129Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux [none]
[2023-05-09T23:32:15.948Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux 403
[2023-05-09T23:32:15.948Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux {"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED"}}
[2023-05-09T23:32:15.949Z] HTTP Error: 403, The caller does not have permission

If you can point me in the right direction I'd be more than happy to try to fix it but I have no knowledge of the codebase so it's an uphill battle for me.

@ludwig432
Copy link

ludwig432 commented Jun 18, 2023

Ran back into this issue as I had to update the Firebase CLI to be able to use Python Cloud Functions...

No idea what exactly I'm doing here but it was a workaround to add the demo-myapp-development project to .firebaserc and just list all hosting targets from firebase.json in there (which in fact doesn't make much sense I feel).

But it resulted in the emulator being happy as it could now serve the hosting files for those targets:

i  hosting[app-staging]: Serving hosting files from: webapp-vue/dist/
✔  hosting[app-staging]: Local server: http://127.0.0.1:5000
i  hosting[app-production]: Serving hosting files from: webapp-vue/dist/
✔  hosting[app-production]: Local server: http://127.0.0.1:5006

So for example:

// firebase.json

{
//...
"hosting": [
    {
      "target": "app-staging",
      "public": "webapp-vue/dist/",
     //...
    },
    {
      "target": "app-production",
      "public": "webapp-vue/dist/",
      //...
    },
  ],
//...
}
// .firebaserc

{
  "projects": {
    "development": "demo-myapp-development",
    "staging": "myapp-staging",
    "production": "myapp-production",
  },
  "targets": {
    "demo-myapp-development": { // This entry is what I needed to add
      "hosting": {
        "app-staging": [
          "app-myapp-staging"
        ],
        "app-production": [
          "app-myapp-production"
        ]
      }
    },
    "myapp-staging": {
      "hosting": {
        "app-staging": [
          "app-myapp-staging"
        ]
      }
    },
    "myapp-production": {
      "hosting": {
        "app-production": [
          "app-myapp-production"
        ]
      }
    }
  }
}

@gugahoi
Copy link

gugahoi commented Jan 2, 2024

It's 2024 and this is still a problem, I can't believe this regression has been ignored for this long! Running the latest version of the emulators still yields issues:

[2024-01-02T02:04:47.248Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux [none]
[2024-01-02T02:04:47.807Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux 403
[2024-01-02T02:04:47.807Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/demo-flux {"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED"}}
[2024-01-02T02:04:47.808Z] HTTP Error: 403, The caller does not have permission

Please, can you document the correct way to use "demo" projects? You seem to recommend the usage of "demo" projects but have ignored this for over a year and still have not found a way to move forward. How disappointing.

image

@joehan
Copy link
Contributor

joehan commented Jan 2, 2024

Hey @gugahoi - apologies for the slow response here, looks like I missed your last response. It looks like there must be another leaky call from the emulators. Could you provide a full debug log for the failed run so that I can see where in the code this failed call is coming from?

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 a pull request may close this issue.

10 participants