I've just encountered an error that when I run a pipeline for testing and linting a Django project. The full error is
Error response from daemon: authorization denied by plugin pipelines: --mounts is not allowed
As stated I have added in - export DOCKER_BUILDKIT=0 to my script steps. I added this in initially because I was getting a different error which was fixed by adding in - export DOCKER_BUILDKIT=0. I then added some test cases to my code and re-ran the pipeline to check if they were working. And this new error has been appearing.
Things I have already tried:
Here is the code for my bitbucket-pipelines.yml:
image: atlassian/default-image:4
options:
docker: true
pipelines:
default:
- parallel:
- step:
name: Test Code
script:
- export DOCKER_BUILDKIT=0
- docker-compose run --rm app sh -c "python manage.py test"
- step:
name: Lint Code
script:
- export DOCKER_BUILDKIT=0
- docker-compose run --rm app sh -c "flake8"
Please let me know if anything else is necessary.
I'm just at a bit of a loss as to what is causing this. Is anyone experiencing the same issue? Or has a fix for this?
Thanks
G'day William!
Thank you for contacting Bitbucket Cloud Support.
To clarify - once you implemented the fix, were your builds running okay for a time before you saw this new error?
As per our documentation, the mount command is not permitted for security reasons - but I can't see this command in the YML you provided (see Running docker commands heading):
Cheers!
- Ben (Bitbucket Cloud Support)
Hi Ben,
Thanks for the response.
Yes I implemented the fix to include
- export DOCKER_BUILDKIT=0
I then had about three pipelines run correctly before they suddenly started failing.
I then reverted the repo to when the pipelines were running to check that the changes to my code weren't causing the issue. However, even after reverting back the pipelines would still fail.
Thanks for any more information on this,
William
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi William,
Please add the following command before you execute the docker-compose command, I have a feeling there is an issue with the version of docker-compose that is included as part of the base image:
curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
Once you have included this command, please execute a fresh build and let me know how it goes.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ben,
image: atlassian/default-image:4
options:
docker: true
pipelines:
default:
- parallel:
- step:
name: Test Code
script:
- export DOCKER_BUILDKIT=0
- curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
- docker-compose run --rm app sh -c "python manage.py wait_for_db && python manage.py test"
- step:
name: Lint Code
script:
- export DOCKER_BUILDKIT=0
- curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
- docker-compose run --rm app sh -c "flake8"
So I've updated my bitbucket-pipelines.yaml to look like this. Unfortunately, I am still getting the:
Error response from daemon: authorization denied by plugin pipelines: --mounts is not allowed
Any Ideas?
Thanks,
Will
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Will,
Please allow me to step in as Ben is out of office.
We would need to check the build logs to figure out why the error occurs. I would recommend creating a ticket with the support team to investigate this further. If we have an open support ticket, the engineer working on it will be able to access the repo and build logs and troubleshooting should be faster.
You can create a ticket via https://support.atlassian.com/contact/#/, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. Please make sure to provide in the ticket description the URL of a failed build and also of a previously successful build. The support ticket will be visible only to you and Atlassian staff, so anything you post in the ticket won't be publicly visible.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anything found here guys? I've run into the same error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. In the end I had to add in the directory names of the volumes I was using into the repository
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.