Vue lecture

Patron searches give 500 error

Problem statement: The following error message when searching for patron names.

Something went wrong when loading the table.
500: Internal Server Error. 
Month out of range.
Month out of range.
Month out of range.
Month out of range
.

Reason: The date_renewed column has some proper dates, some NULLs and some 0000-00-00.

Solution: Uupdate borrowers set date_renewed = NULL where date_renewed = '0000-00-00'. Enter into the MariaDB and apply the following commands,

sudo mysql -uroot -p
use koha_library;
UPDATE borrowers
SET date_renewed = NULL;

Idea courtesyMahesh Palamuttath

Reference


  •  

Fix MySQL/MariaDB socket error

Socket file helps to facilitate communication between different processes of the MySQL and MariaDB server. The file associated with the process is, mysqld.sock and is located at the folder, /var/run/mysqld/. Due to many reasons, MariaDB cannot establish a connection with the socket file. Sometimes socket files are missing from the location. It results in the stopping of the MariaDB service. The problem with the socket file also affects the working of Koha. Often Koha screen shows the following error on the screen.

Possible solutions

We can try to apply three solutions to evoke socket files; restarting the MariaDB service, changing user permissions, and reinstalling MariaDB. 

Solution 1: Try to restart the MariaDB service and check whether it's working.

sudo systemctl start mariadb

Refresh the Koha page. If it works, it means the socket file works. If it does not open, we go to the next solution.

Solution 2: Next, we will check whether the mysqld. sock file missing or not. Apply the following command,

ls -a /var/run/mysqld

The file is there, we can see a file with the name, mysqld.sock. If the file is missing from there, the reason may be that MariaDB has no proper permissions to create it. Give the directory permission to MariaDB users to make necessary changes.

sudo chown mysql:mysql /var/run/mysqld/
sudo chmod -R 755 /var/run/mysqld/

Restart the MariaDB service,

sudo systemctl restart mysql

If it is reluctant to start the service and shows the error, find other ways to solve it. The last resort is to reinstall the MariaDB.

Solution 3: Reinstall MariaDB

The first step is the uninstall the MariaDB without removing the Koha databases  (e.g. koha_library). The default location of the data directory of MariaDB is at /var/lib/mysql/, where we can see the Koha database directory.

The location of MariaDB data directory, /var/lib/mysql/
Apply the following commands to uninstall MariaDB,

sudo apt purge "mariadb*" -y

When it asks for deleting databases, give the answer No. It will retain the Koha database.

Apply the following command to remove unwanted packages after the uninstallation of MariaDB.
sudo apt autoremove -y

Apply the following command to reinstall the MariaDB,

sudo apt-get install mariadb-server mariadb-client

I faced the socket problem with MariaDB 10.3 on Ubuntu 20.04. I used the opportunity and installed a higher version of MariaDB (10.04) by adding a repository. The download page in the MariaDB home page gives you instructions to install a higher version of the package. Please check it, https://mariadb.org/download/?t=repo-config

After the successful installation of MariaDB, open the Koha Staff Client and check the page loads or not.

References

How To Troubleshoot Socket Errors in MySQL https://www.digitalocean.com/community/tutorials/how-to-troubleshoot-socket-errors-in-mysql

MariaDB installation - dependency problems and failed to start service https://mariadb.com/kb/en/mariadb-installation-dependancy-problems-and-failed-to-start-service/

  •  

Install MariaDB 10.4 on Debian 9 (Stretch)

Image courtesy: mariadb.org
Debian 9 (Stretch) software repository contains MariaDB 10.1. Version 10.1 is a little bit old. It's possible to install the latest version of MariaDB (version 10.3 or 10.4) on Debian 9 to get good database performance. Latest versions of MariaDB free from the auto-increment bug. This version is free from Here is the method to install MariaDB 10.4 on Debian 9 when preparing system for Koha installation. This method can apply for a fresh installation of Koha. Don't try this method to install MariaDB on an existing installation of Koha.

Install dirmngr

sudo apt-get install software-properties-common dirmngr

Importing the MariaDB GPG Public Key and install MariaDB
Apply following commands,

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://espejito.fder.edu.uy/mariadb/repo/10.4/debian stretch main'

sudo apt update

sudo apt-get install mariadb-server

Assign Root password for MySQL
If password asks during the installation process, enter the password in the window. Apply following command, if the password window did not appear during the installation,

sudo mysqladmin -u root password newpass

[Replace 'newpass' with your own new MySQL Root password]

References
https://mariadb.com/kb/en/library/installing-mariadb-deb-files/#importing-the-mariadb-gpg-public-key

https://downloads.mariadb.org/mariadb/repositories/#distro=Debian&distro_release=stretch--stretch&mirror=rise&version=10.4
  •