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

Docker container: Can't start by rlimit assertion #7

Closed
dshmelev opened this issue May 30, 2018 · 5 comments
Closed

Docker container: Can't start by rlimit assertion #7

dshmelev opened this issue May 30, 2018 · 5 comments
Labels

Comments

@dshmelev
Copy link

dshmelev commented May 30, 2018

Terminated after start:

[5][2018-05-30 19:13:03.765738 local] Invoking engine mtproxy-0.01 compiled at May 26 2018 17:35:43 by gcc 4.7.2 64-bit after commit cb4c3402bc3744f4bd956f9538fc54acaafc2638
[5][2018-05-30 19:13:03.765906 local] config_filename = '/etc/telegram/backend.conf'
[5][2018-05-30 19:13:03.766378 local] creating 2 workers
[5][2018-05-30 19:13:03.766801 local] failed to set rlimit for open files. Try running as root or requesting smaller maxconns value.
[5][2018-05-30 19:13:03.766824 local] fatal: cannot raise open file limit to 65552
root@70dae078eec2:/# mtproto-proxy: mtproto/mtproto-proxy.c:2251: mtfront_pre_init: Assertion `parent_pid == real_parent_pid' failed.
[pid 41] [time 1527707583]
------- Stack Backtrace -------
/usr/local/bin/mtproto-proxy(print_backtrace+0x15)[0x448ac5]
/usr/local/bin/mtproto-proxy(extended_debug_handler+0x10)[0x448c10]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf890)[0x7fd21f98d890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7fd21f608067]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7fd21f609448]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e266)[0x7fd21f601266]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e312)[0x7fd21f601312]
/usr/local/bin/mtproto-proxy(mtfront_pre_init+0x1fd)[0x41911d]
/usr/local/bin/mtproto-proxy(default_main+0x11a)[0x44371a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fd21f5f4b45]
/usr/local/bin/mtproto-proxy[0x412129]
[pid 41] [time 1527707583] -------------------------------
[pid 41] [time 1527707583] mtproxy-0.01 compiled at May 26 2018 17:35:43 by gcc 4.7.2 64-bit after commit cb4c3402bc3744f4bd956f9538fc54acaafc2638[pid 41] [time 1527707583]
mtproto-proxy: mtproto/mtproto-proxy.c:2251: mtfront_pre_init: Assertion `parent_pid == real_parent_pid' failed.
[pid 40] [time 1527707583]
------- Stack Backtrace -------
/usr/local/bin/mtproto-proxy(print_backtrace+0x15)[0x448ac5]
/usr/local/bin/mtproto-proxy(extended_debug_handler+0x10)[0x448c10]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf890)[0x7fd21f98d890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7fd21f608067]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7fd21f609448]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e266)[0x7fd21f601266]
/lib/x86_64-linux-gnu/libc.so.6(+0x2e312)[0x7fd21f601312]
/usr/local/bin/mtproto-proxy(mtfront_pre_init+0x1fd)[0x41911d]
/usr/local/bin/mtproto-proxy(default_main+0x11a)[0x44371a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fd21f5f4b45]
/usr/local/bin/mtproto-proxy[0x412129]
[pid 40] [time 1527707583] -------------------------------
[pid 40] [time 1527707583] mtproxy-0.01 compiled at May 26 2018 17:35:43 by gcc 4.7.2 64-bit after commit cb4c3402bc3744f4bd956f9538fc54acaafc2638[pid 40] [time 1527707583]

Info:

docker version:
Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.4
 Git commit:   3dfb8343b139d6342acfd9975d7f1068b5b1c3d3
 Built:        Thu May 24 22:21:27 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.03.1-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   7390fc6/18.03.1-ce
  Built:        Thu May 24 22:22:43 2018
  OS/Arch:      linux/amd64
  Experimental: false
@dshmelev
Copy link
Author

Okay. It is work if I add capability:
docker run --cap-add SYS_RESOURCE telegrammessenger/proxy

But... I think it is not secure.

@rail-ka
Copy link

rail-ka commented May 30, 2018

I have the same problem when running through docker.
I was helped by the launch in privilege:

docker run -d -p 443:443 --name=mtproto --privileged --restart=always -v proxy-config:/data telegrammessenger/proxy

UPDATE:
It is better to use this method:

docker run -d -p 443:443 --name=mtproto --ulimit nofile=98304:98304 --restart=always -v proxy-config:/data telegrammessenger/proxy

Instead of --privileged use --ulimit nofile=98304:98304

@Azaaaad
Copy link

Azaaaad commented May 31, 2018

I have the same problem. Any suggestion?

@dshmelev
Copy link
Author

@Azaaaad use docker run with --ulimit nofile=98304:98304 option

@stek29 stek29 closed this as completed Jun 1, 2018
@stek29 stek29 added the docker label Jun 1, 2018
@karpulix
Copy link

Thanks! --ulimit nofile=98304:98304

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

No branches or pull requests

5 participants