5

My error when using firebase init --debug

[2019-01-28T05:32:18.956Z] Error Context: {
  "body": {
"error": {
  "code": 403,
  "message": "The caller does not have permission",
  "status": "PERMISSION_DENIED"
}
},
"response": {
"statusCode": 403,
"body": {
  "error": {
    "code": 403,
    "message": "The caller does not have permission",
    "status": "PERMISSION_DENIED"
  }
},
"headers": {
  "vary": "X-Origin, Referer, Origin,Accept-Encoding",
  "content-type": "application/json; charset=UTF-8",
  "date": "Mon, 28 Jan 2019 05:32:18 GMT",
  "server": "ESF",
  "cache-control": "private",
  "x-xss-protection": "1; mode=block",
  "x-frame-options": "SAMEORIGIN",
  "x-content-type-options": "nosniff",
  "alt-svc": "quic=\":443\"; ma=2592000; v=\"44,43,39\"",
  "accept-ranges": "none",
  "transfer-encoding": "chunked"
},
"request": {
  "uri": {
    "protocol": "https:",
    "slashes": true,
    "auth": null,
    "host": "firebase.googleapis.com",
    "port": 443,
    "hostname": "firebase.googleapis.com",
    "hash": null,
    "search": null,
    "query": null,
    "pathname": "/v1beta1/projects/young-picasso",
    "path": "/v1beta1/projects/young-picasso",
    "href": "https://firebase.googleapis.com/v1beta1/projects/young-picasso"
  },
  "method": "GET"
  }
}
}

How can I change the path of project to the one that i am currently using? I am currently working on project in different account but the path shown is the project of previous account. Currently it shows young picasso but my project path is different in another account. I am new on firebase cli and I dont know how to fix this, how can I fix this?

Also, firebase list command shows my project that i am currently working as current and permission type is owner. I also have already used command firebase -login --reauth to change from previous account to another account.

6 Answers6

5

I solved this by delete this file .firebaserc .

Steps:

  1. Find file .firebaserc at Your Application Folder.
  2. Delete it.
  3. Try again at CMD. firebase init

Good luck

Ticherhaz FreePalestine
  • 2,738
  • 4
  • 20
  • 46
3

To me, I was using the wrong Google Account, to solve I used the command firebase logout, and after firebase login

Rodrigo João Bertotti
  • 5,179
  • 2
  • 23
  • 34
2

Delete the two files, .firebaserc and firebase.json Then redo the process it will fix it.

1

Now you can do this only online because you need to accept terms and conditions to get permission.

link to page: https://console.firebase.google.com/

Panda
  • 79
  • 2
0

Re-installing the firebase-tools on npm worked! However, if anybody know how to fix the project scope without re-installing npm firebase-tools then please let me know.

0

Deleting the [hidden] .firebaserc file, (that's generated via the Firebase CLI tool), should solve the issue for most people, although as previously mentioned, you may need to delete the .firebase.json file too.

However, Firebase will still look for this file, so you'll need to have one. The file is very minimal, lives in the root of your project, and looks like this, (in it's entirety):

{
  "projects": {
    "default": "my-project-id"
  }
}

I experienced this error, when I had previously run $ firebase init on two very similar test apps, and later decided to merge aspects of one app into the other, but hadn't kept the correct .firebaserc file, which meant I had the incorrect 'Project ID' in the aforementioned file.

Why does this matter? The .firebaserc contains the primary Firebase Project ID: xxxxxxxxxx, which can be found via your Firebase console under Project Overview > Settings. If the ID in the file doesn't reflect your Firebase 'Project ID', Firebase will reject any of your requests.