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

Reconnecting appear every 4 minutes #17

Closed
dapao9999 opened this issue Nov 24, 2016 · 21 comments
Closed

Reconnecting appear every 4 minutes #17

dapao9999 opened this issue Nov 24, 2016 · 21 comments

Comments

@dapao9999
Copy link

dapao9999 commented Nov 24, 2016

2016-11-24_224942
Reconnecting every 4 minutes as described in the image

@TommyLau
Copy link
Owner

It seems to be a problem(or designed to?) of ocserv.

This is just a Docker container of ocserv, it cannot solve the program issue running in Docker.

I will keep this open for awhile, and check whether the issue is related to Docker.

@TheNomad11
Copy link

TheNomad11 commented Jan 31, 2017

I observed the same issue. Now I installed a non-docker version of ocserv and the issue disappeared. The reconnecting issue might be related to Docker then

@TommyLau
Copy link
Owner

TommyLau commented Feb 4, 2017

@TheNomad11 Thank you for your information. And it reminds me that mine got the same issues, the client will reconnect in a few minutes too. And before we know anything further, it might as you said it could be related to Docker itself.

@fxpester
Copy link

image

hit this just now, running on google cloud on ubuntu 16.04

@fxpester
Copy link

funny part, I used this - https://github.com/evshiron/docker-ocserv - and everything working ok, no reconnects

@TommyLau
Copy link
Owner

TommyLau commented Jan 5, 2018

It seems that image is using Fedora as the base image, could it be the problem of the Linux system? Looking into it, thanks again for your information.

@TommyLau
Copy link
Owner

TommyLau commented Jan 5, 2018

Are you using AnyConnect as the client, or you are just using OpenConnect as the client? I saw that Dockerfile had disabled Cisco compatibility in the config file.

@fxpester
Copy link

fxpester commented Jan 5, 2018

ok, new attempt to use your solution:
docker run --name ocserv --privileged -p 443:443 -p 443:443/udp -d tommylau/ocserv

  • result: everything ok, user test working perfectly for 10 minutes.
docker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd -d test
docker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd -g "Route,All" tommy
  • result: when I try to connect as user tommy It is not working, in AnyConnect logs:
     10:56:16 AM    Contacting x.x.x.x.
     10:56:22 AM    User credentials entered.
     10:56:26 AM    User credentials entered.
     10:56:26 AM    Connection attempt has failed.
     10:56:26 AM    Ready to connect.

Nothing in docker logs.
and inside container I can see (passwd ommited by me):

/etc/ocserv # cat ocpasswd
tommy:Route,All:$1$xxxxxxxxxxxxx

@fxpester
Copy link

fxpester commented Jan 5, 2018

looks like problem in chinese character in group description, for now fixed it by editing ./ocserv.conf
remove 'Route' group and set group 'All' as default

@TommyLau
Copy link
Owner

TommyLau commented Jan 5, 2018

@s7lx Do you have time to look into this issue? I'm not using the group function, and I setup ocserv.conf file separately.

@fxpester
Copy link

fxpester commented Jan 5, 2018

I guess it is cause I don`t have chinese lang support in my win10, and cisco anyconnect works ok for first connect, then it tries to cache group description, but fails to read cache afterwards. So first connect is ok, but all next fail.

@TommyLau
Copy link
Owner

TommyLau commented Jan 6, 2018

Have you ever removed the Chinese characters and have another try? Whether it works correctly or not?

@fxpester
Copy link

fxpester commented Jan 6, 2018

yes, I removed them, cleared anyconnect cache, and now I can connect to both groups

@long1215
Copy link

最新版本还是每4分钟重新连接

@TommyLau
Copy link
Owner

@long1215 Yup, looks like a program with Docker or maybe something else, which I have no clue at all.

@itshaadi
Copy link

itshaadi commented May 25, 2018

I have the same problem openconnect keeps saying:

SSL read error: The TLS connection was non-properly terminated.; reconnecting.

it is worth mentioning that this error occurs on a TCP based connection. also UDP packets are unable to reach the server. (I'm guessing that my ISP is responsible for that)

DTLS handshake failed: Error in the push function.
(Is a firewall preventing you from sending UDP packets?)

@TommyLau
Copy link
Owner

@itshaadi Are you using UDP? Have you ever tried to use TCP protocol?

@itshaadi
Copy link

UDP is completely blocked in iran. I am using 443/TCP at the moment. and this problem occurs on TCP.

@TommyLau
Copy link
Owner

I cannot reproduce this issue, only the reconnect occurs to me, could it be the low level network issue from your Internet provider?

@itshaadi
Copy link

DTLS handshake failed: Error in the push function. is indeed a low level network issue from my ISP. as I said UDP ports are completely unreachable. however reconnect error could be an issue related to Docker. or your configuration for ocserv.

@chunlaw
Copy link

chunlaw commented Feb 4, 2019

Quick fix: set the isolate-worker in the .conf file to false

My colleague @jonathan-tan has found that it is the problem of the kernel function seccomp_init() and seccomp_rule_add() in the function disable_system_calls in the source code. You can see if you change the auth-timeout in the .conf file from 240 to 10, the reconnecting behaviour occurs every 10 seconds.

Edited: As it is the system function, it is related to Alpine Linux (the docker base image) has overriden alarm() to setitimer() and hence causing the misbehaviour.

ppyyr added a commit to ppyyr/docker-openconnect that referenced this issue Mar 21, 2021
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

7 participants