gerbera / gerbera

UPnP Media Server for 2024: Stream your digital media through your home network and consume it on all kinds of UPnP supporting devices 📱💻📺
https://gerbera.io
Other
1.19k stars 213 forks source link

Gerbera fails while trying to migrate database after upgrade #3237

Open trex2000 opened 4 days ago

trex2000 commented 4 days ago

Hello, I just upgraded my Ubuntu server to latest Ubuntu 24.04.1 LTS version. Since then Gerbera is not starting. Investigating the logs, it looks like it tries to migrate the database, but the Query is failing: gerbera.log

trex2000 commented 4 days ago

I've attached the log file. The version that is causing the issue is: ./gerbera -v

Gerbera UPnP Server 2.0.0 Copyright 2016-2023 Gerbera Contributors. Licence GPLv2: GNU GPL version 2. This is free software: you are free to change and redistribute it.

KarlStraussberger commented 4 days ago

Seems that you are stuck because the first migration failed and left a broken state.

Anyway, you see to be updating from a really old version, so it's better to drop the database and have it recreated from scratch. There were many changes that require a fresh import to benefit from.

Second, I would recommend changing to our repo (see docs) to get the latest version (2.3).

trex2000 commented 4 days ago

I would really not drop the database as I am using gerbera to stream radio stations (and recode them) to the home network and there were quite some entries there. Is there a manual way to edit the sql database ? Note: It could not be that old, I periodically upgrade the Ubuntu server to LTS versions.

trex2000 commented 3 days ago

I gave up and created everything from scratch, I've purged all configs and reinstalled. (Note: I tend to not use custom PPAs, just what comes with the LTS package, for stability reasons) Gerbera starts up, webif is accessible (I've generated a brand new config but enabled the UI, and account) Now the problem is that the main interface does come up, but as soon as I press the login button, I get the 404 errror. I've cleared cache, tried on different computers, also tried browsers, incognito mode, etc. The logs show nothing. What could be wrong ?

trex2000 commented 3 days ago

image

trex2000 commented 3 days ago

image

KarlStraussberger commented 3 days ago

I would really not drop the database as I am using gerbera to stream radio stations (and recode them) to the home network and there were quite some entries there. Is there a manual way to edit the sql database ? Note: It could not be that old, I periodically upgrade the Ubuntu server to LTS versions.

Updating the database would have been quite easy. There is a file mysql-upgrade.xml that contains all the statement in the end you only have to set the correct version in the settings table.

KarlStraussberger commented 3 days ago

I gave up and created everything from scratch, I've purged all configs and reinstalled. (Note: I tend to not use custom PPAs, just what comes with the LTS package, for stability reasons) Gerbera starts up, webif is accessible (I've generated a brand new config but enabled the UI, and account) Now the problem is that the main interface does come up, but as soon as I press the login button, I get the 404 errror. I've cleared cache, tried on different computers, also tried browsers, incognito mode, etc. The logs show nothing. What could be wrong ?

The LTS packages are mostly outdated - stable only with respect to enterprise apps. We do not patch old versions, we go straight to the next, so custom PPA is more stable than LTS.

Did try some of the suggestion on our troubleshooting page already: https://docs.gerbera.io/en/latest/troubleshooting.html

trex2000 commented 3 days ago

Okay, so I installed from PPA repo the latest version, 2.3. This one starts, and also can login. However, when I try to add a new container (radio) it crashes with:

terminate called after throwing an instance of 'std::out_of_range' what(): map::at

Restarting the service , the newly created container shows up. I've started adding Radio stations to it, but then I saw in the logs: libupnp ThreadPoolAdd too many jobs: 100 libupnp ThreadPoolAdd too many jobs: 100 libupnp ThreadPoolAdd too many jobs: 100 libupnp ThreadPoolAdd too many jobs: 100 libupnp ThreadPoolAdd too many jobs: 100 libupnp ThreadPoolAdd too many jobs: 100

and it just crashed again.

I am starting to loose my patience here. I've been using Mediatomb, then it got discontinued and switched to gerbera for ages. They work rock solid, I forgot it really existed.

Since the upgrade, it looks like there are problems over problems. Is there a way to somehow install an older version that is simplier and just works for me ?

Note:I already lost 2 days trying to make this work just to be able to listen to some radio stations on old sony internet radios that only know dlna and mpeg. I am a programmer myself and I really try to make this work, however it looks to me that this piece of SW just got worse :(

trex2000 commented 3 days ago

Forgot to mention, I started with a fresh database, I've deleted the old one. Fortunately I have a backup and with an SQL3 db editor I can still get the URLs and all the radio stations out of it.

KarlStraussberger commented 3 days ago

We're sorry for each bug that stays uncovered, but as this is not our full time paid job we rely on people like you to support us in testing and we're spending our free time developing new features.

I was able to reproduce your first crash. The upnp error message is already in discussion (and was in discussion since the local upnp code was given up) and can only be fixed in the upnp lib.

trex2000 commented 3 days ago

Yes, I know that, and I appreciate the help. This is why I also posted here the logs, maybe somebody could help in fixing it. I am glad you could reproduce it, in case you provide an update, let me know and I can try it out. Regarding UPNP, is it used for advertising only or you also query for devices on the network ? Can this be limited somehow from config or command line ?

trex2000 commented 3 days ago

I read on other forums that the libupnp error message could be solved by adding --disable-blocking_tcp_connections while building it. I did not try to build it myself, but maybe it would be a solution to add to the buildchain also libunpnp and build one of our own ?

trex2000 commented 2 days ago

Also, side question: isn't there something missing from the GUI ? image

trex2000 commented 2 days ago

I see nowhere a possibility to edit or remove these entries. In the documentation I see the buttons there, which were also available in the old versions of gerbera that I've been using before. image

KarlStraussberger commented 2 days ago

This issue typically has two reason

KarlStraussberger commented 2 days ago

I read on other forums that the libupnp error message could be solved by adding --disable-blocking_tcp_connections while building it. I did not try to build it myself, but maybe it would be a solution to add to the buildchain also libunpnp and build one of our own ?

Normally all distros use this switch, so no problem here.

For the 2.3 release the sad reason is: we're running over the limit because of the web page being routed through gerbera instead of the libupnp miniserver. Therefore, I proposed a PR to the lib so we can increase the value.

trex2000 commented 2 days ago

This issue typically has two reason

* browser cache: clear the gerbera hosts entries and enjoy

* changed directories because of different build layout: see the respective troubleshooting section and purge the old stuff

Thanks, reinstalling gerbera did the trick. Probably the webpage was not upgraded for some reason when I switched to 2.3.