Skip to content

Conversation

@jacoblyles
Copy link
Contributor

@jacoblyles jacoblyles commented Dec 8, 2025

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

#1011

Summary of Changes

Paths containing spaces (e.g., macOS ~/Library/Application Support/) get percent-encoded when converted to URLs (%20 for spaces). This caused "Volume not found" errors when rustfs tried to access paths with their encoded form instead of the actual filesystem path.

Changes:

  • get_file_path() now returns String and decodes percent-encoded chars
  • Updated endpoints.rs to handle the new String return type
  • Added test for paths with spaces

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (compatibility)
  • Requires doc/config/deployment update
  • Other impact:

Additional Notes

This fixes the issue where rustfs data directories in paths with spaces would fail to be found.

Paths containing spaces (e.g., macOS ~/Library/Application Support/)
get percent-encoded when converted to URLs (%20 for spaces). This
caused "Volume not found" errors when rustfs tried to access paths
with their encoded form instead of the actual filesystem path.

Changes:
- get_file_path() now returns String and decodes percent-encoded chars
- Updated endpoints.rs to handle the new String return type
- Added test for paths with spaces

This fixes the issue where rustfs data directories in paths with
spaces would fail to be found.
@CLAassistant
Copy link

CLAassistant commented Dec 8, 2025

CLA assistant check
All committers have signed the CLA.

@jacoblyles jacoblyles marked this pull request as draft December 8, 2025 16:28
@jacoblyles jacoblyles marked this pull request as ready for review December 8, 2025 17:10
@houseme houseme requested review from Copilot, houseme, shiroleeee and weisd and removed request for weisd December 9, 2025 01:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where paths containing spaces (or other characters that get percent-encoded when converted to URLs) caused "Volume not found" errors. The issue occurred because get_file_path() was returning the percent-encoded path string (e.g., Application%20Support) instead of decoding it back to the actual filesystem path (e.g., Application Support).

  • Changed get_file_path() to decode percent-encoded URLs before returning the path
  • Updated endpoints.rs to handle the new String return type instead of &str
  • Added test coverage for paths containing spaces

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/ecstore/src/disk/endpoint.rs Modified get_file_path() to return String and decode percent-encoded characters using urlencoding::decode(); added test for paths with spaces
crates/ecstore/src/endpoints.rs Updated HashMap types and references to work with String return type from get_file_path() instead of &str

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@loverustfs loverustfs mentioned this pull request Dec 9, 2025
@loverustfs
Copy link
Contributor

Hey @jacoblyles ,

Could you please add some types?


let url_with_encoded_spaces = "file:///Users/test/Library/Application%20Support/rustfs/data";
let endpoint = Endpoint::try_from(url_with_encoded_spaces).unwrap();
assert_eq!(endpoint.get_file_path(), "/Users/test/Library/Application Support/rustfs/data");

Thanks.

@houseme houseme assigned houseme and unassigned houseme Dec 9, 2025
- Add test_endpoint_percent_encoding_roundtrip to verify URL stores
  percent-encoded path and get_file_path() decodes it correctly
- Add test_endpoint_with_various_special_characters to test paths
  with spaces, brackets, and hash characters
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@loverustfs
Copy link
Contributor

Hey @jacoblyles ,

Automated test failed.


  Cancelling due to test failure: 3 tests still running
        PASS [   5.250s] ( 360/1964) rustfs-ahm::heal_integration_test serial_tests::test_heal_format_basic
        PASS [   5.263s] ( 361/1964) rustfs-ahm::heal_integration_test serial_tests::test_heal_bucket_basic
        PASS [   5.205s] ( 362/1964) rustfs-ahm::heal_integration_test serial_tests::test_heal_format_with_data
────────────
     Summary [   7.353s] 362/1964 tests run: 361 passed, 1 failed, 23 skipped
        FAIL [   1.853s] ( 359/1964) rustfs::bin/rustfs storage::concurrent_get_object_test::tests::bench_concurrent_cache_performance
warning: 1602/1964 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed
Error: Process completed with exit code 100.

@jacoblyles
Copy link
Contributor Author

Hey @jacoblyles ,

Automated test failed.


  Cancelling due to test failure: 3 tests still running
        PASS [   5.250s] ( 360/1964) rustfs-ahm::heal_integration_test serial_tests::test_heal_format_basic
        PASS [   5.263s] ( 361/1964) rustfs-ahm::heal_integration_test serial_tests::test_heal_bucket_basic
        PASS [   5.205s] ( 362/1964) rustfs-ahm::heal_integration_test serial_tests::test_heal_format_with_data
────────────
     Summary [   7.353s] 362/1964 tests run: 361 passed, 1 failed, 23 skipped
        FAIL [   1.853s] ( 359/1964) rustfs::bin/rustfs storage::concurrent_get_object_test::tests::bench_concurrent_cache_performance
warning: 1602/1964 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed
Error: Process completed with exit code 100.

Looks like a flakey test unrelated to my changes. How to rerun?

houseme and others added 2 commits December 10, 2025 22:09
- Add debug logging when percent-decoding fails in get_file_path()
- Use test path without URL fragment semantics (#) to avoid confusion
@loverustfs loverustfs merged commit 53c126d into rustfs:main Dec 10, 2025
12 of 13 checks passed
@loverustfs
Copy link
Contributor

Hey @jacoblyles ,

Thank you for your contribution! We have merged the code.

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.

4 participants