Bug 38603 - Error 500 when creating, or editing sql in reports
Summary: Error 500 when creating, or editing sql in reports
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: 24.05
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-03 11:21 UTC by shalini
Modified: 2025-12-15 19:57 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
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 shalini 2024-12-03 11:21:34 UTC
cgi-bin/koha/reports/guided_reports.pl?op=add_form_sql
This page throws the following error when the option create from SQL is selected, or while editing existing saved reports :
An error has occurred!
Error 500
This message may have been caused by any of the following reasons:
You made use of an external link to an item that is no longer available
You followed an outdated link e.g. from a search engine or a bookmark
You tried to access a page that needs authentication
An internal link in the client is broken and the page does not exist
What's next?
Use top menu bar to navigate to another part of Koha.
To report a broken link or any other issue, please contact the Koha administrator. Send email
Comment 1 Owen Leonard 2024-12-03 12:25:51 UTC
I cannot reproduce this problem in 24.05.00. The error message you shared is a generic one with no technical information which could help identify the problem. Do you have access to your server logs?
Comment 2 shalini 2024-12-03 14:57:57 UTC
I moved old koha 18 database to koha 24.05 new installation. Everything seems to be working fine except for the reports.
here is the log opac-error.log.
[Tue Dec 03 09:16:30.033642 2024] [cgi:error] [pid 5232] [client 172.16.60.218:50190] AH01215: Use of uninitialized value $branch_limit in concatenation (.) or string at /usr/share/koha/lib/C4/Koha.pm line 493.: /usr/share/koha/opac/cgi-bin/opac/opac-search.pl, referer: https://koha24.kis.in/
[Tue Dec 03 09:17:01.591757 2024] [cgi:error] [pid 5498] [client 172.16.60.218:50209] AH01215: Use of uninitialized value $stored_hash in string eq at /usr/share/koha/lib/C4/Auth.pm line 2118.: /usr/share/koha/opac/cgi-bin/opac/opac-user.pl, referer: https://koha24.kis.in/cgi-bin/koha/opac-search.pl?idx=&q=math&weight_search=1
[Tue Dec 03 09:17:01.591979 2024] [cgi:error] [pid 5498] [client 172.16.60.218:50209] AH01215: Use of uninitialized value $stored_hash in substr at /usr/share/koha/lib/C4/Auth.pm line 2122.: /usr/share/koha/opac/cgi-bin/opac/opac-user.pl, referer: https://koha24.kis.in/cgi-bin/koha/opac-search.pl?idx=&q=math&weight_search=1
[Tue Dec 03 09:17:01.592084 2024] [cgi:error] [pid 5498] [client 172.16.60.218:50209] AH01215: Use of uninitialized value $stored_hash in string eq at /usr/share/koha/lib/C4/Auth.pm line 2127.: /usr/share/koha/opac/cgi-bin/opac/opac-user.pl, referer: https://koha24.kis.in/cgi-bin/koha/opac-search.pl?idx=&q=math&weight_search=1
[Tue Dec 03 09:17:23.771541 2024] [cgi:error] [pid 5564] [client 172.16.60.218:50211] AH01215: Use of uninitialized value $stored_hash in string eq at /usr/share/koha/lib/C4/Auth.pm line 2118.: /usr/share/koha/opac/cgi-bin/opac/opac-user.pl, referer: https://koha24.kis.in/cgi-bin/koha/opac-user.pl
[Tue Dec 03 09:17:23.771736 2024] [cgi:error] [pid 5564] [client 172.16.60.218:50211] AH01215: Use of uninitialized value $stored_hash in substr at /usr/share/koha/lib/C4/Auth.pm line 2122.: /usr/share/koha/opac/cgi-bin/opac/opac-user.pl, referer: https://koha24.kis.in/cgi-bin/koha/opac-user.pl
[Tue Dec 03 09:17:23.771863 2024] [cgi:error] [pid 5564] [client 172.16.60.218:50211] AH01215: Use of uninitialized value $stored_hash in string eq at /usr/share/koha/lib/C4/Auth.pm line 2127.: /usr/share/koha/opac/cgi-bin/opac/opac-user.pl, referer: https://koha24.kis.in/cgi-bin/koha/opac-user.pl
thank you for your support
Comment 3 Katrin Fischer 2024-12-03 14:59:49 UTC
(In reply to shalini from comment #2)
> I moved old koha 18 database to koha 24.05 new installation. Everything
> seems to be working fine except for the reports.
> here is the log opac-error.log.
> [Tue Dec 03 09:16:30.033642 2024] [cgi:error] [pid 5232] [client
> 172.16.60.218:50190] AH01215: Use of uninitialized value $branch_limit in
> concatenation (.) or string at /usr/share/koha/lib/C4/Koha.pm line 493.:
> /usr/share/koha/opac/cgi-bin/opac/opac-search.pl, referer:
> https://koha24.kis.in/

This is the wrong log file as it's the OPAC log.

Try: tail -f /var/log/koha/<nameofyourinstance>/*.log and reproduce the error.
Comment 4 shalini 2024-12-03 15:28:51 UTC
[Tue Dec 03 15:25:56.536699 2024] [cgi:error] [pid 21865] [client 10.11.26.91:63133] AH01215: main::get_tables(): DBI Exception: DBD::mysql::db selectall_arrayref failed: View 'koha_library.StatisticsView' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them at /usr/share/koha/intranet/cgi-bin/reports/guided_reports.pl line 766: /usr/share/koha/intranet/cgi-bin/reports/guided_reports.pl, referer: https://koha24.kis.in:8080/cgi-bin/koha/reports/reports-home.pl
[Tue Dec 03 15:25:56.592395 2024] [cgi:error] [pid 21865] [client 10.11.26.91:63133] End of script output before headers: guided_reports.pl, referer: https://koha24.kis.in:8080/cgi-bin/koha/reports/reports-home.pl
[Tue Dec 03 15:27:01.734713 2024] [cgi:error] [pid 21917] [client 10.11.26.91:63142] AH01215: main::get_tables(): DBI Exception: DBD::mysql::db selectall_arrayref failed: View 'koha_library.StatisticsView' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them at /usr/share/koha/intranet/cgi-bin/reports/guided_reports.pl line 766: /usr/share/koha/intranet/cgi-bin/reports/guided_reports.pl, referer: https://koha24.kis.in:8080/cgi-bin/koha/reports/reports-home.pl
[Tue Dec 03 15:27:01.789365 2024] [cgi:error] [pid 21917] [client 10.11.26.91:63142] End of script output before headers: guided_reports.pl, referer: https://koha24.kis.in:8080/cgi-bin/koha/reports/reports-home.pl

Here is it.
Thanks
Comment 5 Katrin Fischer 2024-12-03 16:32:08 UTC
Have you changed the database structure of your Koha like adding tables or views?

koha_library.StatisticsView doesn't exist in a standard installation and views are not in use.
Comment 6 shalini 2024-12-03 16:52:15 UTC
Yes,  but those are meant for the koha interface. Those are used by our intranet site. 
Why is this happening when I try to create a sql? Why is the form not getting displayed?
https://koha24.kis.in:8080/cgi-bin/koha/reports/guided_reports.pl?op=add_form_sql
Thanks
Comment 7 shalini 2024-12-03 18:02:22 UTC
Thank you so much. I deleted the table and that resolved the issue.