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

OSError : Cannot assign requested address #15

Closed
sylvainmetayer opened this issue Feb 17, 2018 · 12 comments
Closed

OSError : Cannot assign requested address #15

sylvainmetayer opened this issue Feb 17, 2018 · 12 comments

Comments

@sylvainmetayer
Copy link

I've just installed gnomecast but when I launch it, I've got the following error :

Traceback (most recent call last):
  File "/usr/local/bin/gnomecast", line 11, in <module>
    load_entry_point('gnomecast==0.2.6', 'gui_scripts', 'gnomecast')()
  File "/usr/local/lib/python3.6/site-packages/gnomecast.py", line 719, in main
    caster = Gnomecast()
  File "/usr/local/lib/python3.6/site-packages/gnomecast.py", line 154, in __init__
    s.bind((self.ip, 0))
OSError: [Errno 99] Cannot assign requested address

Here is my environment details, if it can help :

Fedora release 27 (Twenty Seven)
NAME=Fedora
VERSION="27 (Workstation Edition)"
ID=fedora
VERSION_ID=27
PRETTY_NAME="Fedora 27 (Workstation Edition)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:27"
HOME_URL="https://fedoraproject.org/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=27
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=27
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Fedora release 27 (Twenty Seven)
Fedora release 27 (Twenty Seven)
@keredson
Copy link
Owner

(([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")] or [[(s.connect(("8.8.8.8", 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]]) + [None])

could you tell me what this give you?

@sylvainmetayer
Copy link
Author

Here is the result : ['82.216.111.26', None] (with the import of socket, it wasn't working otherwise)

@keredson
Copy link
Owner

What version of python? Do you have a local firewall running?

@sylvainmetayer
Copy link
Author

Python 3.6
I've just switched from Debian to Fedora, and it seems that the firewall policy is quite different. I'll look into it.

@keredson
Copy link
Owner

can you do the following w/o the error?

    with contextlib.closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
      s.bind(('0.0.0.0', 0))

@sylvainmetayer
Copy link
Author

I've disabled the firewall in fedora but still experience the same issue.
I've tried your code snippet and I've had no output, but no error.

@fiendish
Copy link
Contributor

fiendish commented Feb 23, 2018

Here is the result : ['82.216.111.26', None]

82? What does ifconfig show?

keredson added a commit that referenced this issue Feb 23, 2018
@keredson
Copy link
Owner

i switched the bind to the universal address for you. please try v0.2.11 to see if this is fixed. (prob. it will also error when the HTTP server is binding. i'd like to see the output for that.)

@sylvainmetayer
Copy link
Author

Sorry about the delay.
I've just upgrade to v0.2.15 and it is now working ! Thanks a lot ! :)

@keredson
Copy link
Owner

awesome! thanks!

@renich
Copy link

renich commented Oct 29, 2020

I'm having this issue in Fedora 33; with python3.9 and pretty much the same results when issuing the commands. I get my public IP instead of my local IP.

@renich
Copy link

renich commented Oct 29, 2020

I've fixed it by adding an entry to /etc/hosts. Basically,

10.0.86.99 mydesktop.local mydesktop

So that gnomecast can get the proper IP. Now, it gets the internal IP; not the public one.

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

4 participants