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

Permission denied after using a newly created directory #364

Open
mlejva opened this issue Apr 22, 2024 · 1 comment
Open

Permission denied after using a newly created directory #364

mlejva opened this issue Apr 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mlejva
Copy link
Member

mlejva commented Apr 22, 2024

If you create a new directory with our SDK and then try to move a file into the newly created directory, you receive a permission denied error.

Reproducible Python example

from e2b import Sandbox
with Sandbox() as sandbox:
    sandbox.filesystem.make_dir("/new-dir")
    sandbox.filesystem.write("/file.txt", "hello")
    proc = sandbox.process.start_and_wait("mv /file.txt /new-dir/file.txt")
    print(proc)

Output

messages=[ProcessMessage(line="mv: cannot move '/file.txt' to '/new-dir/file.txt': Permission denied", error=True, timestamp=1713826346687143416)] error=True exit_code=1
@mlejva mlejva added the bug Something isn't working label Apr 22, 2024
@ValentaTomas
Copy link
Member

This is a problem with filesystem permissions — we don't expose user and use root for fs operations by default (so you have access to all files). When you then try to modify file as default user via process the permissions block this.

I'm taking this into account when thinking about new version of the API (https://github.com/e2b-dev/infra/blob/grpc/packages/envd/spec/filesystem.proto), but it might be possible to add this without breaking to the current API too.

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