CircleCI-Public / cimg-postgres

MIT License
8 stars 25 forks source link

Bug Report: Permission error when using db example #96

Open hphu3 opened 1 year ago

hphu3 commented 1 year ago

Describe the bug We've configured the database according to the postgres testing example in the docs: https://circleci.com/docs/databases/#postgresql-database-testing-example

when running the image step, there is a could not change directory to "/home/circleci/project": Permission denied and Build was canceled

To Reproduce Clone the example config from the docs and create a new repo.

Expected behavior Expected the image to load without any errors

Workarounds The tests still seem to run, can this message be safely ignored?

Screenshots and Build Links Screen Shot 2023-06-30 at 2 35 03 PM

Here's our test repo: https://github.com/inventables/psql-test and the build: https://app.circleci.com/pipelines/github/inventables/psql-test/1/workflows/cba69c18-14c4-4627-a095-17007117e2b2/jobs/1

Additional context Add any other context about the problem here. The image has a WORKDIR /home/circleci/project command. I'm not sure what the reasoning is for it or if it's needed. https://hub.docker.com/layers/cimg/postgres/13.11/images/sha256-dd0031cb27d079e6bcfdbc3c73363246ace95ddad007257887d91c2cefe11a4d?context=explore

mlabarca commented 1 year ago

I'm having the same error, same 13.11 image, tests also passing.

TannerW commented 1 year ago

Any news on this? Ran into this problem myself

BytesGuy commented 1 year ago

Hi @hphu3 @mlabarca @TannerW is this actually causing build failures in your jobs?

From what I am seeing, the Build was cancelled is the standard error message for when secondary containers are torn down after the main containers work is complete. The error message is definitely not very easy to understand, but this is not an image specific issue - you would see the same for any image used in a secondary container as it is handled by the CircleCI platform itself.

The directory issue can also be safely ignored as there is no code checkout into the second container, it is simply exposing a service on the port. Unless this is actually causing build failures, it is not something we need to investigate.

aviemet commented 1 year ago

I'm glad I finally found this discussion so I know to ignore the permissions issue. My setup is failing and in trying to troubleshoot I've lost a good chunk of time trying to look into this. While it can safely be ignored, perhaps it can be addressed so that it isn't extra noise which sends people down the wrong path while troubleshooting. If not addressed, perhaps noted in the docs? Thank you

eternaltyro commented 1 year ago

I think the issue still warrants better log messages since it is hard to ignore this ominous message when the builds are failing. That the secondary image is being torn down because the primary image has completed it's job (or exited prematurely) should be made clear somewhere.

jaredbeck commented 4 months ago

In addition to the issues in the above comments, I found the following to be confusing: