Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Following the setcap instruction raises 'fatal error: Invalid argument' #2401

Open
aqjune opened this issue May 5, 2024 · 5 comments
Open

Comments

@aqjune
Copy link

aqjune commented May 5, 2024

Description

When I try criu dump it requests that capability of CAP_SYS_ADMIN or CAP_CHECKPOINT_RESTORE must be given to criu, with an instruction showing how to use setcap. However, if I follow it, I am seeing the following error:

$ ~/criu-3.19/criu/criu dump -t 31058 -vvv -o dump.log --unprivileged && echo OK
CRIU needs to have the CAP_SYS_ADMIN or the CAP_CHECKPOINT_RESTORE capability:
setcap cap_checkpoint_restore+eip /home/aqjune/criu-3.19/criu/criu
(00.000000) Effective capability 40 missing
(00.000000) Effective capability 21 missing
$ setcap cap_checkpoint_restore+eip /home/aqjune/criu-3.19/criu/criu
fatal error: Invalid argument
usage: setcap [-q] [-v] [-n <rootid>] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]

 Note <filename> must be a regular (non-symlink) file.

This might not be a problem of criu (I found that criu's CI script is in fact using the same command), but was just wondering whether any further instruction could be given in the case, which might be helpful to beginners.

Describe the results you expected:

The setcap command is succesfully done

Additional information you deem important (e.g. issue happens only occasionally):

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"

CRIU logs and information:

criu 3.19

CRIU full dump/restore logs:

None

Output of `criu --version`:

Version: 3.19

Output of `criu check --all`:

$ ~/criu-3.19/criu/criu check --all
CRIU needs to have the CAP_SYS_ADMIN or the CAP_CHECKPOINT_RESTORE capability:
setcap cap_checkpoint_restore+eip /home/aqjune/criu-3.19/criu/criu

Additional environment details:

@adrianreber
Copy link
Member

My first guess would be that Ubuntu 20.04 is just too old. Please retry with something newer.

@aqjune
Copy link
Author

aqjune commented May 6, 2024

Thanks @adrianreber, it worked on 24.04. If CAP_CHECKPOINT_RESTORE is a new capability option of a newer Linux, I think that printing something like This linux does not unsupport CAP_CHECKPOINT_RESTORE other than the setcap cap_checkpoint_restore+eip ... command line could be an option.

@adrianreber
Copy link
Member

Please close if resolved.

@aqjune
Copy link
Author

aqjune commented May 6, 2024

My concern was that it was printing a wrong diagnostic message, sorry - I think it should emit a different message than 'setcap ...' if the capability was not available. The issue is not resolved yet.

@adrianreber
Copy link
Member

If your setcap is too old there is nothing CRIU can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants