https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43080

            Bug ID: 43080
           Summary: API not functional if Koha::Database->dbh can't
                    connect at app startup time
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: REST API
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]
  Target Milestone: ---

I noticed earlier today that Koha started up despite API setup errors due to
Koha::Database->dbh being unable to connect to the database (during some
automated updates).

X/plack-api-error.log:[2026/07/15 04:52:43] [ERROR] Warning: Could not load
REST API spec bundle: DBIx::Class::Storage::DBI::catch {...} (): DBI Connection
failed: DBI connect(<DEETS>,...) failed: Can't connect to MySQL server on
'SERVER:3306' (111) at /usr/share/koha/lib/Koha/Database.pm line 75. at
/usr/share/koha/lib/Koha/Database.pm line 125
X/plack-api-error.log:[2026/07/15 04:52:45] [ERROR] Warning: Could not load
REST API spec bundle: DBIx::Class::Storage::DBI::catch {...} (): DBI Connection
failed: DBI connect(<DEETS>,...) failed: Can't connect to MySQL server on
'SERVER:3306' (111) at /usr/share/koha/lib/Koha/Database.pm line 75. at
/usr/share/koha/lib/Koha/Database.pm line 125

Looking at Koha/REST/V1.pm it looks like we catch the errors but we don't do
anything if the spec fails to load completely. 

It might be worthwhile to check the error being thrown in the try/catch and
maybe die /rethrow if it is a database connection issue.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to