“快照刷新”失败,并显示“错误:无法删除快照文件 core18”

“快照刷新”失败,并显示“错误:无法删除快照文件 core18”

snap refresh去年我每天都在使用它,并且效果非常好。

从今天起我收到以下错误:

$ sudo snap refresh
2023-03-15T12:15:40+02:00 ERROR cannot remove snap file "core18", will retry in 3 mins: incorrect number of tail fields, expected 3 but found 4
Remove snap "core18" (2697) from the system                                                                                                                                                                                                                \error: cannot perform the following tasks:
- Mount snap "core18" (2714) (incorrect number of tail fields, expected 3 but found 4)

输出cat /proc/self/mountinfo

$ cat /proc/self/mountinfo | grep snap
156 80 8:32 /snap /snap rw,relatime shared:6 - ext4 /dev/sdc rw,discard,errors=remount-ro,data=ordered
263 156 0:77 / /snap/core18/2708 ro,nodev,relatime shared:44 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
266 156 0:78 / /snap/core18/2697 ro,nodev,relatime shared:56 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
269 156 0:79 / /snap/core20/1822 ro,nodev,relatime shared:58 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
272 156 0:80 / /snap/core20/1828 ro,nodev,relatime shared:60 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
275 156 0:81 / /snap/intellij-idea-ultimate/417 ro,nodev,relatime shared:62 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
278 156 0:82 / /snap/intellij-idea-ultimate/418 ro,nodev,relatime shared:64 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
281 156 0:83 / /snap/lxd/23541 ro,nodev,relatime shared:66 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
284 156 0:84 / /snap/lxd/24322 ro,nodev,relatime shared:68 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
287 156 0:85 / /snap/snapd/17950 ro,nodev,relatime shared:70 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
290 156 0:86 / /snap/snapd/18357 ro,nodev,relatime shared:72 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
293 156 0:87 / /snap/trivy/120 ro,nodev,relatime shared:74 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
296 156 0:88 / /snap/trivy/136 ro,nodev,relatime shared:76 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other
437 105 0:53 /snapd/ns /run/snapd/ns rw,nosuid,nodev - tmpfs none rw,mode=755
984 437 0:4 mnt:[4026532326] /run/snapd/ns/lxd.mnt rw - nsfs nsfs rw
2306 156 0:339 / /snap/core18/2714 ro,nodev,relatime shared:683 - fuse.snapfuse snapfuse ro,user_id=0,group_id=0,allow_other

使用:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

$ uname -r
5.15.90.1-microsoft-standard-WSL2

使用 Docker Desktop。

我该如何解决此问题?

编辑:4 天后我收到以下错误:

2023-03-20T11:14:33+02:00 ERROR cannot remove snap file "core20", will retry in 3 mins: incorrect number of tail fields, expected 3 but found 4

5 天后出现另一个不同的错误:

ERROR cannot remove snap file "snapd", will retry in 3 mins: incorrect number of tail fields, expected 3 but found 4

答案1

如果您使用 Docker Desktop 在 wsl 上运行 Ubuntu,则问题在于 Docker 正在将路径 /Docker/host 安装到 Program Files 下的目录中。mountinfo 数据的解析未处理空格,这就是您收到有关尾部字段数量不正确的错误的原因。

为了解决这个问题,我做了以下事情:

  • 停止 Docker 桌面
  • 重启 wsl(wsl --shutdown)
  • 运行“快照刷新”
  • 重启 Docker Desktop

相关内容