json.decoder.JSONDecodeError when trying to run my pipeline

hanskokx April 23, 2021

I'm getting an error when trying to run my pipeline.  It's complaining about wanting a comma delimiter, but I don't know what file it's got a problem with.

Status: Downloaded newer image for bitbucketpipelines/firebase-deploy:1.0.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...
Traceback (most recent call last):
File "/main.py", line 170, in <module>
pipe.run()
File "/main.py", line 68, in run
data = json.load(f)
File "/usr/local/lib/python3.7/json/__init__.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 14 column 41 (char 312)

 

Here's my pipeline config:

image: cirrusci/flutter

pipelines:
branches:
main:
- step:
name: Run unit tests
script:
- flutter test
- step:
name: Build web
script:
- flutter build web
- step:
name: Deploy to Firebase
deployment: production
script:
- pipe: atlassian/firebase-deploy:1.0.0
variables:
PROJECT_ID: t4c-companion
KEY_FILE: $FIREBASE_KEY_FILE
DEBUG: 'true'

 

1 answer

1 accepted

0 votes
Answer accepted
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2021

@hanskokx this error means that your firebase.json does not satisfy json format. Check it out, perhaps, there is something you forgot to put or extra character. If you want , you also can share it here in the question.

You could make a mistake by forgetting , delimiter between list elements for example.

Example of firebase.json is (example is multisite, but you review your file according to your requirements):

{
"hosting": [
{
"target": "your-site",
"public": "public",
"ignore": ["firebase.json","**/.*","**/node_modules/**"]
},
{
"target": "your-site-2",
"public": "public",
"ignore": ["firebase.json", "**/.*","**/node_modules/**"]
}
]
}

 

Regards, Galyna

hanskokx April 26, 2021

I had a rogue comment in my json file - I bet that's what caused the problem.  I'm going to remove it and test again.  Good catch!

hanskokx April 26, 2021

I guess I'll have to wait a few days until I have more build minutes to know if that fixed it.  🤣

Like Halyna Berezovska likes this
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 29, 2021

@hanskokx I have to mention, that if you need more build minutes and often run out of free build minutes, you could upgrade your plan :)

Be aware , that the pricing paid for new plan is there in workspace settings and you can evaluate if this plan is worth for this current project you're working on.

You can also check full pricing list here https://support.atlassian.com/bitbucket-cloud/docs/manage-your-plan-and-billing/ .

Regards, Galyna

hanskokx May 4, 2021

This is the only time I've ran out of build minutes (because I was constantly testing CI/CD changes).  Since my app doesn't really make me any money, I haven't felt a strong desire to upgrade my plan to something paid. ;)

However, I can confirm that the invalid json (e.g., having a comment in the code) was the cause for failure.  We're all set now!

Like Halyna Berezovska likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events