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

Error: HTTP Error: 403, Unknown Error #641

Closed
kimown opened this issue Jan 28, 2018 · 12 comments
Closed

Error: HTTP Error: 403, Unknown Error #641

kimown opened this issue Jan 28, 2018 · 12 comments

Comments

@kimown
Copy link

kimown commented Jan 28, 2018

Version info

3.17.4

Steps to reproduce

OS X 10.12.6
node -v

v8.9.3

tree .

.
|-- firebase.json
`-- public
    `-- index.html

1 directory, 2 files

ls -a

.firebaserc	firebase.json	public

Then I run firebase deploy,

image

Expected behavior

Actual behavior

@mbleigh
Copy link
Contributor

mbleigh commented Jan 29, 2018 via email

@kimown
Copy link
Author

kimown commented Jan 29, 2018

@mbleigh

firebase deploy --debug

=== Deploying to 'fir-demo-project'...

i  deploying hosting
i  hosting: preparing public directory for upload...
[2018-01-29T01:53:16.132Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/fir-demo-project/uploads/-L3zb_9i-Z15MlRlbtCs?fileCount=1&message=  
  
 Mon Jan 29 2018 09:53:16 GMT+0800 (CST)
[2018-01-29T01:53:17.738Z] <<< HTTP RESPONSE 403 server=nginx, date=Mon, 29 Jan 2018 01:53:17 GMT, content-type=application/json; charset=utf-8, content-length=89, connection=close, access-control-allow-origin=*, access-control-allow-methods=GET, PUT, POST, DELETE, OPTIONS, strict-transport-security=max-age=31556926; includeSubDomains; preload, x-content-type-options=nosniff
[2018-01-29T01:53:17.738Z] <<< HTTP RESPONSE BODY code=403, message=The caller does not have permission, status=PERMISSION_DENIED

Error: HTTP Error: 403, Unknown Error
[2018-01-29T01:53:17.741Z] Error Context: {
  "body": {
    "code": 403,
    "message": "The caller does not have permission",
    "status": "PERMISSION_DENIED",
    "error": {
      "message": "Unknown Error"
    }
  },
  "response": {
    "statusCode": 403,
    "body": {
      "code": 403,
      "message": "The caller does not have permission",
      "status": "PERMISSION_DENIED",
      "error": {
        "message": "Unknown Error"
      }
    },
    "headers": {
      "server": "nginx",
      "date": "Mon, 29 Jan 2018 01:53:17 GMT",
      "content-type": "application/json; charset=utf-8",
      "content-length": "89",
      "connection": "close",
      "access-control-allow-origin": "*",
      "access-control-allow-methods": "GET, PUT, POST, DELETE, OPTIONS",
      "strict-transport-security": "max-age=31556926; includeSubDomains; preload",
      "x-content-type-options": "nosniff"
    },
    "request": {
      "uri": {
        "protocol": "https:",
        "slashes": true,
        "auth": null,
        "host": "deploy.firebase.com",
        "port": 443,
        "hostname": "deploy.firebase.com",
        "hash": null,
        "search": "?fileCount=1&message=",
        "query": "fileCount=1&message=",
        "pathname": "/v1/hosting/fir-demo-project/uploads/-L3zb_9i-Z15MlRlbtCs",
        "path": "/v1/hosting/fir-demo-project/uploads/-L3zb_9i-Z15MlRlbtCs?fileCount=1&message=",
        "href": "https://deploy.firebase.com/v1/hosting/fir-demo-project/uploads/-L3zb_9i-Z15MlRlbtCs?fileCount=1&message="
      },
      "method": "PUT"
    }
  }
}

firebase list

firebase list
┌─────────────────────────────────┬───────────────────────┬─────────────┐
│ Name                            │ Project ID / Instance │ Permissions │
├─────────────────────────────────┼───────────────────────┼─────────────┤
│ Firebase Demo Project (current) │ fir-demo-project      │ Viewer      │
├─────────────────────────────────┼───────────────────────┼─────────────┤
│ example                         │ example-7630b         │ Owner       │
└─────────────────────────────────┴───────────────────────┴─────────────┘

I think problem is the Viewer permission?

I am following this tutorial:https://firebase.google.com/docs/hosting/quickstart

@mbleigh
Copy link
Contributor

mbleigh commented Jan 29, 2018

Yes, you won't be able to deploy to a project you only have "viewer" permission on. You should be able to deploy by doing:

firebase use example-7630b
firebase deploy

@mbleigh mbleigh closed this as completed Jan 29, 2018
@kimown
Copy link
Author

kimown commented Jan 29, 2018

@mbleigh

Thanks ^_^

@jameskip
Copy link

jameskip commented Jan 2, 2020

I had a similar issue. I was actually signed into a different Firebase account in my CLI. After running firebase logout and firebase login with the correct Firebase account it worked fine.

@dinhnhat0401
Copy link

@mbleigh 's comment helped me to figure out what happened.
I have already logged in with firebase but using another account.
So I need to log out using: firebase logout
Then firebase login again with the appropriate account.
And after that, I want to use firebase projects:list to list up all projects belong to this user.

@jefelewis
Copy link

I had a similar issue. I was actually signed into a different Firebase account in my CLI. After running firebase logout and firebase login with the correct Firebase account it worked fine.

This worked for me. Thank you!

@GeorgeShao
Copy link

Had the same issue, but restarting my computer then doing firebase login worked for me. Thanks!

@Namaskar-1F64F
Copy link

Just retrying worked for me 🤷

@KillDozerX2
Copy link

I had the same issue. But I had actually not provisioned Functions in the Management Console. All I had to do was go to the console > Cloud Functions and click on Get Started and finish the prompt.

@whalemare
Copy link

For my case was be little harder to find solution, but I did it:

Last day ago, I was rename typo in my project name (ex. from my-prodject to my-project)
After that, I trying to deploy functions, but it crashed all the time with errors described above. So here the fix:

firebase use --clear - for clearing all project aliases
firebase use --add - for selection project in dropdown inside CLI

Select your project and type something for create alias, prod for example

After that, file .firebaserc was be regenerated and you can firebase deploy (I need rerun in several times)

@ranajahanzaib
Copy link

In my case, it was because the Firebase CLI didn't have the necessary permissions to access the repo in the GitHub org. This is required to enable CI/CD with GitHub Actions. In order for Firebase CLI to store secrets to repo/org, you must grant GitHub org access. You can do so by going to the Authorized OAuth Apps tab in Settings/Applications and granting permission there.

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

No branches or pull requests

10 participants