Bug 37971

Summary: Database access error during upgrade 24.05
Product: Koha Reporter: Md Monirul <mdmiansarilib>
Component: DatabaseAssignee: Bugs List <koha-bugs>
Status: CLOSED WORKSFORME QA Contact: Testopia <testopia>
Severity: critical    
Priority: P1 - high CC: magnus, martin.renvoize
Version: 24.05   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: snapshot of terminal
koha-mysql monirul

Description Md Monirul 2024-09-20 05:05:28 UTC
Created attachment 171818 [details]
snapshot of terminal

During an upgrade of Koha to version 24.05.03-1, the process failed due to a database access error. The upgrade script was unable to connect to the MySQL/MariaDB database, suggesting a potential issue with database permissions or configuration.

Steps to Reproduce:

Attempt to upgrade Koha-common package to version 24.05.03-1
Run sudo apt-get install mariadb-server
Confirm the installation/upgrade process

Observed Behavior:

The upgrade process fails during the database schema upgrade step
An error message indicates that access is denied for the Koha database user

Error Message:
"DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: DBI connect('database=koha_monirul;host=localhost;port=3306','koha_monirul',...) failed: Access denied for user 'koha_monirul'@'localhost' (using password: YES) at /usr/share/koha/lib/Koha/Database.pm line 91. at /usr/share/koha/lib/Koha/Database.pm line 139"

Environment:

Koha version being upgraded to: 24.05.03-1
Database: MariaDB (version 1:10.11.8-0ubuntu0.24.04.1)
Operating System: Ubuntu (likely 24.04 based on package versions)
Comment 1 Magnus Enger 2024-09-20 06:17:14 UTC
Does this work for you? 

sudo koha-mysql monirul
Comment 2 Md Monirul 2024-09-20 08:30:33 UTC
I have solved the prevuious problem, its happend because of the mismatch with the username and passowrd in MySQL and username and password in koha-conf.xml , After I changed my password in both location, the error has been solved. 

But Koha webpage is not loading, rather showing this error,
"BEGIN failed--compilation aborted at /usr/share/koha/lib/C4/Koha.pm line 25.
Compilation failed in require at /etc/koha/plack.psgi line 29.
BEGIN failed--compilation aborted at /etc/koha/plack.psgi line 29.
Child process 161801 exited with status 13
I/O error : Permission denied
I/O error : Permission denied
Error while loading /etc/koha/plack.psgi: 
Error reading file /etc/koha/sites/monirul/koha-conf.xml.
Try running this again as the koha instance user (or use the koha-shell command in debian)

"
Comment 3 Md Monirul 2024-09-20 08:50:46 UTC
Created attachment 171823 [details]
koha-mysql monirul
Comment 4 Magnus Enger 2024-09-23 06:18:17 UTC
I think this was solved on Mattermost?