Bug 26559

Summary: koha-create fails to upgrade database
Product: Koha Reporter: Magnus Enger <magnus>
Component: PackagingAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

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.