Bug 11000 - koha-restore not working: Koha username error
Summary: koha-restore not working: Koha username error
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: 16.05
Hardware: All All
: P3 normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-04 20:12 UTC by Pablo AB
Modified: 2020-01-06 20:15 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo AB 2013-10-04 20:12:57 UTC
koha-restore without previously removing the instance give 78 links of "ERROR: File exists:" and that’s more or less expected, but:
koha-remove myInstance
(OK)
Then:
koha-restore /var/spool/koha/myInstance/myInstance-2013-09-23.sql.gz  /var/spool/koha/myInstance/myInstance-2013-09-23.tar.gz  
ERROR: File exists: /var/lib/koha/myInstance/
ERROR: File exists: /var/lib/koha/myInstance/.bash_history
ERROR: File exists: ....
[total 44 lines]

ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_myInstance'@'%'
DBI connect('dbname=koha_myInstance;host=localhost;port=3306','koha_myInstance',...) failed: Access denied for user 'koha_myInstance'@'localhost' (using password: YES) at /usr/share/koha/lib/C4/Context.pm line 803
Access denied for user 'koha_myInstance'@'localhost' (using password: YES) at /usr/share/koha/lib/C4/Context.pm line 803.
Something went wrong rebuilding biblio indexes for myInstance
DBI connect('dbname=koha_myInstance;host=localhost;port=3306','koha_myInstance',...) failed: Access denied for user 'koha_myInstance'@'localhost' (using password: YES) at /usr/share/koha/lib/C4/Context.pm line 803
Access denied for user 'koha_myInstance'@'localhost' (using password: YES) at /usr/share/koha/lib/C4/Context.pm line 803.
Something went wrong rebuilding authority indexes for myInstance
[ ok ] Restarting web server: apache2 ... waiting .

I fix this just with:
GRANT ALL PRIVILEGES ON `koha_myInstance` . * TO 'koha_myInstance'@'localhost';
and running again the previous command, but is very scary to erase and not being able to restore an instance...
Comment 1 Pablo AB 2013-10-04 20:28:14 UTC
This probably is duplicated or related to bug 10517.
Comment 2 Karam Qubsi 2016-06-28 13:58:27 UTC
Hi , I faced the same problem today as described by Pablo AB

I'm using ubuntu 14.04 LTS , 

I encountered with the problem first with koha 16.05.00 package installation  , them I upgraded to koha 16.05.01  (also package ) , and the same problem , 

I tried to restore the instance in other server with the same condition and the same problem is there , 

sudo koha-restore myInstanceName-2016-06-28.sql.gz myInstanceName-2016-06-28.tar.gz
ERROR: File exists: /var/lib/koha/myInstanceName/
ERROR: File exists: /var/lib/koha/myInstanceName/biblios/
ERROR: File exists: /var/lib/koha/myInstanceName/biblios/key/
ERROR: File exists: /var/lib/koha/myInstanceName/biblios/register/
ERROR: File exists: /var/lib/koha/myInstanceName/biblios/tmp/
ERROR: File exists: /var/lib/koha/myInstanceName/biblios/shadow/
ERROR: File exists: /var/lib/koha/myInstanceName/uploads/
ERROR: File exists: /var/lib/koha/myInstanceName/authorities/
ERROR: File exists: /var/lib/koha/myInstanceName/authorities/key/
ERROR: File exists: /var/lib/koha/myInstanceName/authorities/register/
ERROR: File exists: /var/lib/koha/myInstanceName/authorities/tmp/
ERROR: File exists: /var/lib/koha/myInstanceName/authorities/shadow/
ERROR: File exists: /var/lib/koha/myInstanceName/plugins/
ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_myInstanceName'@'%'
ERROR 1046 (3D000) at line 2: No database selected
Warning: You passed -x which is already the default and is now deprecated·
DBI connect('database=koha_myInstanceName;host=localhost;port=3306','koha_myInstanceName',...) failed: Access denied for user 'koha_myInstanceName'@'%' to database 'koha_myInstanceName' at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1395.
DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_myInstanceName'@'%' to database 'koha_myInstanceName' at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1398. at /usr/share/koha/lib/Koha/Database.pm line 90
Something went wrong rebuilding biblio indexes for myInstanceName
DBI connect('database=koha_myInstanceName;host=localhost;port=3306','koha_myInstanceName',...) failed: Access denied for user 'koha_myInstanceName'@'%' to database 'koha_myInstanceName' at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1395.
DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_myInstanceName'@'%' to database 'koha_myInstanceName' at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1398. at /usr/share/koha/lib/Koha/Database.pm line 90
Something went wrong rebuilding authority indexes for myInstanceName
 * Restarting web server apache2                                                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
                                                                         [ OK ]
karam@ubuntu-1gb-lon1-USIM:~/myInstanceName2$ sudo koha-remove myInstanceName
Removing Koha instance myInstanceName
Zebra already stopped for instance myInstanceName.
 * Restarting web server apache2                                                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Comment 3 Karam Qubsi 2016-07-01 00:22:25 UTC
Update : Tested on Debian 8.5 . Koha 16.05.01 (packages )  there is no problem , it is just  ubuntu problem .
Comment 4 Rudolf Byker 2019-05-10 09:55:56 UTC
As far as I can see, this is fixed. Shall we close the issue?
Comment 5 Katrin Fischer 2019-05-10 18:46:41 UTC
(In reply to Rudolf Byker from comment #4)
> As far as I can see, this is fixed. Shall we close the issue?