IceWhaleTech/CasaOS · error
get mount list failed
Error message
get mount list failed
What it means
GetMountList POSTs to /mount/listmounts over a Unix-domain socket (/var/run/rclone/rclone.sock) to a local rclone daemon; any non-200 status (404 unknown route, 500 daemon error, 503 during startup) is collapsed into 'get mount list failed'. Note the daemon is retried 3 times with 5s waits before this surfaces, and the response body — which contains the real reason — is discarded.
Source
Thrown at pkg/utils/httper/drive.go:71
return net.Dial("unix", unixSocket)
},
}
client := resty.New()
client.SetTransport(&transport).SetBaseURL("http://localhost")
client.SetRetryCount(3).SetRetryWaitTime(5*time.Second).SetTimeout(DefaultTimeout).SetHeader("User-Agent", UserAgent)
return client
}
func GetMountList() (MountList, error) {
var result MountList
res, err := NewRestyClient().R().Post("/mount/listmounts")
if err != nil {
return result, err
}
if res.StatusCode() != 200 {
return result, fmt.Errorf("get mount list failed")
}
json.Unmarshal(res.Body(), &result)
for i := 0; i < len(result.MountPoints); i++ {
result.MountPoints[i].Fs = result.MountPoints[i].Fs[:len(result.MountPoints[i].Fs)-1]
}
return result, err
}
func Mount(mountPoint string, fs string) error {
res, err := NewRestyClient().R().SetFormData(map[string]string{
"mountPoint": mountPoint,
"fs": fs,
"mountOpt": `{"AllowOther": true}`,
"vfsOpt": `{"CacheMode": 3}`,
}).Post("/mount/mount")
if err != nil {
return err
}View on GitHub (pinned to 0d3b2f444e)
Solutions
- Verify the rclone daemon is up: systemctl status rclone (or equivalent) and check the socket exists with ss -x | grep rclone.
- Restart the rclone service so the socket and HTTP listener are recreated cleanly (removes stale sockets).
- Confirm the installed rclone version exposes /mount/listmounts (test: curl --unix-socket /var/run/rclone/rclone.sock -X POST http://localhost/mount/listmounts).
- Include res.Body() in the error message to surface the daemon's actual response for debugging.
Example fix
// before
if res.StatusCode() != 200 {
return result, fmt.Errorf("get mount list failed")
}
// after
if res.StatusCode() != 200 {
return result, fmt.Errorf("get mount list failed: status %d, body %s", res.StatusCode(), res.String())
} Defensive patterns
Strategy: retry
Validate before calling
func rcloneSocketReady() bool {
_, err := os.Stat("/var/run/rclone/rclone.sock")
return err == nil
}
if !rcloneSocketReady() {
return errors.New("rclone daemon not running; start the rclone service")
} Try / catch
list, err := httper.GetMountList()
if err != nil {
if strings.Contains(err.Error(), "get mount list failed") {
// resty already retried 3x with 5s waits — additional immediate retries are futile;
// check service status, restart rclone, then retry once
if svcErr := restartRcloneService(); svcErr != nil { return svcErr }
time.Sleep(2 * time.Second)
return httper.GetMountList()
}
return err
} Prevention
- Order service startup so the rclone daemon is healthy before dependents call GetMountList
- Health-check the unix socket and endpoint at boot and on failure
- Include status code and body in the error to avoid blind debugging
- Remove stale socket files on service restart
When it happens
Trigger: The rclone serve daemon behind the socket is down, an incompatible rclone version without the /mount/listmounts endpoint, the rclone service still starting (socket exists but HTTP not ready), or the mount subsystem in an error state returning 5xx.
Common situations: Fresh install where rclone service is not yet running; rclone upgraded/downgraded to a version without the mount API; service crashed leaving a stale socket file; insufficient permissions on the socket.
Related errors
AI-assisted analysis of IceWhaleTech/CasaOS@0d3b2f444e (2026-08-15).
Data as JSON: /api/errors/a436af32a761b6c3.
Report an issue: GitHub.