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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Error Writing results to file using aws pipe in pipeline

When running the aw-lambda-deploy pipe I am seeing the following error, the lambda is being updated.

 

INFO: Update command succeeded.
INFO: Writing results to file /opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/aws-lambda-deploy-env.
//update-lambda.sh: line 22: /opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/aws-lambda-deploy-env: Permission denied

I thought it may be memory related so increased the size of the step but continue to see the issue, this worked previously when I had less steps.

 

The failing pipeline.yml file is:

pipelines:
default:
- step:
name: Testing
caches: # Marks what will be in cache so it is not downloaded again.
- pip
script: # Modify the commands below to build your repository.
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- make coverage
- pwd
- ls -list
- step:
name: Sonar Scan
caches:
- sonar
script:
- pipe: sonarsource/sonarcloud-scan:1.0.1
variables:
EXTRA_ARGS: '-Dsonar.test.inclusions="**/*_test.py" -Dsonar.verbose=true'
- pipe: sonarsource/sonarcloud-quality-gate:0.1.3
- step:
name: Build Lambda
size: 2x
script:
# Build Lambda
- make archive
# Update lambda code and publish a new version
- pipe: atlassian/aws-lambda-deploy:0.5.3
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
FUNCTION_NAME: 'bucket-antivirus-function-dev' 
COMMAND: 'update'
ZIP_FILE: 'build/lambda.zip'

 

If I run the Build Lambda step alone then it works.

 

I tried the workaround on this question but the file dos not exist so cannot be removed.

 

Any tips appreciated.

2 answers

See the answer to this question https://community.atlassian.com/t5/Bitbucket-Pipelines-questions/aws-lambda-deploy-pipe-how-to-fix-aws-lambda-deploy-env/qaq-p/1547049#U1548195 

If you delete the shared location directory before running the lambda deploy pipeline then everything works as expected. 

Still would be good to know why the sonarcloud pipes prevent other pipes from writing to that shared location 

0 votes

@John C  I have some questions to define the root cause:

* did it work previously with the same version?
* what exactly steps did you add since the time it worked? Could the be the reason of failure? Are you doing something specific with BITBUCKET_PIPE_SHARED_STORAGE_DIR directory in those added steps?

* You can add  to your pipeline each step one by one (except of lambda deploy pipeline) to define, what exactly is failing permissions to that directory

 

Looking fowrard to hearing from you again.

Regards, Galyna

Thanks Galyna,

I manged to narrow this down to the sonarcloud pipes.  If I remove the sonar step then the pipelines work, if I run the sonar step alone as a manual pipeline then that works.  I haven;t spent much time looking further into this as this repo is not particularly active and does not require the sonar scan of every action so we simply separated it out.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

824 views 17 21
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you