Hi community
I am trying to auto-deploy my Vue.js app to Fireabse hosting, so I created a pipeline for that in my Bitbucket repo, with the following content, but the issue is right after building the app and deploying it to Firebase I get this error:
✖ Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
I am sure my access token is valid, as I generated it with login:ci .
Why am I getting an authentication error?
image: node
pipelines: default:
- step: name: Test
script: - npm install && npm test
- step:
name: Build
script: - npm install && npm run build
artifacts: - build/**
- step:
name: Deploy to Firebase deployment: production
script: -
pipe: atlassian/firebase-deploy:0.2.1
variables:
FIREBASE_TOKEN: $1XXXXXXXXXXXX
PROJECT_ID: $XXXXXXXXXXXXX
I recently had the same problem. Many others solved this by doing firebase logout and firebase login to refresh their credentials in the cli. I actually had to run firebase login:ci which regenerates a new TOKEN you can use in your project Bitbucket repo under Repository Settings > Repository Variables. I deleted my old token and just Created a new one with the new token and it worked again. Hope this helps if you haven't solved it yet.
Thanks alot for the answer. I saw this happen again to me today. Indeed regenerating a new TOKEN using $firebase login:ci helped.
Seems like the TOKEN gets expired after a few days (inactivity) maybe ?
Is there a way someone figured out, how to avoid this happening again ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as I know the token should not expire. I recently sent a push using the pipeline and everything seemed to be working still. I also keep my global firebase-tools updated on my pc, but that should only effect my working environment. There is a possibility of some updates occurring, like sometimes Bitbucket updates their templates we use to deploy to firebase hosting, etc. In 1 project I have the pipe for atlassian/firebase-deploy:0.3.4 and a newer project it is 1.2.0. But I doubt that has any effect on the TOKEN giving in the cli, that basically grants access to run the deploy. I googled for answers and still did found WHY that happens yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.