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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
Community Groups

How to deal with spaces using AWS S3 integration in Bitbucket Pipelines?


I am running the aws s3 integration pipeline:

pipe: atlassian/aws-s3-deploy:1.1.0
EXTRA_ARGS: '--metadata={"style-src":"self inline"}'

It seems the space is not being process properly because I get:
awscli.argprocess.ParamError: Error parsing parameter '--metadata': Invalid JSON: Unterminated string starting at: line 1 column 75 (char 74)
JSON received: {"style-src":"self


I have tried different quotes arrangements and also tried the shorthand syntax:

EXTRA_ARGS: '--metadata=style-src=self inline'

The error being:

awscli.customizations.exceptions.ParamValidationError: Unknown options: inline


I did simplify the pipeline for readability, but it is longer and all previous arguments in EXTRA_ARGS were accepted, so I do not believe there are other problems besides the space.

Any suggestion is appreciated, thanks in advance.

2 answers

1 accepted

To whoever may be relevant.

The solution we ended up using in the end is to provide the metadata from an external file and decode it in the pipeline:

- export CSP_POLICY_B64=$(grep -v "^\s*#" default.csp | tr '\n' ' ' | tr -d '\r' | base64 --wrap=0)
- pipe: atlassian/aws-s3-deploy:1.1.0
EXTRA_ARGS: '--metadata cf-csp-b64=$CSP_POLICY_B64'

 In the above example, a default.csp file has been provided on the root of the project. The contents looks like so:

# This file is parsed by bitbucket-pipelines so it can contain
# commented lines starting with a # and newlines are formatted
# to a space when deploying.
style-src 'self' 'unsafe-inline';

Hi @Oscar Navarrerete Estévez 

Thank you for your question!

Could you try this:

pipe: atlassian/aws-s3-deploy:1.1.0
EXTRA_ARGS: "--metadata '{\"x-amz-meta-cms-id\":\"34533452\"}'"


Best regards,
Oleksandr Kyrdan

Hello @o_kyrdan ,

Thank you for your answer, but we solved the problem in the answer I provided.

For the record I did try your suggestion, and I got this error:

2022-05-30 08:00:43,481 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
File "awscli/", line 335, in _parse_as_shorthand
File "awscli/", line 166, in parse
File "awscli/", line 171, in _parameter
File "awscli/", line 190, in _keyval
File "awscli/", line 349, in _expect
awscli.shorthand.ShorthandParseSyntaxError: Expected: '=', received: ''' for input:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "awscli/", line 459, in main
File "awscli/customizations/", line 197, in __call__
File "awscli/customizations/", line 164, in __call__
File "botocore/", line 672, in emit_first_non_none_response
File "botocore/", line 227, in emit
File "botocore/", line 210, in _emit
File "awscli/", line 313, in __call__
File "awscli/", line 338, in _parse_as_shorthand
awscli.argprocess.ParamError: Error parsing parameter '--metadata': Expected: '=', received: ''' for input:

Error parsing parameter '--metadata': Expected: '=', received: ''' for input:

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events