shadowsocks-libev-server service failed to start duing boot

Created on 6 May 2019  ·  6Comments  ·  Source: shadowsocks/shadowsocks-libev

What version of shadowsocks-libev are you using?

shadowsocks-libev 3.2.5

What operating system are you using?

Arch Linux
Linux archlinux 5.0.7-arch1-1-ARCH

What did you do?

I created a config file named test.json in /etc/shadowsocks, and enabled it with:

sudo systemctl enable shadowsocks-libev-server@test

and reboot the server.

What did you expect to see?

Working perfectly.

What did you see instead?

[email protected] failed to start:

[email protected] - Shadowsocks-Libev Server Service
   Loaded: loaded (/usr/lib/systemd/system/[email protected]; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-05-06 21:42:03 HKT; 21s ago
  Process: 329 ExecStart=/usr/bin/ss-server -c /etc/shadowsocks/test.json (code=exited, status=255/EXCEPTION)
 Main PID: 329 (code=exited, status=255/EXCEPTION)

May 06 21:42:02 archlinux systemd[1]: Started Shadowsocks-Libev Server Service.
May 06 21:42:03 archlinux ss-server[329]:  2019-05-06 21:42:03 INFO: initializing ciphers... aes-256-gcm
May 06 21:42:03 archlinux ss-server[329]:  2019-05-06 21:42:03 INFO: tcp server listening at 10.0.0.6:4567
May 06 21:42:03 archlinux ss-server[329]:  2019-05-06 21:42:03 ERROR: bind: Cannot assign requested address
May 06 21:42:03 archlinux ss-server[329]:  2019-05-06 21:42:03 ERROR: failed to bind address
May 06 21:42:03 archlinux systemd[1]: [email protected]: Main process exited, code=exited, status=255/EXCEPTION
May 06 21:42:03 archlinux systemd[1]: [email protected]: Failed with result 'exit-code'.

Seems that the server service was started before the network interface is ready.

What is your config in detail (with all sensitive info masked)?

{
  "server": "10.0.0.6",
  "server_port": 4567,
  "password": "* deleted *",
  "method": "aes-256-gcm"
}

Potential Fix

Replace the following line
https://github.com/shadowsocks/shadowsocks-libev/blob/9c935f762e3345d08b992ec93bd5979b51f84c92/debian/shadowsocks-libev-server%40.service#L15
with:

After=network-online.target
Wants=network-online.target
third-party bug

Most helpful comment

Try setting your "server":"ip" in config.json to 0.0.0.0

All 6 comments

Arch Linux scripts and package are maintained by third-party maintainers.

Please contact them instead.

Yes that's true, I'll contact them later.

But this issue can also be reproduced on platform using scripts from this repository, such as Debian and Ubuntu. I tried on Debian with shadowsocks-libev 3.2.5, the service failed to start for the same reason:

May 09 13:24:04 transmission-server ss-server[953]:  2019-05-09 13:24:04 INFO: initializing ciphers... aes-256-gcm
May 09 13:24:04 transmission-server ss-server[953]:  2019-05-09 13:24:04 INFO: tcp server listening at 172.17.10.210:4567
May 09 13:24:04 transmission-server ss-server[953]:  2019-05-09 13:24:04 ERROR: failed to resolve server name 172.17.10.210
May 09 13:24:04 transmission-server ss-server[953]:  2019-05-09 13:24:04 ERROR: failed to listen on any address
May 09 13:24:04 transmission-server systemd[1]: [email protected]: Main process exited, code=exited, status=255/n/a

you could use netctl hooks to start ss.service, that will make sure to start it after a network connection.

Same issue for Debian 10. Fixed for me by
Restart=always
RestartSec=10
In the [Service] section.
Is there a more beautiful solution?

Try to manual configure domain names resolution.
Add server_ip and server_name to your /etc/hosts

Get Outlook for iOShttps://aka.ms/o0ukef


From: danil1petrov notifications@github.com
Sent: Tuesday, July 16, 2019 8:25:07 AM
To: shadowsocks/shadowsocks-libev shadowsocks-libev@noreply.github.com
Cc: Sean Fang silence.boy@live.cn; Manual manual@noreply.github.com
Subject: Re: [shadowsocks/shadowsocks-libev] shadowsocks-libev-server service failed to start duing boot (#2369)

Same issue for Debian 10. Fixed for me by
Restart=always
RestartSec=10
In the [Service] section.
Is there a more beautiful solution?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/shadowsocks/shadowsocks-libev/issues/2369?email_source=notifications&email_token=ACRSCF4QDV4GAZEKU2RPFL3P7UIOHA5CNFSM4HLANXP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ7KQEI#issuecomment-511617041, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACRSCF5YXWYY2L2V5GV6423P7UIOHANCNFSM4HLANXPQ.

Try setting your "server":"ip" in config.json to 0.0.0.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alfal picture alfal  ·  3Comments

mcmxciv picture mcmxciv  ·  3Comments

tony1016 picture tony1016  ·  3Comments

rule2c picture rule2c  ·  4Comments

blackgear picture blackgear  ·  3Comments