9001 / 9001/copyparty

NixOS module cannot create volume of directory containing spaces

未关闭 适合新手
#1,423 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug help wanted
主要语言
Python
星标
46.7k
派生
1.9k
平均合并
9 天 2 小时
30 天内合并 PR
4

描述

### Describe the bug
When using the NixOS module to configure copyparty including a space in a volume's path results in the SystemD service to fail.

### To Reproduce
1. Create a folder with a space in the name
2. Add a volume using the created folder to the Copyparty using the NixOS module

### Expected behavior
The service to start and the volume with a space to be bound.

### Example
```nix
"/TV Shows" = {
path = "/mnt/drive-a/TV Shows";
access = {
A = [ "cody" ];
};
};
```
Causes:
```
activating the configuration...
setting up /etc...
reloading user units for cody...
restarting sysinit-reactivation.target
the following new units were started: NetworkManager-dispatcher.service
warning: the following units failed: copyparty.service
× copyparty.service - http file sharing hub
Loaded: loaded (/etc/systemd/system/copyparty.service; enabled; preset: ignored)
Active: failed (Result: exit-code) since Tue 2026-04-07 23:27:26 MST; 1s ago
Duration: 1d 1h 16min 3.051s
Invocation: 93e1c5027cd04ac5a423b9eb1bd4e182
Process: 1977560 ExecStartPre=/nix/store/vbwvizyd4kd4px79aigbw4c7k828mkka-unit-script-copyparty-pre-start/bin/copyparty-pre-start (code=exited, status=226/NAMESPACE)
IP: 0B in, 0B out
IO: 0B read, 0B written
Mem peak: 2.1M
CPU: 17ms

Apr 07 23:27:26 haumea systemd[1]: Starting http file sharing hub...
Apr 07 23:27:26 haumea (re-start)[1977560]: copyparty.service: Failed to set up mount namespacing: /mnt/drive-a/TV: No such file or directory
Apr 07 23:27:26 haumea (re-start)[1977560]: copyparty.service: Failed at step NAMESPACE spawning /nix/store/vbwvizyd4kd4px79aigbw4c7k828mkka-unit-script-copyparty-pre-start/bin/copyparty-pre-start: No such file or directory
Apr 07 23:27:26 haumea systemd[1]: copyparty.service: Control process exited, code=exited, status=226/NAMESPACE
Apr 07 23:27:26 haumea systemd[1]: copyparty.service: Failed with result 'exit-code'.
Apr 07 23:27:26 haumea systemd[1]: Failed to start http file sharing hub.
Command 'systemd-run -E LOCALE_ARCHIVE -E NIXOS_INSTALL_BOOTLOADER --collect --no-ask-password --pipe --quiet --service-type=exec --unit=nixos-rebuild-switch-to-configuration /nix/store/c3jhvii21a71bmvrar85j6zy6v3p9732-nixos-system-haumea-26.05.20251130.2d293cb/bin/switch-to-configuration switch' returned non-zero exit status 4.
```

### Server details (if you're NOT using docker/podman)
remove the ones that are not relevant:
* **server OS / version:** NixOS 26.05
* **what copyparty did you grab:** Distro
* **how you're running it:** SystemD Service
* run copyparty with `--version` and grab the last 3 lines (they start with `copyparty`, `CPython`, `sqlite`) and paste them below this line:
copyparty v1.19.20 "usernames" (2025-11-02)
CPython v3.13.9 on Linux64 [GCC 14.3.0]
sqlite 3.50.4*1 | jinja 3.1.6 | pyftpd 2.0.1 | tftp (None)

贡献指南

打开贡献指南

调研方向

查看仓库中的 NixOS 模块,可能位于 nix/ 或 modules/ 下。问题出在 systemd 服务生成过程中,其中包含空格的卷路径没有被正确加引号或转义。检查 pre-start 脚本和 unit 文件生成。创建一个包含空格的卷,并验证生成的服务文件是否能正确处理该路径来进行测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
nixos, python
领域
cli, devops
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
活跃
描述清晰度
描述清楚
新手友好度
65/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。