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

error message not very helpfull #217

Open
HenryNe opened this issue Mar 22, 2020 · 1 comment
Open

error message not very helpfull #217

HenryNe opened this issue Mar 22, 2020 · 1 comment
Milestone

Comments

@HenryNe
Copy link
Contributor

HenryNe commented Mar 22, 2020

On some errors where freelan breaks out, the error message was not helpfully, because only the error was printed, without a reference to the action.

For example on a vServer without rights to create the node /dev/net/tap, freelan terminates with follow messages:

root@srv:~# freelan -f -d -c /etc/freelan/freelan.conf
2020-03-22T12:34:29.569234 [INFORMATION] Reading configuration file at: "/etc/freelan/freelan.conf"
2020-03-22T12:34:29.570230 [TRACE] Debug output enabled.
2020-03-22T12:34:29.572242 [INFORMATION] Loaded server certificate from: "/etc/ssl/certs/ssl-cert-snakeoil.pem"
2020-03-22T12:34:29.572436 [INFORMATION] Loaded server private key from: "/etc/ssl/private/ssl-cert-snakeoil.key"
2020-03-22T12:34:29.572478 [INFORMATION] Deriving pre-shared key from passphrase...
2020-03-22T12:34:29.575989 [INFORMATION] Setting core logging level to: trace.
2020-03-22T12:34:29.576018 [DEBUG] Opening core...
2020-03-22T12:34:29.576039 [INFORMATION] Enabling pre-shared key authentication.
2020-03-22T12:34:29.576052 [INFORMATION] Starting FSCP server...
2020-03-22T12:34:29.600974 [IMPORTANT] Core set to listen on: [::]:12000
2020-03-22T12:34:29.601014 [INFORMATION] Building CA store...
2020-03-22T12:34:29.601088 [IMPORTANT] Restricting VPN traffic on: eth0
2020-03-22T12:34:29.601102 [INFORMATION] FSCP server started.
2020-03-22T12:34:29.601682 [ERROR] Operation not permitted

root@srv:~# echo $?
1

Of course, you can start freelan with strace to find it:

root@srv:~# freelan -f -d -c /etc/freelan/freelan.conf
...
access("/dev/net/tap", F_OK)            = -1 ENOENT (No such file or directory)
mknod("/dev/net/tap", S_IFCHR|0600, makedev(10, 200)) = -1 EPERM (Operation not permitted)

A source of error would be helpfully. For exmaple "can not open device /dev/net/tap". Or a source file name and line number, may be only with option --debug.

Similar in #216 where SIOCSIFTXQLEN can not set. It ends with:

2020-03-22T12:48:55.504637 [INFORMATION] FSCP server started.
2020-03-22T12:48:55.520067 [ERROR] Operation not permitted
@s-vincent
Copy link
Member

Hi and thanks for report.

Agree we should add some more explicit error message for system calls.

@s-vincent s-vincent added this to the 3.0 milestone Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants