step workdir upload resets the work folder's owner and permissions in Modal

Open Beginner friendly
#4,487 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Sauvi72 is already working on this.

Since Nov 26, 2026.

  • #4496 by @Sauvi72 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start in environments/modal.py at _sdk_upload_dir, then inspect how pack_dir_to_file and remote_unpack_command handle the archive root and ownership. Reproduce with a multi-step task using a non-root agent and a later step with workdir files. Done means the agent can still write to its working directory after those files are uploaded; the issue suggests excluding the root entry or preserving ownership during extraction.

Written by the indexing model from the issue text.

Description

TLDR: on Modal, uploading a step's workdir files resets the owner and permissions of the agent's working directory, and a non-root agent can't write there afterwards

How to repro:

  • multi-step task, agent runs as a non-root user
  • a later step has files under steps/<name>/workdir
  • at the start of that step Harbor uploads them into the working directory
  • from that step on the agent can't create files there

Why it happens: _sdk_upload_dir in environments/modal.py packs the folder with pack_dir_to_file, which includes the folder's own . entry by default, then extracts it as root with plain tar -xzf. So the working directory takes the owner and mode of the folder on the host.

Possible fix: pack with include_root=False, and/or pass no_same_owner=True to remote_unpack_command.

related: #3392 (same fix for Modal, closed without merging), #4307

Dominant language
Python
Stars
5.6k
Forks
1.9k
Avg merge
1d 17h
Merged PRs (30d)
156

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from harbor-framework/harbor

All issues in harbor-framework/harbor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.