I have a Bitbucket pipeline running integration tests. For the pipeline I built an image upon python:3.11-alpine using aws-sam-cli==1.115.0. I pushed the built image to a doctl registry, then I reference the image in my pipelines yaml configuration file.
image:
name: registry.digitalocean.com/myuri
After this I built my template, then ran sam local start-api
with correct parameters. Then I run a bash script which seeds the database, then in a node environment I run exported Postman collections with newman.
Node: 21.7.2
Newman: 5.2.0
What is strange to me is that the first few Lambda invocations are successful, then after a few requests I get the following exception:
samcli.commands.local.cli_common.user_exceptions.DockerDistributionAPIError: 403 Client Error for http://localhost:2375/v1.35/distribution/public.ecr.aws/lambda/python:3.11-x86_64/json: Forbidden ("authorization denied by plugin pipelines: ")
I’m upgrading from python3.9 and along with it I also need to update my lambda layers. So I updated from psycopg2.5 to 2.9.9. I don’t think that should have an affect on this problem tho. Reverting my changes and using my earlier – python3.9 – image solves the pipeline issue.
I tried running the test locally and everything works fine there too.