Bug 26559 - koha-create fails to upgrade database
Summary: koha-create fails to upgrade database
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-29 08:23 UTC by Magnus Enger
Modified: 2023-06-08 22:26 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2020-09-29 08:23:18 UTC
When I run koha-create, with DEFAULTSQL set to the path of an existing database dump, I get an error when it tries to upgrade the database:

$ sudo koha-create --create-db --letsencrypt --configfile student.conf mykoha
staff user password is '***' but keep that secret
Upgrading database schema for mykoha
DBI connect('database=koha_mykoha;host=localhost;port=3306','koha_mykoha',...) failed: Access denied for user 'koha_mykoha'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_mykoha'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1520. at /usr/share/koha/lib/Koha/Database.pm line 116

After this, the Apache config file is created at /etc/apache2/sites-available/mykoha.conf, but the symlink at /etc/apache2/sites-enabled/mykoha.conf is not created. 

I can run koha-mysql and get access to the database, where the data from DEFAULTSQL has been loaded. 

If I comment out line 734 of koha-create:

 koha-upgrade-schema "$name"

things run as expected, and the Apache config symlink is created.
Comment 1 Magnus Enger 2022-09-26 08:26:56 UTC
This was probably a local thing, since more people have not run into it.