Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 2, 2025

The rsync function was using the -a (archive) flag which includes -o (preserve owner) and -g (preserve group) options that require superuser privileges to change file ownership. This caused "Operation not permitted" errors when downloading files from remote systems to local environments where users lack such privileges.

Problem:

rsync: chown "/path/to/file.tar.gz.temp" failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23)

Root Cause:
The -a flag is equivalent to -rlptgoD, where -o (preserve owner) and -g (preserve group) cause permission issues on systems where users cannot change file ownership.

Solution:
Replace -az with -rlptDz to maintain all useful archive functionality while excluding the problematic owner and group preservation options:

  • -r: recursive
  • -l: copy symlinks as symlinks
  • -p: preserve permissions
  • -t: preserve modification times
  • -D: preserve device files and special files
  • -z: compress during transfer

Changes:

  • Modified dpdispatcher/utils/utils.py to use -rlptDz flags instead of -az
  • Added comprehensive test coverage in tests/test_rsync_flags.py
  • Updated comments to explain the permission issue fix

Testing:

  • All existing tests pass with no regression
  • New unit tests verify correct flag usage
  • CLI functionality confirmed working
  • Local rsync operations tested successfully

Fixes #434.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Change rsync flags from -az to -rlptDz to exclude owner (-o) and group (-g) preservation
- Add test coverage for rsync flag validation
- Update comments to explain the permission issue fix
- Resolves "Operation not permitted" chown errors when downloading files

Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] [BUG] rsync receive data from remote platform failed fix: Replace rsync -az with -rlptDz to avoid permission issues Sep 2, 2025
@Copilot Copilot AI requested a review from njzjz September 2, 2025 16:56
Copilot finished work on behalf of njzjz September 2, 2025 16:56
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.60%. Comparing base (9d0f1a5) to head (6645340).
⚠️ Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (9d0f1a5) and HEAD (6645340). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (9d0f1a5) HEAD (6645340)
15 14
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #547       +/-   ##
===========================================
- Coverage   60.12%   47.60%   -12.53%     
===========================================
  Files          39       39               
  Lines        3905     3905               
===========================================
- Hits         2348     1859      -489     
- Misses       1557     2046      +489     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@njzjz njzjz marked this pull request as ready for review September 7, 2025 14:47
@njzjz njzjz merged commit 5b27d82 into master Sep 7, 2025
36 of 39 checks passed
@njzjz njzjz deleted the copilot/fix-434 branch September 7, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] rsync receive data from remote platform failed
2 participants