Bug 22527

Summary: Web installer links to wrong database manual when database user doesn't have required privileges
Product: Koha Reporter: Lari Taskula <lari.taskula>
Component: Installation and upgrade (web-based installer)Assignee: Liz Rea <wizzyrea>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, hayleypelham, jonathan.druart, katrin.fischer, lucas, magnus, martin.renvoize, nick, wizzyrea
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.06
Attachments: Bug 22527: Fix link to wrong database manual in web installer
Bug 22527: Enhance visibility of error message
Bug 22527: Fix link to wrong database manual in web installer
Bug 22527: Enhance visibility of error message
Bug 2527: web installer links to outdated DB manual
Bug 22527: web installer links to outdated DB manual
Bug 22527: web installer links to outdated DB manual
Bug 22527: Remove extra space after '?'
Bug 22527: (RM follow-up) Add filter

Description Lari Taskula 2019-03-16 00:00:22 UTC
To reproduce:
1. Use MySQL or MariaDB for your Koha installation
2. Create an empty database and point $KOHA_CONF to this database name.
3. Grant SELECT privilege to your database user, e.g.
     grant select on koha3.* to 'koha'@'%' identified by 'koha';
4. Go to step 2 of web installer where it checks database connection
5. Observe the following message

User koha doesn't have enough privilege on database koha.

Ask for or make a change in the user's privileges. User koha must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on database koha2.

Need help? See manual for PostgreSQL

6. Note "See manual for PostgreSQL" is wrong. Should be "See manual for MySQL".
Comment 1 Lari Taskula 2019-03-16 00:16:55 UTC
Created attachment 86698 [details] [review]
Bug 22527: Fix link to wrong database manual in web installer

To reproduce:
1. Use MySQL or MariaDB for your Koha installation
2. Create an empty database and point $KOHA_CONF to this database name.
3. Grant SELECT privilege to your database user, e.g.
     grant select on koha3.* to 'koha'@'%' identified by 'koha';
4. Go to step 2 of web installer where it checks database connection
5. Observe the following message

User koha doesn't have enough privilege on database koha.

Ask for or make a change in the user's privileges. User koha must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on database koha2.

Need help? See manual for PostgreSQL

6. Note "See manual for PostgreSQL" is wrong. Should be "See manual for MySQL".
7. Apply patch
8. Refresh page and observe it now displays correct link

Sponsored-by: Hypernova Oy
Comment 2 Lari Taskula 2019-03-16 00:18:18 UTC
Created attachment 86699 [details] [review]
Bug 22527: Enhance visibility of error message

Place database user privilege issue into a yellow box to enhance visilibty.

Sponsored-by: Hypernova Oy
Comment 3 Liz Rea 2019-04-08 19:18:57 UTC
Created attachment 87550 [details] [review]
Bug 22527: Fix link to wrong database manual in web installer

To reproduce:
1. Use MySQL or MariaDB for your Koha installation
2. Create an empty database and point $KOHA_CONF to this database name.
3. Grant SELECT privilege to your database user, e.g.
     grant select on koha3.* to 'koha'@'%' identified by 'koha';
4. Go to step 2 of web installer where it checks database connection
5. Observe the following message

User koha doesn't have enough privilege on database koha.

Ask for or make a change in the user's privileges. User koha must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on database koha2.

Need help? See manual for PostgreSQL

6. Note "See manual for PostgreSQL" is wrong. Should be "See manual for MySQL".
7. Apply patch
8. Refresh page and observe it now displays correct link

Sponsored-by: Hypernova Oy

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 4 Liz Rea 2019-04-08 19:19:00 UTC
Created attachment 87551 [details] [review]
Bug 22527: Enhance visibility of error message

Place database user privilege issue into a yellow box to enhance visilibty.

Sponsored-by: Hypernova Oy

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 5 Katrin Fischer 2019-04-08 23:29:03 UTC
*** Bug 22366 has been marked as a duplicate of this bug. ***
Comment 6 Hayley Pelham 2019-04-08 23:36:12 UTC
(In reply to Katrin Fischer from comment #5)
> *** Bug 22366 has been marked as a duplicate of this bug. ***

Do we want the default of this link to be PostgreSQL? For instance, if the user is not using a MySQL database but for some reason is also not using a PostgreSQL database, they will still be pointed to the PostgreSQL manual. This could be confusing for first time users. Is this a case that could feasibly occur? I don't know enough about the types of databases that people use with Koha.
Comment 7 Katrin Fischer 2019-04-08 23:39:44 UTC
(In reply to Hayley Mapley from comment #6)
> (In reply to Katrin Fischer from comment #5)
> > *** Bug 22366 has been marked as a duplicate of this bug. ***
> 
> Do we want the default of this link to be PostgreSQL? For instance, if the
> user is not using a MySQL database but for some reason is also not using a
> PostgreSQL database, they will still be pointed to the PostgreSQL manual.
> This could be confusing for first time users. Is this a case that could
> feasibly occur? I don't know enough about the types of databases that people
> use with Koha.

I think the only databases Koha currently supports are MariaDB and MySQL - PostgreSQL support is not functional, but I think it was once an option or work had been started on it.

Lari, could you comment too please? 

Will this work for MariaDB?
Comment 8 Liz Rea 2019-04-09 17:42:38 UTC
MariaDB and MySQL are not significantly different in this regard. 

To be fair, we could omit the link entirely, and tell them what to search for for their chosen DBMS. 

For example:

For help with granting permissions, please search for $DBMS manual grant permissions 

or something like.

Or we could not say anything at all, and expect that working with DBMS systems is something lots of people should know how to do, or that they have an IT professional somewhere up the chain they can ask who knows what to search for. This is, I feel, a less nice way to go about it but it would keep us from having to maintain this external connection (I mean, we link to MySQL manual version 4.1 - that's really old!)
Comment 9 Katrin Fischer 2019-04-09 18:17:24 UTC
I think Liz makes a good point about the link to the MySQL manual being quite old. Maybe having a generic message would be the best way to go here.
Comment 10 Liz Rea 2019-04-16 15:22:00 UTC
Created attachment 88084 [details] [review]
Bug 2527: web installer links to outdated DB manual

To reproduce:
1. Use MySQL or MariaDB for your Koha installation
2. Create an empty database and point $KOHA_CONF to this database name.
3. Grant SELECT privilege to your database user, e.g.
grant select on koha3.* to 'koha'@'%' identified by 'koha';
4. Go to step 2 of web installer where it checks database
connection
5. Observe the following message

     User koha doesn't have enough privilege on database koha.

     Ask for or make a change in the user's privileges. User koha must
     have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on
     database koha2.

     Need help? See manual for PostgreSQL

6. Note "See manual for PostgreSQL" is wrong. Should now read Need help?
For help with granting permissions, please search online for "[%
dbms %] manual grant permissions" of course the dbms should be the dbms
you are using.
7. Apply patch, restart all
8. Refresh page and observe it now displays correct link

Test plan and original patchset by Lari Taskula <lari.taskula@hypernova.fi>

Sponsored-by: Hypernova Oy
Comment 11 Hayley Pelham 2019-05-02 02:43:02 UTC
Created attachment 89198 [details] [review]
Bug 22527: web installer links to outdated DB manual

To reproduce:
1. Use MySQL or MariaDB for your Koha installation
2. Create an empty database and point $KOHA_CONF to this database name.
3. Grant SELECT privilege to your database user, e.g.
grant select on koha3.* to 'koha'@'%' identified by 'koha';
4. Go to step 2 of web installer where it checks database
connection
5. Observe the following message

     User koha doesn't have enough privilege on database koha.

     Ask for or make a change in the user's privileges. User koha must
     have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on
     database koha2.

     Need help? See manual for PostgreSQL

6. Note "See manual for PostgreSQL" is wrong. Should now read Need help?
For help with granting permissions, please search online for "[%
dbms %] manual grant permissions" of course the dbms should be the dbms
you are using.
7. Apply patch, restart all
8. Refresh page and observe it now displays correct link

Test plan and original patchset by Lari Taskula <lari.taskula@hypernova.fi>

Sponsored-by: Hypernova Oy

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Comment 12 Jonathan Druart 2019-05-06 16:23:12 UTC
Created attachment 89374 [details] [review]
Bug 22527: web installer links to outdated DB manual

To reproduce:
1. Use MySQL or MariaDB for your Koha installation
2. Create an empty database and point $KOHA_CONF to this database name.
3. Grant SELECT privilege to your database user, e.g.
grant select on koha3.* to 'koha'@'%' identified by 'koha';
4. Go to step 2 of web installer where it checks database
connection
5. Observe the following message

     User koha doesn't have enough privilege on database koha.

     Ask for or make a change in the user's privileges. User koha must
     have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on
     database koha2.

     Need help? See manual for PostgreSQL

6. Note "See manual for PostgreSQL" is wrong. Should now read Need help?
For help with granting permissions, please search online for "[%
dbms %] manual grant permissions" of course the dbms should be the dbms
you are using.
7. Apply patch, restart all
8. Refresh page and observe it now displays correct link

Test plan and original patchset by Lari Taskula <lari.taskula@hypernova.fi>

Sponsored-by: Hypernova Oy

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2019-05-06 16:23:16 UTC
Created attachment 89375 [details] [review]
Bug 22527: Remove extra space after '?'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Jonathan Druart 2019-05-06 16:24:29 UTC
Nick, not sure about the 2 spaces after '?'. I let you decide (and  squash!)
Comment 15 Nick Clemens 2019-05-07 11:45:34 UTC
Awesome work all!

Included second patch and squashed

Pushed to master for 19.05
Comment 16 Nick Clemens 2019-05-07 15:58:10 UTC
Created attachment 89452 [details] [review]
Bug 22527: (RM follow-up) Add filter
Comment 17 Martin Renvoize 2019-05-08 15:44:47 UTC
Pushed to 18.11.x for 18.11.06
Comment 18 Lucas Gass 2019-05-30 14:22:40 UTC
backported to 18.05.x for 18.05.13