---
title: "更新与回滚错误 | Wantastic Docs"
description: "解决自动更新失败，阅读更新日志，并回滚到上一个二进制文件。"
url: "https://wantastic.app/zh/docs/errors-update"
category: "Troubleshooting"
reading_time: "5 分钟"
---

# 更新与回滚错误

解决自动更新失败，阅读更新日志，并回滚到上一个二进制文件。

> **Outcome:** wantasticd version 显示预期版本且服务为 Connected，或你已安全回滚。

## Before you start

- root 或管理员权限。
- /tmp 中的更新日志（wantasticd-update-*.log）。

## 更新的工作原理

- wantasticd 在启动 1 分钟后检查更新，之后每小时检查一次。如需立即更新，运行 sudo wantasticd update。
- 旧的二进制文件会保存为 .previous。如果新版本无法启动，会自动恢复旧版本。
- 更新失败时隧道会继续运行，下一次检查时会再次尝试。
- "No newer release available: current=… offered=…" 是正常的。

阅读最新的更新日志:

```bash
ls -t /tmp/wantasticd-update-*.log | head -1 | xargs tail -n 50
```

## 检查要点

1. 在服务日志中找到失败行，然后阅读其中指明的更新日志。
2. 下载错误：检查网络。版本错误：检查 CPU 和 /tmp。健康检查错误：将日志发送给支持团队。
3. 如果设备不稳定，请手动回滚。

*失败：自动回滚: 更新失败，已自动恢复上一个版本。*

```
$ $ sudo wantasticd update
Error: updated service failed health verification; restoring previous binary
Self-update failed; agent remains active and will retry on the next scheduled check: update script failed: exit status 1 (log kept at /tmp/wantasticd-update-a1B2.log)
```

*手动回滚（Linux）: 恢复 .previous 并重启服务。*

```
$ $ sudo mv /usr/local/bin/wantasticd.previous /usr/local/bin/wantasticd
$ $ sudo systemctl restart wantasticd
$ $ wantasticd status
Status      Connected
```

## 速查表

| 错误 | 最简单的修复方法 |
| --- | --- |
| Self-update failed… / update script failed… | 阅读其中指明的日志。 |
| update attempt timed out after 7m0s | 延长下载超时时间。 |
| Error: download failed (HTTP N) | 允许访问 get.wantastic.app 的 HTTPS。 |
| Error: downloaded binary does not report target version | CPU 不匹配或 TMPDIR 为 noexec。 |
| Error: cannot back up / cannot write to <dir> | 以 root 身份运行；释放空间。 |
| Error: updated service failed health verification… | 已经回滚；请发送日志。 |
| update-finish: … (Windows) | 参见下方的 Windows 问题。 |

## Verify the result

- wantasticd version 显示预期版本。
- wantasticd status 显示 Connected。

## Common issues

### 更新失败，但代理仍在运行。

```
Self-update failed; agent remains active and will retry on the next scheduled check: …
```

- **Where:** wantasticd 日志
- **Likely cause:** 某个更新步骤失败，原因在冒号之后。
- **Fix:** 在此列表中查找原因。

- **Verify:** 下一次每小时检查成功。

### 更新脚本失败。

```
update script failed: … (log kept at /tmp/wantasticd-update-XXXX.log)
```

- **Where:** wantasticd 日志
- **Likely cause:** 更新脚本因错误而停止。
- **Fix:** 阅读其中指明的日志文件。

Shell:

```bash
ls -t /tmp/wantasticd-update-*.log | head -1 | xargs tail -n 50
```

- **Verify:** 你在日志中看到了原因。

### 更新超时。

```
update attempt timed out after 7m0s (log kept at …)
```

- **Where:** wantasticd 日志
- **Likely cause:** 链路速度慢（LTE 或卫星）。
- **Fix:** 使用更长的下载超时时间手动运行更新。

Shell:

```bash
sudo WANTASTIC_UPDATE_DOWNLOAD_TIMEOUT=900 wantasticd update
```

- **Verify:** 更新完成。

### 下载失败。

```
Error: download failed (HTTP N)
```

- **Where:** 更新日志
- **Likely cause:** 代理、防火墙或 DNS 阻止了访问 get.wantastic.app。
- **Fix:** 允许访问 get.wantastic.app 的 HTTPS。

Shell:

```bash
curl -I https://get.wantastic.app/latest
```

- **Verify:** 该命令显示 HTTP 200。

### 设备上没有下载工具。

```
Error: no downloader available (curl, wget or uclient-fetch)
```

- **Where:** 更新日志
- **Likely cause:** 系统镜像为精简版。
- **Fix:** 安装一个下载工具。

Shell:

```bash
opkg update && opkg install uclient-fetch libustream-mbedtls ca-bundle
```

- **Verify:** wantasticd update 完成。

### 新的二进制文件无法运行。

```
Error: downloaded binary does not report target version
```

- **Where:** 更新日志
- **Likely cause:** CPU 无法运行该构建版本，或 TMPDIR 以 noexec 挂载。
- **Fix:** 使用其他临时目录手动更新。

Shell:

```bash
sudo mkdir -p /var/tmp/wt && sudo TMPDIR=/var/tmp/wt wantasticd update
```

- **Verify:** wantasticd version 显示新版本。

### 无法备份当前的二进制文件。

```
Error: cannot back up <bin>
```

- **Where:** 更新日志
- **Likely cause:** 磁盘已满或为只读。
- **Fix:** 释放空间，然后重新更新。

Shell:

```bash
df -h
sudo wantasticd update
```

- **Verify:** 更新后存在 <bin>.previous。

### 安装目录不可写。

```
Error: cannot write to <dir> (check permissions)
```

- **Where:** 更新日志
- **Likely cause:** 更新未以 root 身份运行，或文件系统为只读。
- **Fix:** 使用 sudo 运行更新。

Shell:

```bash
sudo wantasticd update
```

- **Verify:** 更新完成。

### 自定义部署环境拒绝更新。

```
Error: no supported service manager found; refusing an unverifiable update
```

- **Where:** 更新日志
- **Likely cause:** wantasticd 未在 launchd、systemd、procd、OpenRC 或 init.d 下运行。
- **Fix:** 使用快速安装来安装服务，或手动更新并使用 --no-auto-update 运行。

Shell:

```bash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh
```

- **Verify:** wantasticd version 显示新版本。

### 更新后健康检查失败。

```
Error: updated service failed health verification; restoring previous binary
```

- **Where:** 更新日志
- **Likely cause:** 新版本未能在规定时间内正常启动。
- **Fix:** 无需撤销，它已自动回滚。请将更新日志发送至 hello@wantastic.app。

- **Verify:** wantasticd status 在旧版本上显示 Connected。

### 开发构建版本无法更新。

```
Invalid update version: parse current version: version "dev" is not major.minor.patch
```

- **Where:** wantasticd update
- **Likely cause:** 你运行的是自行构建的二进制文件。
- **Fix:** 安装官方发布版本。

Shell:

```bash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh
```

- **Verify:** wantasticd version 显示 vX.Y.Z+sha。

### 已是最新版本。

```
No newer release available: current=… offered=…
```

- **Where:** wantasticd update
- **Likely cause:** 这是正常现象。系统从不安装更旧的版本。
- **Fix:** 无需操作。

- **Verify:** wantasticd version 显示当前版本。

### Windows：更新后服务状态异常。

```
update-finish: <svc> unhealthy after update to <v>: …; restoring previous binary
```

- **Where:** Windows (update-finish)
- **Likely cause:** 新版本未进入 Running 状态。
- **Fix:** 它会自动回滚。请将前台运行日志发送给支持团队。

- **Verify:** sc.exe query wantasticd 显示 RUNNING。

### Windows：没有可恢复的备份。

```
update-finish: no backup at …
```

- **Where:** Windows (update-finish)
- **Likely cause:** 缺少 wantasticd.exe.previous。
- **Fix:** 在以管理员身份运行的 PowerShell 中用 install.ps1 重新安装。

PowerShell（管理员）:

```powershell
irm https://get.wantastic.app/install.ps1 | iex
```

- **Verify:** 服务正在运行。

### Windows：回滚也失败了。

```
update-finish: previous binary did not start either
```

- **Where:** Windows (update-finish)
- **Likely cause:** 问题出在配置或系统上，而不是二进制文件。
- **Fix:** 在前台运行以查看错误（参见 macOS 和 Windows 错误），修复后启动服务。

PowerShell（管理员）:

```powershell
sc.exe start wantasticd
```

- **Verify:** 服务正在运行。

### Windows：下载的二进制文件已损坏。

```
new binary does not run
```

- **Where:** Windows (update)
- **Likely cause:** 下载的文件已损坏或被杀毒软件删除。"new binary reports 'x', want v" 和 "wantasticd.exe not found in release archive" 与此相关。
- **Fix:** 在杀毒软件中放行 C:\Program Files\Wantastic，然后重试。

PowerShell（管理员）:

```powershell
& "C:\Program Files\Wantastic\wantasticd.exe" update
```

- **Verify:** wantasticd version 显示新版本。

## Continue with

- [Troubleshooting: start here](https://wantastic.app/zh/docs/troubleshooting): Fix most problems in 3 steps. If that does not work, find your exact error in the table and open the matching guide.
- [Update, roll back and uninstall](https://wantastic.app/zh/docs/update-and-uninstall): Update or uninstall wantasticd with one line per OS. Also: how auto-update works, turning it off, rolling back to the previous binary, and purging all data.
- [wantasticd CLI reference and operations](https://wantastic.app/zh/docs/wantasticd): The most used wantasticd commands first, then every command and flag, environment variables, config and state paths per OS, log lines, local access, exit node, and the claim flow (genkey / --wait-claim).
- [macOS and Windows errors](https://wantastic.app/zh/docs/errors-macos-windows): launchd, Gatekeeper, tray, sc.exe and Windows service errors with the easiest fixes.
