Skip to content

Conversation

@overtrue
Copy link
Collaborator

@overtrue overtrue commented Jan 1, 2026

Type of Change

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

Related Issues

Summary of Changes

Fix: ListObjectVersions NextMarker Parameter Validation Error

Problem

The test_bucket_list_delimiter_not_skip_special s3tests case failed during teardown with:

botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter VersionIdMarker, value: None, type: <class 'NoneType'>, valid types: <class 'str'>

Root Cause

  1. AWS S3 API spec: NextKeyMarker and NextVersionIdMarker fields should be omitted entirely when empty, not set to None or empty string.

  2. Our implementation: next_key_marker wasn't filtering empty values, causing empty strings to appear in XML responses.

  3. boto3 strict validation: When boto3 parses an empty marker from XML and passes it to the next pagination request, it fails validation since VersionIdMarker only accepts non-empty strings.

Fix

Filter empty values for both marker fields in rustfs/src/storage/ecfs.rs:

// Before: next_key_marker wasn't filtered
let next_key_marker = object_infos.next_marker.filter(|v| !v.is_empty());
let next_version_id_marker = object_infos.next_version_idmarker.filter(|v| !v.is_empty());

Also fixed crates/ecstore/src/store_list_objects.rs to return "null" string (per S3 spec) instead of None for non-versioned objects, and handle "null" marker parsing correctly.

Changes

  • rustfs/src/storage/ecfs.rs: Filter empty next_key_marker and next_version_id_marker
  • crates/ecstore/src/store_list_objects.rs: Return "null" string for non-versioned objects; handle "null" marker parsing
  • Added unit tests for marker handling and round-trip behavior

Testing

  • All existing tests pass
  • s3tests test_bucket_list_delimiter_not_skip_special now passes including teardown

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


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

…s from disk

- Replace get_user with check_key in IAMAuth::get_secret_key
- check_key will automatically load users from disk if not in cache
- This fixes the issue where newly created users cannot be authenticated immediately
- Add detailed comments explaining the change
Ensure next_key_marker is filtered like next_version_id_marker to avoid
passing None or empty values to boto3, which causes ParamValidationError
when s3tests tries to use the response in subsequent requests.

This fixes the error:
Invalid type for parameter VersionIdMarker, value: None, type: <class 'NoneType'>, valid types: <class 'str'>

which occurs in test teardown when nuke_prefixed_buckets calls list_versions
and receives a response with None values that are then passed to boto3.
Main user (rustfsadmin) is a system user handled by SimpleAuth via
environment variables, so it doesn't need to be created via admin API.
1. Fix envsubst: export all required variables (S3_ACCESS_KEY, S3_SECRET_KEY,
   S3_ALT_ACCESS_KEY, S3_ALT_SECRET_KEY) for s3tests config generation

2. Fix next_version_idmarker: return 'null' string for non-versioned objects
   instead of None, matching AWS S3 API behavior

3. Handle 'null' VersionIdMarker: skip UUID parsing when client passes 'null'
   as the version marker (used for non-versioned objects)

This fixes test_bucket_list_delimiter_not_skip_special teardown error:
- ParamValidationError: Invalid type for parameter VersionIdMarker, value: None
Add comprehensive unit tests for:
- next_key_marker and next_version_id_marker filtering (empty string -> None)
- version_id formatting (None -> "null" string for non-versioned objects)
- "null" version marker parsing (skip UUID parsing for non-versioned)
- Round-trip behavior: server response -> client request -> server parsing

These tests verify the fix for boto3 ParamValidationError:
'Invalid type for parameter VersionIdMarker, value: None'
Copilot AI added a commit that referenced this pull request Jan 1, 2026
Co-authored-by: overtrue <1472352+overtrue@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Jan 1, 2026
- Fix typo: _forced_elete -> _forced_delete in api_remove.rs
- Update auth.rs to use check_key for better user loading
- Handle "null" version markers in store_list_objects.rs
- Filter empty markers in ListObjectVersions (ecfs.rs)
- Update s3-tests provisioning script comments
- Add comprehensive tests for marker handling

All changes are properly formatted with cargo fmt.

Co-authored-by: overtrue <1472352+overtrue@users.noreply.github.com>
@overtrue overtrue requested review from Copilot and weisd and removed request for Copilot January 1, 2026 13:42
@houseme houseme requested a review from Copilot January 1, 2026 14:02
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 the S3 ListObjectVersions API was returning empty strings for pagination markers instead of omitting them, causing boto3 client validation errors during pagination.

Key Changes:

  • Filter empty next_key_marker and next_version_id_marker values to comply with AWS S3 API specification
  • Handle "null" string representation for non-versioned objects in version ID markers
  • Add comprehensive unit tests for marker filtering and round-trip behavior

Reviewed changes

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

Show a summary per file
File Description
rustfs/src/storage/ecfs.rs Filters empty marker strings before returning in ListObjectVersionsOutput; adds unit tests for marker filtering logic
crates/ecstore/src/store_list_objects.rs Returns "null" string for non-versioned objects and parses "null" markers correctly; adds unit tests for round-trip marker handling
rustfs/src/auth.rs Changes authentication from get_user to check_key (unrelated to PR purpose)
scripts/s3-tests/run.sh Adds environment variable exports and user provisioning comments (unrelated to PR purpose)
scripts/s3-tests/cleanup.sh New cleanup script for test environment (unrelated to PR purpose)
Cargo.lock Updates openssl-probe dependency versions (unrelated to PR purpose)

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

@overtrue overtrue merged commit 61b3100 into rustfs:main Jan 1, 2026
20 checks passed
@overtrue overtrue deleted the fix/s3-list-object-versions-next-marker branch January 1, 2026 15:26
houseme added a commit that referenced this pull request Jan 3, 2026
…-proxies

* 'main' of github.com:rustfs/rustfs:
  Add workflow to mark stale issues automatically
  fix: remove nginx-ingress default body size limit (#1335)
  feat:Permission verification for deleting versions (#1341)
  chore: upgrade GitHub Actions artifact actions (#1339)
  chore: replace native-tls with pure rustls for FTPS/SFTP e2e tests (#1334)
  chore: upgrade dependencies and migrate to aws-lc-rs (#1333)
  fix: s3 list object versions next marker (#1328)
  fix(tagging): fix e2e test_object_tagging failure (#1327)
  Feat/ftps&sftp (#1308)

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/config/src/constants/mod.rs
#	crates/config/src/lib.rs
#	rustfs/Cargo.toml
houseme added a commit that referenced this pull request Jan 7, 2026
* 'main' of github.com:rustfs/rustfs:
  fix:correct RemoteAddr extension type to enable IP-based policy evaluation (#1356)
  Add workflow to mark stale issues automatically
  fix: remove nginx-ingress default body size limit (#1335)
  feat:Permission verification for deleting versions (#1341)
  chore: upgrade GitHub Actions artifact actions (#1339)
  chore: replace native-tls with pure rustls for FTPS/SFTP e2e tests (#1334)
  chore: upgrade dependencies and migrate to aws-lc-rs (#1333)
  fix: s3 list object versions next marker (#1328)
  fix(tagging): fix e2e test_object_tagging failure (#1327)
  Feat/ftps&sftp (#1308)
  fix(iam): preserve decrypt-failed credentials instead of deleting them (#1312)
  Restore globals and add unified TLS/mTLS loading from RUSTFS_TLS_PATH (#1309)
  fix: correctly handle aws:SourceIp in policy evaluation (#1301) (#1306)
  Add trendshift
  feat: add local s3-tests script with configurable options and improvements (#1300)
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.

1 participant