xbmc / xbmc

Kodi is an award-winning free and open source home theater/media center software and entertainment hub for digital media. With its beautiful interface and powerful skinning engine, it's available for Android, BSD, Linux, macOS, iOS, tvOS and Windows.
https://kodi.tv/
Other
18.54k stars 6.3k forks source link

Android app crashes if mysql connection unavailable #25157

Open fhteagle opened 6 months ago

fhteagle commented 6 months ago

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

Using advancedsettings.xml defined music and video libraries pointing to a mysql server on my LAN, if mysql connection fails for any reason, the android app will crash 100% of the time sometime during startup. Crash will occur either on splash screen, on subsequent blank black screen, or if it makes it to the skin loaded stage, the crash will occur as soon as you select a section that uses mysql library, such as music.

I am using Kodi app 21.0 installed via Google Play store. This is repeatable 100% of the time on OnePlus 7T HD1905 with LineageOS 20. I can test other devices with OEM ROMs (though much older versions of android) if need be.

The crash does not occur, library data loads, and everything works as expected if the mysql connection is available.

Kodi 21 binary installed on arch linux amd64 hosts are able to ride through the mysql connection failure, and load with a blank library.

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Kodi app loads and launches with a blank or fallback local library if mysql connnection is unavailable.

Actual Behavior

Kodi app freezes on splash screen, or blank black screen, or self force-closes on first media section selection that would draw from the mysql library

Possible Fix

To Reproduce

Steps to reproduce the behavior:

  1. Define valid mysql library sources in advancedsettings.xml, optionally populate said library
  2. Launch Kodi android app with mysql connection unavailable (wifi disconnected, mysql server stopped, etc)
  3. Note crash

Debuglog

The most complete debuglog can be found here:

https://paste.kodi.tv/avecihelan.kodi

However, during many crash occurrences, the log file stops before the error <general>: Unable to open database: kodi-music83 [2002](Can't connect to server on '***hostredacted***' (115)) line is written even.

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

Your Environment

Used Operating system:

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required. Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

fhteagle commented 6 months ago

I just checked Kodi 21.0 app installed on an old Samsung Galaxy S9 with OEM Android 10. Exact same behavior: works perfectly before MySQL library is defined, when mysql library is defined and connection is available, but 100% crash rate with MySQL connection unavailable.

abs0 commented 5 months ago

I may have a variation on this - I'm using mariadb 10.11.7 on the server side and android kodi 21.0 on a Fire TV will randomly hang then after a few seconds crash. It almost always happens if I show the standard Movies and TV main pages. All content is via http to a local-net server (as is the database).

Switching from mysql to local database and everything is rock solid.

Running the same advancedsettings.xml on Windows or macOS client no issues

Been running with this config since at least XBMC. Will try installing 20.0 and rescanning content to see if issue still present

abs0 commented 5 months ago

I think the issue is the app exiting on Android on any MySQL error - whether on startup or later - see #25353