Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Serverless deploy with plugins and dockerpip

Aakash Shah
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 9, 2022

I am unable to figure out why the serverless deploy is not going through.

 

This is the bibucket-pipeline.yml


options
:
docker: true

definitions:
services:
docker:
memory: 3072
pipelines:
branches:

dev:
- step:
services:
- docker
script:
- cp config.dev.ini config.ini
- pipe: atlassian/serverless-deploy:1.2.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_DEV
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_DEV
PRE_EXECUTION_SCRIPT: "my-script.sh"
 EXTRA_ARGS: "--verbose"
Error during serverless deploy
Installing requirements from "/root/.cache/serverless-python-requirements/1f8875b144ca0ef6448bc54adcda2143dac724167f52c31feeb3279ccc4a6bc1_x86_64_slspyc/requirements.txt"
Docker Image: lambci/lambda:build-python3.8
Using download cache directory /root/.cache/serverless-python-requirements/downloadCacheslspyc
Running docker run --rm -v /root/.cache/serverless-python-requirements/1f8875b144ca0ef6448bc54adcda2143dac724167f52c31feeb3279ccc4a6bc1_x86_64_slspyc\:/var/task\:z -v /root/.cache/serverless-python-requirements/downloadCacheslspyc\:/var/useDownloadCache\:z lambci/lambda\:build-python3.8 /bin/sh -c 'chown -R 0\\:0 /var/useDownloadCache && python3 -m pip install -t /var/task/ -r /var/task/requirements.txt --cache-dir /var/useDownloadCache && chown -R 0\\:0 /var/task && chown -R 0\\:0 /var/useDownloadCache && find /var/task -name \\*.so -exec strip \\{\\} \\;'...
Stdout:
Stderr: docker: Error response from daemon: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories.
See 'docker run --help'.
Environment: linux, node 16.17.0, framework 3.22.0 (local) 3.22.0v (global), plugin 6.2.2, SDK 4.3.2


Credentials: Local, environment variables

Docs: docs.serverless.com

Support: forum.serverless.com

Bugs: github.com/serverless/serverless/issues


Error:

Error: `docker run --rm -v /root/.cache/serverless-python-requirements/1f8875b144ca0ef6448bc54adcda2143dac724167f52c31feeb3279ccc4a6bc1_x86_64_slspyc:/var/task:z -v /root/.cache/serverless-python-requirements/downloadCacheslspyc:/var/useDownloadCache:z lambci/lambda:build-python3.8 /bin/sh -c chown -R 0\:0 /var/useDownloadCache && python3 -m pip install -t /var/task/ -r /var/task/requirements.txt --cache-dir /var/useDownloadCache && chown -R 0\:0 /var/task && chown -R 0\:0 /var/useDownloadCache && find /var/task -name \*.so -exec strip \{\} \;` Exited with code 125

at ChildProcess.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/child-process-ext/spawn.js:38:8)

at ChildProcess.emit (node:events:513:28)

at ChildProcess.emit (node:domain:489:12)

at maybeClose (node:internal/child_process:1093:16)

at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

serverless.yml

custom:

pythonRequirements:

pythonBin: python3

dockerizePip: true

slim: true

useDownloadCache: true

useStaticCache: true

Any help would be very much appreciated. It loks like its because of useDownloadCache or this could be it - $BITBUCKET_CLONE_DIR and its subdirectories.

 

 

2 answers

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 16, 2022

@Aakash Shah hi. Could your share also your pre-execution script?

 

Regards, Igor

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 11, 2022

Hey @Aakash Shah 

Welcome to the community.

I believe the error is related to the execution permission of the script. As mentioned in the documentation here if you pass a hook script, the script should have at least read and execution permission. 

I would suggest changing the script permission with the following step:

  - chmod 005 my-script.sh
  - pipe: atlassian/serverless-deploy:1.2.0
    variables:
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
      PRE_EXECUTION_SCRIPT: '.my-script.sh'

Cheers,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events