Skip to content

Conversation

@livelycode36
Copy link
Contributor

@livelycode36 livelycode36 commented Oct 22, 2025

Type of Change

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

Related Issues

Summary of Changes

fix: prevent duplicate data volumes in entrypoint.sh

  • Remove unconditional DATA_VOLUMES append that caused "duplicate ellipses" error
  • Add detection to check if user already provided data paths
  • Only append DATA_VOLUMES when no data paths found in arguments

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

Using rustfs for the first time, its documentation contains the following instructions:

Identify the problem

## 三、运行 RustFS 容器

RustFS SNSD Docker 运行方式,结合上述镜像与配置,执行:

```bash
 docker run -d \
  --name rustfs_local \
  -p 9000:9000 \
  -p 9001:9001 \
  -v /mnt/rustfs/data:/data \
  rustfs/rustfs:latest \
  /data
```

各参数说明:

* `-p 9000:9000`:映射宿主机 9000 Endpoint端口到容器
* `-p 9001:9001`:映射宿主机 9001 Console端口到容器
* `-v /mnt/rustfs/data:/data`:挂载数据卷
* `--name rustfs_local`:容器自定义名称
* `-d`:后台运行

However, when I run it, the following error occurs, and the docker container cannot be started.

Using only the simplest configuration from the documentation, set the mount path in the rustfs binary startup parameters to /data

docker run --rm \
  -p 9000:9000 \
  -p 9001:9001 \
  rustfs/rustfs:latest \
  /data

The console reports an error. From the log Starting: /data , we can conclude that the rustfs binary path /usr/bin/rustfs is missing; the correct one should be Starting: /usr/bin/rustfs /data

❯ docker run --rm \
  -p 9000:9000 \
  -p 9001:9001 \
  rustfs/rustfs:latest \
  /data
Initializing data directories: /data
Initializing log directory: /logs
!!!WARNING: Using default RUSTFS_ACCESS_KEY or RUSTFS_SECRET_KEY. Override them in production!
Starting: /data
/entrypoint.sh: exec: line 79: /data: Permission denied
image

and then, using the following command with full parameters:

docker run --rm \
  -p 9000:9000 \
  -p 9001:9001 \
  -e RUSTFS_ACCESS_KEY=rustfsadmin \
  -e RUSTFS_SECRET_KEY=rustfsadmin \
  -e RUSTFS_CONSOLE_ENABLE=true \
  -e RUSTFS_SERVER_DOMAINS=example.com \
  rustfs/rustfs:latest \
  --address :9000 \
  --console-enable \
  --server-domains example.com \
  --access-key rustfsadmin \
  --secret-key rustfsadmin \
  /data

The error message is as follows. It can be seen from the log Starting: /usr/bin/rustfs --address :9000 --console-enable --server-domains example.com --access-key rustfsadmin --secret-key rustfsadmin /data that the startup parameters are correct, but a new error occurs: Error: Custom { kind: Other, error: Custom { kind: Other, error: "Input args /data has duplicate ellipses" } }

Initializing data directories: /data
Initializing log directory: /logs
!!!WARNING: Using default RUSTFS_ACCESS_KEY or RUSTFS_SECRET_KEY. Override them in production!
Starting: /usr/bin/rustfs --address :9000 --console-enable --server-domains example.com --access-key rustfsadmin --secret-key rustfsadmin /data
Starting Tokio runtime with configured parameters:
worker_threads: 16, max_blocking_threads: 1024, thread_stack_size: 1048576, thread_keep_alive: 60, global_queue_interval: 31, thread_name: rustfs-worker
Log directory ready: /logs
Log directory permissions set to 755: /logs
Using default Async write mode in production. To customize, set RUSTFS_OBS_LOG_POOL_CAPA, RUSTFS_OBS_LOG_MESSAGE_CAPA, and RUSTFS_OBS_LOG_FLUSH_MS environment variables.
Production logging initialized: file-only mode to /logs/rustfs.log
Stdout logging disabled in production environment for security and log aggregation.
Log rotation configured for: every day or when size exceeds 100MB, keeping 30 files
Error: Custom { kind: Other, error: Custom { kind: Other, error: "Input args /data has duplicate ellipses" } }
image

I initially suspect that there is an error in the entrypoint.sh

  1. It does not handle path parameters starting with / . The script only processes: no parameters, options starting with -, or the explicit string rustfs. Therefore, /data is directly treated as an executable file, causing an error.

  2. When using full parameters: the parameters include /data, and the script correctly adds the /usr/bin/rustfs prefix. However, set -- "$@" $DATA_VOLUMES appends DATA_VOLUMES to the end of the parameters, making the command: /usr/bin/rustfs /data /data, rustfs detects duplicate data paths and reports the error duplicate ellipses

Fix the problem

After testing, it runs normally.

Simple configuration

docker run --rm \
  -p 9000:9000 \
  -p 9001:9001 \
  -v ~/rustfs-test/data:/data \
  -v ~/rustfs-test/entrypoint.sh:/entrypoint.sh \
  rustfs/rustfs:latest \
  /data
image

Full configuration

docker run --rm \
  -p 9000:9000 \
  -p 9001:9001 \
  -e RUSTFS_ACCESS_KEY=rustfsadmin \
  -e RUSTFS_SECRET_KEY=rustfsadmin \
  -e RUSTFS_CONSOLE_ENABLE=true \
  -e RUSTFS_SERVER_DOMAINS=example.com \
  -v ~/rustfs-test/data:/data \
  -v ~/rustfs-test/entrypoint.sh:/entrypoint.sh \
  rustfs/rustfs:latest \
  --address :9000 \
  --console-enable \
  --server-domains example.com \
  --access-key rustfsadmin \
  --secret-key rustfsadmin \
  /data
image

Multi-path configuration

docker run --rm \
  -p 9000:9000 \
  -p 9001:9001 \
  -e RUSTFS_VOLUMES="/data1,/data2" \
  rustfs/rustfs:latest
image

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.

- Remove unconditional DATA_VOLUMES append that caused "duplicate ellipses" error
- Add detection to check if user already provided data paths
- Only append DATA_VOLUMES when no data paths found in arguments
@CLAassistant
Copy link

CLAassistant commented Oct 22, 2025

CLA assistant check
All committers have signed the CLA.

@houseme houseme requested review from Copilot and overtrue and removed request for Copilot October 22, 2025 00:40
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 critical bug in the Docker entrypoint script that caused duplicate data volume paths to be passed to the rustfs binary, resulting in a "duplicate ellipses" error and preventing container startup.

Key Changes:

  • Enhanced command normalization logic to handle data paths starting with /
  • Added detection logic to prevent duplicate data volumes in arguments
  • DATA_VOLUMES now only appended when user hasn't explicitly provided data paths

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@overtrue overtrue merged commit 684e832 into rustfs:main Oct 22, 2025
12 checks passed
@livelycode36 livelycode36 deleted the fix/entrypoint-args-handling branch October 22, 2025 06:44
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.

3 participants