Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no such file or directory for mounted secrets in container #1913

Closed
thilagak opened this issue May 18, 2023 · 5 comments
Closed

no such file or directory for mounted secrets in container #1913

thilagak opened this issue May 18, 2023 · 5 comments
Labels

Comments

@thilagak
Copy link

Hi,

I am using docker volume to mount secret files into container volume and accessing it using the environment variable. Benthos process alway reports "no such file or directory" error though the files exist with right permissions and I am able to run system commands like ls, etc., on those files. Have no clue what could be the issue.

Greatly appreciate any help.

Regards
Thilaga

@Jeffail
Copy link
Member

Jeffail commented May 19, 2023

Hey @thilagak, are you able to share some sort of reproducible example? Otherwise all we can do is speculate on our side.

@thilagak
Copy link
Author

Hi @Jeffail ,

I have all my secrets in relative path of ./certificates folder and below is my docker run:
docker run -d --rm -p 4195:4195 -v certificates:/etc/secrets --env-file ./env.list --name benthos -c /pipeline/config.yaml

But benthos reports "no such file or directory" though i see the files exist inside container with read/execute permissions.

Please let me know if you need more details.

@mihaitodor
Copy link
Member

I have all my secrets in relative path of ./certificates folder and below is my docker run:
docker run -d --rm -p 4195:4195 -v certificates:/etc/secrets --env-file ./env.list --name benthos -c /pipeline/config.yaml

Docker volume mounts don't work with relative paths. See here and here for workarounds. Something like -v $(pwd)/certificates:/etc/secrets should do the trick.

@thilagak
Copy link
Author

My bad. I actually use absolute path but in the comment I gave relative path to let know that where my files are placed. As I said, I can see the files inside container with right permissions but benthos reports "no such file or directory".

@mihaitodor
Copy link
Member

@thilagak No worries! Can you please check again and maybe share more details? I don't see how /pipeline/config.yaml ends up in the container in the first place from the docker command you shared. Are you creating a custom container?

@Jeffail Jeffail closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants