9.0.1 and MySQL/MariaDB

Thanks a lot!

To which exact version of MariaDB 10 did you update?
MariaDB <= 10.1.x isn’t supported by Kodi anymore.
You should at least install 10.2 or better 10.3.x.

Good point @relkai. I am running 10.3.7-MariaDB, so that should be fine. However, the issues I am experiencing now is the same as when I was running on MariaDB 5 also.

Thanks for checking though!

Kodi for windows also provides a kodi.old log file, which is stored from the session before the actual running session. Maybe CE and LE also have this, but I have not found it. Anyway, since the behavior in all platforms are the same, I had a look on the kodi.old logfile, and every time I get the same message on the last line:
“2019-03-17 15:51:23.651 T:2228 ERROR: XFILE::CDirectory::GetDirectory - Error getting”

I know that is might be connected to addons and missing components, and that there have been other support cases where the user have installed these gray zone addons. This is not the case here though, I have only activated Spiffs RAR support addon, the Kodi Log Uploader and the Video Database cleaner (which didnt solve the issue).

I have raised a question regarding this mysql thing on the Kodi Forum. I do not really know who to turn to for this issue…

08:59:36.364 T:140650557196032 ERROR: GetDirectory - Error getting

This seems irrelevant because I have this message too when I open Movies section.

Okay, maybe I saw what I wanted to see. A bit suspicious that I always get this error, even-though I don’t do anything in Kodi, just idle and wait for it to hit the trigger to forces it to close.

Strange is that restart actually triggers problems? When you did clean install (ie. Kodi creates DB just fine). Then whatever time everything works as it should?

Did you try not to change anything between restarts? I mean, before using db, you have clean advanced settings. When you setup mySQL DB, kodi do its job after first restart, and from CE point of view, there is no need to modify anything afterwards… After restart, there is just need to have DB running, accesible (correct user permission and opened ports), and all should be just same as after clean installation… If MySQL doesnt run on CE, it should be in fact exactly same req. as requirements for the clean install…

Dunno your MySQL settings, I am using vPeters defaults with no problems and its like this:

#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]

#
# * Basic Settings
#
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
lc-messages-dir	= /usr/share/mysql
skip-external-locking

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address		= 0.0.0.0

#
# * Fine Tuning
#
key_buffer_size		= 16M
max_allowed_packet	= 16M
thread_stack		= 192K   
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam_recover_options  = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10


#default-storage-engine  = innodb 
skip-name-resolve

# Kodi needs more for library (256K should probably be enough)
#thread_stack = 384K 

#
# * Query Cache Configuration
#
query_cache_limit	= 1M
query_cache_size        = 16M

#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Enable the slow query log to see queries with especially long duration
#slow_query_log_file	= /var/log/mysql/mariadb-slow.log
#long_query_time = 10
#log_slow_rate_limit	= 1000
#log_slow_verbosity	= query_plan
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id		= 1
#log_bin			= /var/log/mysql/mysql-bin.log
expire_logs_days	= 10
max_binlog_size   = 100M
#binlog_do_db		= include_database_name
#binlog_ignore_db	= exclude_database_name

#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!

innodb_empty_free_list_algorithm = legacy

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /storage/.mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /storage/.mysql

# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 25M  (134MB MariaDB)
#innodb_additional_mem_pool_size = 2M  (8MB MariaDB)

# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 2M     (50 MB MariaDB)
#innodb_log_buffer_size = 8M   (16 MB MariaDB)


#innodb_flush_log_at_trx_commit = 1  (1 MariaDB)
#innodb_lock_wait_timeout = 50      (deprecated in  MariaDB)


#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates you can use for example the GUI tool "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
#
# Accept only connections using the latest and most secure TLS protocol version.
# ..when MariaDB is compiled with OpenSSL:
# ssl-cipher=TLSv1.2
# ..when MariaDB is compiled with YaSSL (default in Debian):
# ssl=on

#
# * Character sets
#
# MySQL/MariaDB default is Latin1, but in Debian we rather default to the full
# utf8 4-byte character set. See also client.cnf
#
character-set-server  = utf8mb4
collation-server      = utf8mb4_general_ci

#
# * Unix socket authentication plugin is built-in since 10.0.22-6
#
# Needed so the root database user can authenticate without a password but
# only when running as the unix root user.
#
# Also available for other users if required.
# See https://mariadb.com/kb/en/unix_socket-authentication-plugin/

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

# This group is only read by MariaDB-10.1 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.1]

I leave comments just for completness, actually there is very few modification from default for the Kodi purposes. Some of commented lines are from previous MySQL, tuned for Rpi resources, but not needed in this one installation, as its running on my router and MariaDB has already bigger defaults. Long story short, dont pay attention to commented lines, as you have running MySQL on NAS, you shouldnt need tuning for Rpi/small device server purposes, I have those lines commented for other installations (on C2 for example] on other envs.

P.S.: My DB’s was created with one of previous versions, not Kodi 18.1. I hardly doubt there is something broken in Kodi itself on that behalf, but worth mention.

Thanks for your response @JimmyS!

Well, actually the issue triggers the restart. As you say, everything works as expected when starting with a clean database, all tables are populated as one could expect. The problems start the second time, as you say, when the DB should just be running in order to work. But this apparently just break thing. The even more strange thing is that it worked flawlessly previously. From one day to the other, it just stopped working and instead forcing Kodi clients to close or restart.
I am having both media and my mariadb running on a Synology NAS, of course with ports (3306/3307) forwarded…

Just tried from the beginning, again, with clean database (mariadb10) with NFS-sources. Started with Movies. It went fine, as it usually do. Restarted the application to see if I could reproduce, but it worked fine. Continued with TV Shows. Worked fine as well.

It was first when I started to mark episodes as Watched that the application crashed. But Watch state is just a column (C08) on episode view in the episodeview table in SQL. I really don’t think this is a access issue, apparently I have sufficient access to the database, since I can write to it, but also since it worked great until I started to mark episodes as watched. Will test some more

Just and idea: Try to install MariaDB addon to have SQL server locally. Just for a test to see if server is the problem.

Yes, I will definetly do that, first thing when I come home and the kids have went to bed!! I will keep you posted.

I guess it is located in the standard repo, @vpeter ?

In CoreELEC addons repo.

Sorry, yes, that was what I meant! Thanks

Hi @vpeter. A
Is there a wiki for this addon? I would like to consult it. :wink:

It is installed on one CE box, but I would like to read a bit about it, like IP-adress to the database (probably 127.x.x.x?)

No, there is no wiki for it :slight_smile:

In addon settings remember kodi user password or change it.
In kodi use real IP address not 127.x.x.x.

Okay, so just add an advancedsetting containing mysql info, with ipadress of the box?

Exactly like that. And use same advancedsettings.

Sorry for the noob questions, just wanted to make sure! :joy:

Sorry @vpeter, I am not sure how to use the passwords provided by the addon. I have got passwords for root and for kodi.

Use random password generated by addon or change it to something more simple (like kodi :slight_smile: ).

Okay, so if change to kodi on both rows, I can use kodi as a user and kodi as password? Or what is the deafult username?