DLNA/UPnP would not start

Questions regarding media streaming across varied protocols, including UPnP/DLNA/CIFS can be placed here.
Forum rules
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
DanielKO
I'm New!
I'm New!
Posts: 3
Joined: Thu Nov 18, 2010 6:43 am

DLNA/UPnP would not start

Unread post by DanielKO » Thu Nov 18, 2010 7:09 am

Not sure where to post this, hopefully this is not the wrong place.

One day I noticed the DLNA/UPnP service was not working. So I accessed the admin page, and Media Server option was indeed disabled. I checked the box to enable the DLNA/UPnP media server, clicked Ok, and it would go back to being disabled right away. Restarting the box did not help.

I logged in, to see if there was anything strange; and indeed, the postgresql service was not running (although the indexing service was). For those that didn't know, system uses postgresql as a backend for a couple of services, including the media server. So I looked around, and found that I could start the postgresql service by hand, by running "/usr/syno/etc/rc.d/S20pgsql.sh start". I got some very clear error messages suggesting one database was corrupt. Unfortunately this was not being reported on the system log.

Then I executed "/usr/syno/pgsql/bin/dropdb <dbname>", where "<dbname>" was the name of the problematic database (you might need to switch to user "admin" instead of "root" before postgres starts accepting commands). Tried to start the Media Server from the web interface, and it was up and running once again.

I'm not sure why the database got corrupted (the disk is fine, I never got any message about the system shutting down abnormally), but now I know where to look for when things go wrong. Last time the Media Server stopped working I just reinstalled (and painfully reconfigured) the whole system. Hopefully this can be a clue for people encountering the same problem. And hopefully the synology devs can include the postgres startup errors in the system log in a future update.

Kolliker-Fuse
I'm New!
I'm New!
Posts: 1
Joined: Tue Sep 08, 2009 11:56 pm

Re: DLNA/UPnP would not start

Unread post by Kolliker-Fuse » Thu Nov 18, 2010 8:02 pm

I just encountered the exact same problem actually and came here to see if anyone else had found a way to fix this.

DanielKO
I'm New!
I'm New!
Posts: 3
Joined: Thu Nov 18, 2010 6:43 am

Re: DLNA/UPnP would not start

Unread post by DanielKO » Fri Nov 19, 2010 5:27 am

One reboot later and it's broken again. The thing looks like a rube goldberg machine.

DanielKO
I'm New!
I'm New!
Posts: 3
Joined: Thu Nov 18, 2010 6:43 am

Re: DLNA/UPnP would not start

Unread post by DanielKO » Fri Nov 19, 2010 6:00 am

Up and running again. If I have to do it once more I will just write down a script.

In short, make sure to stop any postgres instance, then remove the contents of /var/services/pgsql/ (that is, do not remove the directory itself), then run /usr/syno/etc/rc.d/S20pgsql.sh, it should be able to rebuild the databases back, and the service be able to start once again. Hopefully this is the right procedure.

wipsomass
I'm New!
I'm New!
Posts: 5
Joined: Mon Oct 20, 2008 7:03 am

Re: DLNA/UPnP would not start

Unread post by wipsomass » Sun Sep 25, 2011 4:33 am

I couldn't enable the media player and this last post saved my a$$

Thanks for the post :D

bigstick
Beginner
Beginner
Posts: 20
Joined: Thu Oct 01, 2009 11:24 am

Re: DLNA/UPnP would not start

Unread post by bigstick » Tue Dec 06, 2011 9:48 pm

I have exactly the same problem.

I check the box to enable the DLNA server, but immediately after I click on the 'Okay' button to save the setting, the DLNA checkbox deselects.

I have read the instructions above, but I'm afraid I simply don't understand any of them.

Normally I'm very competent with technology generally, but I really need some help with these instructions!

Unless anyone has a different fix which doesn't require an in depth knowledge of the Synology OS and how to access it with terminal commands...

[Edit: DSM version 3.2-1955

I have dug a little deeper and found that logging in via SSH with a GUI SSH tool like Cyberduck on the Mac doesn't work. In fact I can't find any instructions for logging in via SSH with this method. The big question for me is, "What the hell is the point of developing such an easy GUI for a NAS drive, if key functionality breaks in such a major way, and it's not fixable by anyone other than someone who is either a network professional, or highly competent with Networking and Linux?

Is there anyone out there from Synology who can fix this with a simple diagnostic tool? What's the point of this fancy new DSM if it can't fix (or make it so that non-experts can fix easily enough with a bit of research) some of the basic problems?

This is complex and involved for non-experts!

DiskStation> /usr/syno/etc/rc.d/S20pgsql.sh start
createdb: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Failed to create database

Is this some kind of programmer's joke I'm too stupid to understand?

How do I do this:-

"remove the contents of /var/services/pgsql/ (that is, do not remove the directory itself), then run /usr/syno/etc/rc.d/S20pgsql.sh"

All I want to do is enable DLNA! It's p*ssing me off now...]

madmike23
I'm New!
I'm New!
Posts: 1
Joined: Fri Dec 09, 2011 4:12 am

Re: DLNA/UPnP would not start

Unread post by madmike23 » Fri Dec 09, 2011 4:15 am

So did anyone work this out? I'm having the same problem too. How does one access the terminal window?

jeroend
I'm New!
I'm New!
Posts: 5
Joined: Sun Dec 27, 2009 9:53 pm

Re: DLNA/UPnP would not start

Unread post by jeroend » Tue Dec 20, 2011 8:00 pm

I had the exact same problem and removing/recreating the postgre database solved the issue, so thanks!

For the users above, I'll try to explain how to do it yourself, but you'll have to get your hands dirty.
  • Follow the steps here to enable telnet. Just ignore the part about logging in as another user because you must be admin user in order for the next steps.
  • Log in in telnet or ssh (I'd advice you use putty as described in the link above).
  • Delete the postgre database by entering rm -rf /var/services/pgsql/*
  • Start postgreSQL by executing /usr/syno/etc/rc.d/S20pgsql.sh start. You'll see a lot of output but if everything goes well it should contain a lot of 'CREATE TABLE' and 'CREATE INDEX' lines. Finally you'll see 'COMMIT' and then some 'test XXX' lines.
  • Try to enable the DLNA service. It should now work.
  • Disable telnet and SSH again for security reasons.
Good luck!

bigstick
Beginner
Beginner
Posts: 20
Joined: Thu Oct 01, 2009 11:24 am

Re: DLNA/UPnP would not start

Unread post by bigstick » Fri Dec 30, 2011 6:18 pm

Telnet is easy on a Mac, it 'just works' from the Terminal. For Windows, you will need some form of terminal client like PuTTY (http://www.chiark.greenend.org.uk/~sgta ... nload.html)

I had no problem with logging in as root, but when I execute the terminal command to delete the database I get:-

DiskStation> rm -rf /var/services/pgsql/*
rm: can't stat '/var/services/pgsql/base/16384/2757': Input/output error
rm: can't stat '/var/services/pgsql/base/16384/3767': Input/output error
rm: can't stat '/var/services/pgsql/base/16384/3606': Input/output error
rm: can't remove '/var/services/pgsql/base/16384': Directory not empty
rm: can't stat '/var/services/pgsql/base/16417/2608': Input/output error
rm: can't remove '/var/services/pgsql/base/16417': Directory not empty
rm: can't remove '/var/services/pgsql/base': Directory not empty

Sorry - I would look up the commands to remove these directories, but the reality is that I don't know if there are more that I need to delete, some that I need to leave the hell alone, or whether there are some other precautions I need to take to avoid screwing stuff up!

dtra
I'm New!
I'm New!
Posts: 2
Joined: Wed Oct 05, 2011 9:20 pm

Re: DLNA/UPnP would not start

Unread post by dtra » Tue Jan 31, 2012 12:25 pm

hmm, I had the same issue after getting back from holiday and turning the NAS on, the media server didn't seem to be working. Found this thread and eventually got it working:
  • Stop/disable the media server
    log in via ssh using root
    stop the postgres service as mentioned above
    delete the /var/services/pgsql/* files and folders
    restart the postgres service
    start/enable the media server (it should automatically start indexing the files)
That procedure worked for me, and I am thinking that it may be required any time the NAS is restarted.

mattbrown68
Trainee
Trainee
Posts: 14
Joined: Sat Jun 25, 2011 3:29 pm

Re: DLNA/UPnP would not start

Unread post by mattbrown68 » Sat Apr 21, 2012 6:32 am

bigstick wrote:Telnet is easy on a Mac, it 'just works' from the Terminal. For Windows, you will need some form of terminal client like PuTTY (http://www.chiark.greenend.org.uk/~sgta ... nload.html)
I think you mean SSH. Telnet just works on Windows, as well.

Locked

Return to “Media Server”