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

Run without write access to source directory #372

Closed
phemmer opened this issue Feb 24, 2025 · 3 comments
Closed

Run without write access to source directory #372

phemmer opened this issue Feb 24, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@phemmer
Copy link

phemmer commented Feb 24, 2025

New user to repomix, and was testing with the docker image. It appears the application cannot run without write access to the source directory, even if the output file is specified to go elsewhere.

For example:

# mkdir /tmp/source

# echo hello > /tmp/source/world

# mkdir /tmp/out

# podman run -v /tmp/source:/app:ro -v /tmp/out:/out -t --rm ghcr.io/yamadashy/repomix -o /out/repomix                   

📦 Repomix v0.2.29

No custom config found at repomix.config.json or global config at /root/.config/repomix/repomix.config.json.
You can add a config file for additional settings. Please check https://github.com/yamadashy/repomix for more information.
✖ Error during packing
Unexpected error: Cannot access directory /app: undefined
For more help, please visit: https://github.com/yamadashy/repomix/issues

If you take the :ro flag off the volume mount it works, even though output has been redirected somewhere else. I'm not sure if it's trying to use the source directory as a temporary working directory or what. But IMHO it shouldn't be putting anything in it. Any temporary files should either go in the directory of the output file, $XDG_RUNTIME_DIR, or /tmp/.

Might also help if the error message would a little clearer. It took me a minute to figure out what the issue was, when the directory was there, readable, and not being used for output.

@yamadashy yamadashy added the bug Something isn't working label Feb 25, 2025
@yamadashy
Copy link
Owner

Hi, @phemmer !
Thank you for the report.
This looks like a bug, so I'll investigate it.

I agree that the error message is not clear enough.
I'll make changes so that traces are displayed by default for unexpected errors and make the error messages more user-friendly and informative, especially.

@yamadashy
Copy link
Owner

@phemmer
We have fixed it in version 0.2.30. When you have time, we would appreciate it if you could check and confirm the fix.

https://github.com/yamadashy/repomix/releases/tag/v0.2.30

The issue was caused by the permission check also verifying write access to the directory, which was unnecessary.

@phemmer
Copy link
Author

phemmer commented Feb 25, 2025

Yup. Works fine now. Thanks!

@phemmer phemmer closed this as completed Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants