Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 13, 2026

SFTP integration tests were failing with "No such file" errors because the atmoz/sftp container chroots users to /home/username, making the root directory read-only. Tests attempted to create directories at the chroot root, which is denied by the SFTP server for security.

Changes

  • docker-compose.test.yml: Configure SFTP with command: ["testuser:testpass:1001:100:upload"] to create a writable upload directory owned by the test user, removing the problematic volume mount
  • .github/workflows/dotnet.yml: Set SFTP_TEST_ROOT: upload to direct tests to the writable directory instead of empty string (chroot root)

The atmoz/sftp image requires explicit directory specification in the user configuration for write access within the chroot. The array format ensures colons in the configuration string are parsed correctly.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Change SFTP container to use command array format for proper parsing
- Set SFTP_TEST_ROOT to "upload" directory which is writable by test user
- Remove volume mount that was causing permission issues
- The atmoz/sftp image chroots users and only specified directories are writable
- This fixes "No such file" errors when SFTP tests try to create directories

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI issues and reconcile with dev Fix SFTP integration tests by configuring writable chroot directory Jan 13, 2026
Copilot AI requested a review from Menelion January 13, 2026 23:36
@Menelion Menelion marked this pull request as ready for review January 13, 2026 23:44
@Menelion Menelion merged commit e3b43bf into dev-vs-ci Jan 13, 2026
@Menelion Menelion deleted the copilot/sub-pr-32 branch January 13, 2026 23:44
Menelion added a commit that referenced this pull request Jan 14, 2026
* Try to reconcile dev with CI and fix tests finally

* Fix CS

* Try fixing workflow

* More fixes

* Meow

* Meow2

* Meow3

* Meow4

* Meow5

* meow6

* meow7

* Meow8

* Meow9

* meow11

* Meow12

* meow13

* meow14

* Meow10

* meow15

* meow16

* meow17

* meow18

* meow19

* meow20

* meow21

* meow22

* meow23

* meow23

* meow24

* meow25

* meow26

* meow27

* Fix SFTP test failures in chrooted environments (#33)

* Initial plan

* Fix SFTP test root path handling for chrooted environments

- Handle empty SFTP_TEST_ROOT properly (use relative path instead of /tmp/sharpsync-tests)
- When root is empty string (chrooted env), use relative paths for test directories
- This fixes "No such file" errors when creating test directories in CI

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Improve SFTP chroot detection and path handling

- Simplify chroot detection: assume relative paths when RootPath doesn't start with "/"
- Fix exception handling to catch SftpPathNotFoundException in addition to permission errors
- This should fix issues with chrooted SFTP environments in CI
- Separate chroot detection from root path creation logic

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix whitespace formatting in SftpStorageTests.cs (#34)

* Initial plan

* Fix whitespace formatting in SftpStorageTests.cs

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix SFTP integration tests by configuring writable chroot directory (#35)

* Initial plan

* Fix SFTP test configuration for chrooted environment

- Change SFTP container to use command array format for proper parsing
- Set SFTP_TEST_ROOT to "upload" directory which is writable by test user
- Remove volume mount that was causing permission issues
- The atmoz/sftp image chroots users and only specified directories are writable
- This fixes "No such file" errors when SFTP tests try to create directories

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix WebDAV GetRelativePath to handle full URLs from server responses (#36)

* Initial plan

* Fix WebDavStorage GetRelativePath to correctly strip root path from WebDAV resource URLs

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix WebDavStorage GetRelativePath to handle full URLs from WebDAV server

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix CS

* Fix WebDAV CreateDirectoryAsync to ensure root path exists before creating subdirectories

CreateDirectoryAsync was missing the call to EnsureRootPathExistsAsync that
WriteFileAsync already had. This caused integration tests to fail because each
test uses a unique root path (containing a GUID for isolation), and attempting
to create subdirectories like "test/subdir" would fail with 409 Conflict when
the root path itself didn't exist yet.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove garbage

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.

2 participants