Skip to content

Commit

Permalink
service: print more error message
Browse files Browse the repository at this point in the history
Some error messages were swallowed which makes user confused, for
example, for RAFSv6, we need to set blobcache config in `localfs.json`
(following docs tutorial), before modification, the error message
indicates nothing:

```
ERROR [src/bin/nydusd/main.rs:525] Failed in starting daemon: Invalid
argument (os error 22)
```

After this modification, we get clearer error message:

```
ERROR [/src/fusedev.rs:595] service mount error: RAFS failed to handle
request, Configure("Rafs v6 must have local blobcache configured")
```

Signed-off-by: Wei Zhang <weizhang555.zw@gmail.com>
  • Loading branch information
WeiZhang555 authored and jiangliu committed Aug 4, 2023
1 parent 43c737d commit f419349
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ $ cat localfs.json
"config": {
"dir": "/<YOUR-WORK-PATH>/nydus-image/blobs"
}
},
"cache": {
"type": "blobcache",
"config": {
"work_dir": "/var/lib/nydus/cache"
}
}
},
"mode": "direct"
Expand Down
10 changes: 8 additions & 2 deletions service/src/fusedev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,15 +591,21 @@ pub fn create_fuse_daemon(
|| api_sock.is_none()
{
if let Some(cmd) = mount_cmd {
daemon.service.mount(cmd)?;
daemon.service.mount(cmd).map_err(|e| {
error!("service mount error: {}", &e);
eother!(e)
})?;
}
daemon
.service
.session
.lock()
.unwrap()
.mount()
.map_err(|e| eother!(e))?;
.map_err(|e| {
error!("service session mount error: {}", &e);
eother!(e)
})?;
daemon
.on_event(DaemonStateMachineInput::Mount)
.map_err(|e| eother!(e))?;
Expand Down

0 comments on commit f419349

Please sign in to comment.