Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,016
Community Members
 
Community Events
176
Community Groups

BitBucket Firebase Pipeline error

Edited

I'm getting a strange error when I get to the deploy step of firebase.

The config (/bitbucket-pipeline.yaml) steps look like this...

image: node:16

pipelines:
branches:
dev:
- step:
name: Setup
caches:
- node
script:
- npm install
- step:
name: Build
caches:
- node
script:
- npm run build:dev
artifacts:
- build/**
- step:
name: Deploy
caches:
- node
deployment: staging
script:
- pipe: atlassian/firebase-deploy:1.3.0
variables:
PROJECT_ID: $FIREBASE_PROJECT_ID
KEY_FILE: $FIREBASE_PRIVATE_KEY
DEBUG: "true"

The (/package.json) file looks something like this (hopefully this is all the relevant parts)...

{
...
"engines": {
"node": 16
},
...
"dependencies": {
...
"firebase": "^9.6.1",
...
"react-scripts": "5.0.0",
...
},
"scripts": {
...
"build:dev": "env-cmd -f .env.development react-scripts build",
...
}
}

The deployment error looks like this...

Status: Downloaded newer image for bitbucketpipelines/firebase-deploy:1.3.0
DEBUG: Starting new HTTPS connection (1): bitbucket.org
DEBUG: https://bitbucket.org:443 "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/1.1" 200 None
INFO: Executing the pipe...
INFO: Current NodeJS version:
installing : node-v12.22.12
mkdir : /usr/local/n/versions/node/12.22.12
fetch : https://nodejs.org/dist/v12.22.12/node-v12.22.12-linux-x64.tar.gz
installed : v12.22.12 (with npm 6.14.16)
Traceback (most recent call last):
File "/main.py", line 170, in <module>
pipe.run()
File "/main.py", line 108, in run
key_content = base64.b64decode(key_file)
File "/usr/local/lib/python3.7/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

I can't see anything out of the ordinary. Could anyone please point me at what might be wrong?

1 answer

1 accepted

1 vote
Answer accepted

Hi @RobT

Looks like the KEY_FILE encoding error.

The KEY_FILE should be base64 encoded content of Key file for a Google service account. To encode this content, follow encode private key docs.

 

Linux

$ base64 -w 0 < my_gcp_key

Mac OS X

$ base64 < my_gcp_key

 

More details about firebase-deploy pipe you could find in the Readme.

 

Best regards,
Oleksandr Kyrdan

Thank you @o_kyrdan , that was exactly it. I missed the base64 part. Silly mistake.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events