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

socket.error problem: [Errno 99] Cannot assign requested address #298

Closed
yu-yuxuan opened this Issue Feb 18, 2015 · 23 comments

Comments

Projects
None yet
@yu-yuxuan

yu-yuxuan commented Feb 18, 2015

Can anyone explain why it happens. I will appreciate it.

I use configuration

{
    "server":"***.****.**",
    "server_port":***,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"**********",
    "timeout":600,
    "method":"rc4",
    "fast_open": false
}

The log is as follows

2015-02-18 18:21:09 INFO     starting server at ********:***
Traceback (most recent call last):
  File "/bin/ssserver", line 9, in <module>
    load_entry_point('shadowsocks==2.6.8', 'console_scripts', 'ssserver')()
  File "/usr/lib/python2.7/site-packages/shadowsocks/server.py", line 60, in main
    tcp_servers.append(tcprelay.TCPRelay(a_config, dns_resolver, False))
  File "/usr/lib/python2.7/site-packages/shadowsocks/tcprelay.py", line 584, in __init__
    server_socket.bind(sa)
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address
@FuckTheGFW

This comment has been minimized.

Show comment
Hide comment
@FuckTheGFW

FuckTheGFW Feb 23, 2015

Could you try to replace your current ip ("_.__._*") with "0.0.0.0" and run it again?

FuckTheGFW commented Feb 23, 2015

Could you try to replace your current ip ("_.__._*") with "0.0.0.0" and run it again?

@clowwindy clowwindy closed this Feb 24, 2015

@lovfawth

This comment has been minimized.

Show comment
Hide comment
@lovfawth

lovfawth Feb 25, 2015

"0.0.0.0" doesn't work either, it says "2015-02-25 13:53:41 INFO starting server at 0.0.0.0:8388" and hangs there. I deployed it in AWS EC2.
BTW, why do you close a question so fast? Why not close it after getting a response from the reporter?

lovfawth commented Feb 25, 2015

"0.0.0.0" doesn't work either, it says "2015-02-25 13:53:41 INFO starting server at 0.0.0.0:8388" and hangs there. I deployed it in AWS EC2.
BTW, why do you close a question so fast? Why not close it after getting a response from the reporter?

@luieswww

This comment has been minimized.

Show comment
Hide comment
@luieswww

luieswww Feb 26, 2015

maybe you can change the "method" to another one and have a try

On Wed, Feb 25, 2015 at 10:18 PM, lovfawth notifications@github.com wrote:

"0.0.0.0" doesn't work either, it says "2015-02-25 13:53:41 INFO starting
server at 0.0.0.0:8388" and hangs there. I deployed it in AWS EC2.
BTW, why do you close a question so fast? Why not close it after getting a
response from the reporter?


Reply to this email directly or view it on GitHub
#298 (comment)
.

luieswww commented Feb 26, 2015

maybe you can change the "method" to another one and have a try

On Wed, Feb 25, 2015 at 10:18 PM, lovfawth notifications@github.com wrote:

"0.0.0.0" doesn't work either, it says "2015-02-25 13:53:41 INFO starting
server at 0.0.0.0:8388" and hangs there. I deployed it in AWS EC2.
BTW, why do you close a question so fast? Why not close it after getting a
response from the reporter?


Reply to this email directly or view it on GitHub
#298 (comment)
.

@chence

This comment has been minimized.

Show comment
Hide comment
@chence

chence May 27, 2015

just NOTICE:if you want to connect AWS EC2, you should use sudo sslocal -c /etc/shadowsocks.json -d start instead of sudo ssserver .......

chence commented May 27, 2015

just NOTICE:if you want to connect AWS EC2, you should use sudo sslocal -c /etc/shadowsocks.json -d start instead of sudo ssserver .......

@taizilongxu

This comment has been minimized.

Show comment
Hide comment
@taizilongxu

taizilongxu Jun 10, 2015

thanks very much, haha

taizilongxu commented Jun 10, 2015

thanks very much, haha

@Erobaby

This comment has been minimized.

Show comment
Hide comment
@Erobaby

Erobaby commented Aug 1, 2015

@chence + 1

@24king

This comment has been minimized.

Show comment
Hide comment
@24king

24king commented Nov 14, 2015

@chence +1

@wogong

This comment has been minimized.

Show comment
Hide comment
@wogong

wogong Dec 9, 2015

I came across the same error when I hided my server's IP using CloudFlare, which means I want to bind an address doesn't belong to me.Using IP in config file or don't using CloudFlare's CDN service can fix this.

wogong commented Dec 9, 2015

I came across the same error when I hided my server's IP using CloudFlare, which means I want to bind an address doesn't belong to me.Using IP in config file or don't using CloudFlare's CDN service can fix this.

@westwin

This comment has been minimized.

Show comment
Hide comment
@westwin

westwin Jan 25, 2016

@chence +1
amazing cc

westwin commented Jan 25, 2016

@chence +1
amazing cc

@DonaldDai

This comment has been minimized.

Show comment
Hide comment
@DonaldDai

DonaldDai Aug 24, 2016

@chence
It works, but why(daemon mode)?

DonaldDai commented Aug 24, 2016

@chence
It works, but why(daemon mode)?

@colorfulclouds

This comment has been minimized.

Show comment
Hide comment
@colorfulclouds

colorfulclouds Jan 9, 2017

my version is centos7, c language, it said that "Cannot assign requested address".i do not know why. who can tell me why. and i use a correct program pasted to test,error ever.

colorfulclouds commented Jan 9, 2017

my version is centos7, c language, it said that "Cannot assign requested address".i do not know why. who can tell me why. and i use a correct program pasted to test,error ever.

@celeron533

This comment has been minimized.

Show comment
Hide comment
@celeron533

celeron533 Jan 9, 2017

@colorfulclouds so what address is written in your config file?

celeron533 commented Jan 9, 2017

@colorfulclouds so what address is written in your config file?

@COZN

This comment has been minimized.

Show comment
Hide comment
@COZN

COZN commented Feb 10, 2017

@chence +1

@colorfulclouds

This comment has been minimized.

Show comment
Hide comment
@colorfulclouds

colorfulclouds Feb 10, 2017

colorfulclouds commented Feb 10, 2017

@nirajvara

This comment has been minimized.

Show comment
Hide comment
@nirajvara

nirajvara Aug 21, 2017

@chence it works but server port 8000 which required to client to connect with server is not shows when run this command
netstat -ntlp it show only local port 1080

nirajvara commented Aug 21, 2017

@chence it works but server port 8000 which required to client to connect with server is not shows when run this command
netstat -ntlp it show only local port 1080

@4zd

This comment has been minimized.

Show comment
Hide comment
@4zd

4zd Aug 22, 2017

@nirajvara I have met the same problem,have you soloved it ?

4zd commented Aug 22, 2017

@nirajvara I have met the same problem,have you soloved it ?

@nirajvara

This comment has been minimized.

Show comment
Hide comment
@nirajvara

nirajvara Aug 23, 2017

Yes , in AWS instead of Ip address in .json file I have added the domain name and then try the

ssserver command and its works,

nirajvara commented Aug 23, 2017

Yes , in AWS instead of Ip address in .json file I have added the domain name and then try the

ssserver command and its works,

@colorfulclouds

This comment has been minimized.

Show comment
Hide comment
@colorfulclouds

colorfulclouds Aug 23, 2017

there is a function named setsockopt,
like this
if( ( setsockopt(server_sock_fd , SOL_SOCKET , SO_REUSEADDR , &no_use , sizeof no_use ) ) != 0)
{
perror("error");
exit(EXIT_FAILURE);
}
if( ( setsockopt(server_sock_fd , SOL_SOCKET , SO_REUSEPORT , &no_use , sizeof no_use ) ) != 0)
{
perror("error");
exit(EXIT_FAILURE);
}

colorfulclouds commented Aug 23, 2017

there is a function named setsockopt,
like this
if( ( setsockopt(server_sock_fd , SOL_SOCKET , SO_REUSEADDR , &no_use , sizeof no_use ) ) != 0)
{
perror("error");
exit(EXIT_FAILURE);
}
if( ( setsockopt(server_sock_fd , SOL_SOCKET , SO_REUSEPORT , &no_use , sizeof no_use ) ) != 0)
{
perror("error");
exit(EXIT_FAILURE);
}

@huangzhuo492008824

This comment has been minimized.

Show comment
Hide comment
@huangzhuo492008824

huangzhuo492008824 Oct 17, 2017

Maybe your server ip not your real ip. Run ifconfig ensure ip is right !

huangzhuo492008824 commented Oct 17, 2017

Maybe your server ip not your real ip. Run ifconfig ensure ip is right !

@weifeng1463

This comment has been minimized.

Show comment
Hide comment
@weifeng1463

weifeng1463 Jan 5, 2018

thank you . it works for me

weifeng1463 commented Jan 5, 2018

thank you . it works for me

@juju-li

This comment has been minimized.

Show comment
Hide comment
@juju-li

juju-li Jan 18, 2018

thanks,it's very useful

juju-li commented Jan 18, 2018

thanks,it's very useful

@limen

This comment has been minimized.

Show comment
Hide comment
@limen

limen Mar 13, 2018

@chence It also works on Aliyun EC. Nice.

limen commented Mar 13, 2018

@chence It also works on Aliyun EC. Nice.

@Anxiaomo11

This comment has been minimized.

Show comment
Hide comment
@Anxiaomo11

Anxiaomo11 Jun 21, 2018

@limen Get information from kevinhuang, Fill in private network IP at server on Aliyun

Anxiaomo11 commented Jun 21, 2018

@limen Get information from kevinhuang, Fill in private network IP at server on Aliyun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment