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

[error] UPNP_E_SOCKET_ERROR (-208) #129

Closed
coolbombom opened this issue Jun 11, 2017 · 12 comments
Closed

[error] UPNP_E_SOCKET_ERROR (-208) #129

coolbombom opened this issue Jun 11, 2017 · 12 comments

Comments

@coolbombom
Copy link

coolbombom commented Jun 11, 2017

Hi

first off, thank for all the hard work.

I'm trying to run this on a hummingbird board, but i keep getting following error ... i can't figure out what is wrong!

gmediarender 0.0.7-git started [ gmediarender 2017-03-18_33600ab (libupnp-1.6.19+git20160116; glib-2.48.2; gstreamer-1.8.3) ].
Logging switched off. Enable with --logfile=<filename> (e.g. --logfile=/dev/stdout for console)
ERROR [2017-06-11 10:20:33.230763 | upnp] UpnpInit(ip=(null), port=49494) Error: UPNP_E_SOCKET_ERROR (-208)
ERROR [2017-06-11 10:20:33.230869 | main] ERROR: Failed to initialize UPnP device

EDIT: i'm running it on the latest version of armbian

please help

cheers
c_bb

@hzeller
Copy link
Owner

hzeller commented Jun 11, 2017

Maybe it had trouble binding to some IP ? In particular if you have multiple interfaces (eth0 and some wlan), you need to decides that with explicitly setting the IP address to be bound to with the --ip-address option. Maybe this is the issue ?

@Wesley-Chan
Copy link

Wesley-Chan commented Nov 17, 2017

I have this exact issue when trying to launch gmediarender from init.d script. My rig's running Gentoo and OpenRC. I also tried the -I option which won't work either. But if I manually start the service later when the system has fully booted, it would work. I don't quite understand the dependencies. Maybe you have some advise, @hzeller? Thanks in advance.

@gaydenko
Copy link

At my case setting --ip-address doesn't help. Error message just contains that IP instead of null. I have set that IP is assigned if I manually (successfully) start the systemd service after boot.

ERROR [2018-01-29 13:59:19.911878 | upnp] UpnpInit(ip=192.168.1.103, port=49494) Error: UPNP_E_SOCKET_BIND (-203)
ERROR [2018-01-29 13:59:19.911923 | main] ERROR: Failed to initialize UPnP device

Any further directions to dig in?

@hzeller
Copy link
Owner

hzeller commented Jan 29, 2018

Did you arrange the init dependencies in a way to start gmrender-resurrect after the network is up?

@gaydenko
Copy link

gaydenko commented Jan 29, 2018

Yes. This is the systemd service:

[Unit]
Description=UPnP renderer using gstreamer
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/gmediarender -f "gMedia UpPnP Renderer" -u 49e4f137-a832-481c-9117-bfa96a71aba5

[Install]
WantedBy=default.target

And this is ExecStart tuning (that is override.conf):

[Service]
ExecStart=
ExecStart=/usr/bin/gmediarender -f Anli_gRenderer -u b5f87cc9-c9d6-4f6f-ac04-7665d4c189a6 --gstout-audiosink=alsasink --gstout-audiodevice=iec958 --logfile=/home/andrew/.local/log/gmediarender.log --ip-address=192.168.1.103

On manual service start all is OK.

@mill1000
Copy link
Contributor

Perhaps try another WantedBy target? I am using systemd on my RPi3 and haven't had issues. Here is my service.

[Unit]
Description=GMediaRender
After=syslog.service network.target

[Service]
ExecStart=/usr/local/bin/gmediarender -f %H
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=GMediaRender
User=pi
Group=audio

[Install]
WantedBy=multi-user.target

I am using a locally compiled version so my path is in /usr/local/bin instead of /usr/bin

If that doesn't work trying delaying the execution of the service with the following
ExecStartPre=/bin/sleep 3

Maybe the network is still coming up when the service starts and that causes an issue.

@gaydenko
Copy link

gaydenko commented Jan 30, 2018

@mill1000 thanks! - the trick with ExecStartPre is that tick which did it!

@sonvirgo
Copy link

I have same error on os x High Sierra. It works for 2 days, then stop now. Your trick doesn't work. What now?

@sonvirgo
Copy link

sonvirgo commented Apr 16, 2018

#157
I thinks MiniDLNA shares libupnp but it use it own upnp.
Also SO_REUSEADDR does not work as expected for datagram sockets on Mac OS X.
Thanks

P/s however the PORT reported is incorrect.
After an hour of LLDB debug, I found the conflict port is 1900 SSDP_PORT.

@hzeller
Copy link
Owner

hzeller commented Aug 18, 2018

I could reproduce this with a current debian installation.
It seems like the systemd targets network.target and network-online.target are actually not waiting until all networks are configured so the UPnP socket initialization might fail.

Now, gmrender-resurrect does retries (up to a minute) to attempt establishing the socket. It now reliably initializes the service on a systemd configured system.

@whyman
Copy link

whyman commented Aug 20, 2018

I'm pretty sure libupnp 1.6 tries to bind every interface even if you set one explicitly. Works with 1.8 correctly as far as I have seen.

@neumantm
Copy link

I know, old thread. But for anyone stumbling upon this in the future:
I just added the following to my systemd unit and now it seems to work without retries and without any ugly sleep:

[Unit]
Description=gmrender-resurrect
After=network-online.target sound.target
Requires=network-online.target sound.target

I'm not sure if the sound.target is really required, but it made sense to me.
Important thing is that we use network-online.target and not network.target and that we add it in After and in Requires.

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

8 participants