Rewrite of URLs, flushing all empty arguments
Hello all! New issue (in 22.05 here, but might be anywhere): https://somedomain.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm <https://v22-test-intranet.hapax.inlibro.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm>_&*branchcode=*&module=suggestions&code=ACCEPTED_ When somedomain is onto one of our debian box (bullseye, 11), the branchcode= disappears on landing. Be it on the connection page or letter.pl, we do not have the branchcode= anymore, and the code throws an error (branchcode being undefined) When running onto our laptops (Ubuntu) that doesn't happen. We have no custom RewriteRule, so I'm trying to figure out WHERE this rewrite comes from. All suggestions welcomed, Best regards, -- Philippe Blouin, Directeur de la technologie Tél.  : (833) 465-4276, poste 230 philippe.blouin@inLibro.com inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com>
There are many layers interacting here. First is apache recieving the request, where it passes through any apache modules that are loaded, then it's passed to cgi or fcgi (you haven't mentioned whether you have plack enabled, but you probably do), then it's passed to Koha's codebase. There could be version differences between Debian and Ubuntu in either Apache modules or Perl CGI/FCGI modules that would cause an empty get variable to be dropped. The perl module versions would be the first thing I'd check. On Wed, Jun 7, 2023 at 3:10âŻPM Philippe Blouin <philippe.blouin@inlibro.com> wrote:
Hello all!
New issue (in 22.05 here, but might be anywhere):
https://somedomain.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm <https://v22-test-intranet.hapax.inlibro.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm> *&branchcode=&module=suggestions&code=ACCEPTED*
When somedomain is onto one of our debian box (bullseye, 11), the branchcode= disappears on landing. Be it on the connection page or letter.pl, we do not have the branchcode= anymore, and the code throws an error (branchcode being undefined)
When running onto our laptops (Ubuntu) that doesn't happen.
We have no custom RewriteRule, so I'm trying to figure out WHERE this rewrite comes from.
All suggestions welcomed,
Best regards, -- Philippe Blouin, Directeur de la technologie
Tél. : (833) 465-4276, poste 230 philippe.blouin@inLibro.com inLibro | pour esprit libre | www.inLibro.com _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
-- Michael Hafen Washington County School District Technology Department Systems Analyst
First things first, Philippe, you havenât given enough information about the problem. For instance: http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED> &branchcode=&module=suggestions&code=ACCEPTED http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED> &module=suggestions&code=ACCEPTED On koha-testing-docker, which admittedly is a later version, neither of these raise an error, although the second link wonât work as expected. So you should look at the actual error message in your log, and try to work it out from there. It might be that itâs a known issue thatâs been fixed upstream already. Not sure what you mean by âthe connection pageâ. Is that the login screen for letter.pl or something else? When you say âthe branchcode= disappears on landingâ, itâs not clear what you mean. Take a look at the Network tab on your browser and see if there are any redirects. You can also increase the logging on your Apache to see what exactly itâs doing: https://httpd.apache.org/docs/2.4/mod/core.html#loglevel. Maybe that problem instance has some Javascript running that is interfering with the location URL. You can add breakpoints in your browser so that it pauses at certain points in the process of loading. My suggestion would be doing some hands-on troubleshooting. Work the problem. The truth is out there. David Cook Senior Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia Office: 02 9212 0899 Online: 02 8005 0595 From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Michael Hafen Sent: Thursday, 8 June 2023 7:17 AM To: Philippe Blouin <philippe.blouin@inlibro.com> Cc: koha-devel@lists.koha-community.org Subject: Re: [Koha-devel] Rewrite of URLs, flushing all empty arguments There are many layers interacting here. First is apache recieving the request, where it passes through any apache modules that are loaded, then it's passed to cgi or fcgi (you haven't mentioned whether you have plack enabled, but you probably do), then it's passed to Koha's codebase. There could be version differences between Debian and Ubuntu in either Apache modules or Perl CGI/FCGI modules that would cause an empty get variable to be dropped. The perl module versions would be the first thing I'd check. On Wed, Jun 7, 2023 at 3:10âŻPM Philippe Blouin <philippe.blouin@inlibro.com <mailto:philippe.blouin@inlibro.com> > wrote: Hello all! New issue (in 22.05 here, but might be anywhere): <https://v22-test-intranet.hapax.inlibro.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm> https://somedomain.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED When somedomain is onto one of our debian box (bullseye, 11), the branchcode= disappears on landing. Be it on the connection page or letter.pl <http://letter.pl> , we do not have the branchcode= anymore, and the code throws an error (branchcode being undefined) When running onto our laptops (Ubuntu) that doesn't happen. We have no custom RewriteRule, so I'm trying to figure out WHERE this rewrite comes from. All suggestions welcomed, Best regards, -- Philippe Blouin, Directeur de la technologie TĂ©l. : (833) 465-4276, poste 230 philippe.blouin@inLibro.com <mailto:philippe.blouin@inLibro.com> inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com> _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org <mailto:Koha-devel@lists.koha-community.org> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/ -- Michael Hafen Washington County School District Technology Department Systems Analyst
Hi David, Yes, connection being the login page. Any call to it with &variable=& will get see its empty variable get flushed, as you summarized with http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED> http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED> The fact that it's not just branchcode, but any toto= or whatever= that gets flushed, seem to point to an apache setting. BUT my question was really: is Koha doing it ? seems not, by your answers. Is Apache doing it by default (new version...), my googling doesn't point to that, obviously. No redirect/rewrite in network. But again, you're telling me it's not Koha, so I'll dig. PS yes, the second link doesn't work. We created a fix, but I didn't like it because I wanted to explore the root cause. Philippe Blouin, Directeur de la technologie Tél.  : (833) 465-4276, poste 230 philippe.blouin@inLibro.com inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com> On 2023-06-07 19:38, David Cook wrote:
First things first, Philippe, you havenât given enough information about the problem.
For instance:
http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED>
http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED>
On koha-testing-docker, which admittedly is a later version, neither of these raise an error, although the second link wonât work as expected. So you should look at the actual error message in your log, and try to work it out from there. It might be that itâs a known issue thatâs been fixed upstream already.
Not sure what you mean by âthe connection pageâ. Is that the login screen for letter.pl or something else?
When you say âthe branchcode= disappears on landingâ, itâs not clear what you mean. Take a look at the Network tab on your browser and see if there are any redirects. You can also increase the logging on your Apache to see what exactly itâs doing: https://httpd.apache.org/docs/2.4/mod/core.html#loglevel.
Maybe that problem instance has some Javascript running that is interfering with the location URL. You can add breakpoints in your browser so that it pauses at certain points in the process of loading.
My suggestion would be doing some hands-on troubleshooting. Work the problem. The truth is out there.
David Cook
Senior Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
*From:*Koha-devel <koha-devel-bounces@lists.koha-community.org> *On Behalf Of *Michael Hafen *Sent:* Thursday, 8 June 2023 7:17 AM *To:* Philippe Blouin <philippe.blouin@inlibro.com> *Cc:* koha-devel@lists.koha-community.org *Subject:* Re: [Koha-devel] Rewrite of URLs, flushing all empty arguments
There are many layers interacting here. First is apache recieving the request, where it passes through any apache modules that are loaded, then it's passed to cgi or fcgi (you haven't mentioned whether you have plack enabled, but you probably do), then it's passed to Koha's codebase. There could be version differences between Debian and Ubuntu in either Apache modules or Perl CGI/FCGI modules that would cause an empty get variable to be dropped. The perl module versions would be the first thing I'd check.
On Wed, Jun 7, 2023 at 3:10âŻPM Philippe Blouin <philippe.blouin@inlibro.com> wrote:
Hello all!
New issue (in 22.05 here, but might be anywhere):
https://somedomain.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm <https://v22-test-intranet.hapax.inlibro.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm>_&*branchcode=*&module=suggestions&code=ACCEPTED_
When somedomain is onto one of our debian box (bullseye, 11), the branchcode= disappears on landing. Be it on the connection page or letter.pl <http://letter.pl>, we do not have the branchcode= anymore, and the code throws an error (branchcode being undefined)
When running onto our laptops (Ubuntu) that doesn't happen.
We have no custom RewriteRule, so I'm trying to figure out WHERE this rewrite comes from.
All suggestions welcomed,
Best regards,
--
Philippe Blouin, Directeur de la technologie
Tél.  : (833) 465-4276, poste 230 philippe.blouin@inLibro.com
inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com>
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
--
Michael Hafen
Washington County School District Technology Department
Systems Analyst
Have a look at bug 25548 maybe? It has been backported but maybe your apache config is not correct (see the RewriteRule)? Le jeu. 8 juin 2023 à 18:03, Philippe Blouin <philippe.blouin@inlibro.com> a écrit :
Hi David,
Yes, connection being the login page. Any call to it with &variable=& will get see its empty variable get flushed, as you summarized with
The fact that it's not just branchcode, but any toto= or whatever= that gets flushed, seem to point to an apache setting.
BUT my question was really: is Koha doing it ? seems not, by your answers. Is Apache doing it by default (new version...), my googling doesn't point to that, obviously.
No redirect/rewrite in network.
But again, you're telling me it's not Koha, so I'll dig.
PS yes, the second link doesn't work. We created a fix, but I didn't like it because I wanted to explore the root cause. Philippe Blouin, Directeur de la technologie
Tél. : (833) 465-4276, poste 230 philippe.blouin@inLibro.com inLibro | pour esprit libre | www.inLibro.com On 2023-06-07 19:38, David Cook wrote:
First things first, Philippe, you havenât given enough information about the problem.
For instance:
On koha-testing-docker, which admittedly is a later version, neither of these raise an error, although the second link wonât work as expected. So you should look at the actual error message in your log, and try to work it out from there. It might be that itâs a known issue thatâs been fixed upstream already.
Not sure what you mean by âthe connection pageâ. Is that the login screen for letter.pl or something else?
When you say âthe branchcode= disappears on landingâ, itâs not clear what you mean. Take a look at the Network tab on your browser and see if there are any redirects. You can also increase the logging on your Apache to see what exactly itâs doing: https://httpd.apache.org/docs/2.4/mod/core.html#loglevel.
Maybe that problem instance has some Javascript running that is interfering with the location URL. You can add breakpoints in your browser so that it pauses at certain points in the process of loading.
My suggestion would be doing some hands-on troubleshooting. Work the problem. The truth is out there.
David Cook
Senior Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
*From:* Koha-devel <koha-devel-bounces@lists.koha-community.org> <koha-devel-bounces@lists.koha-community.org> *On Behalf Of *Michael Hafen *Sent:* Thursday, 8 June 2023 7:17 AM *To:* Philippe Blouin <philippe.blouin@inlibro.com> <philippe.blouin@inlibro.com> *Cc:* koha-devel@lists.koha-community.org *Subject:* Re: [Koha-devel] Rewrite of URLs, flushing all empty arguments
There are many layers interacting here. First is apache recieving the request, where it passes through any apache modules that are loaded, then it's passed to cgi or fcgi (you haven't mentioned whether you have plack enabled, but you probably do), then it's passed to Koha's codebase. There could be version differences between Debian and Ubuntu in either Apache modules or Perl CGI/FCGI modules that would cause an empty get variable to be dropped. The perl module versions would be the first thing I'd check.
On Wed, Jun 7, 2023 at 3:10âŻPM Philippe Blouin < philippe.blouin@inlibro.com> wrote:
Hello all!
New issue (in 22.05 here, but might be anywhere):
https://somedomain.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm <https://v22-test-intranet.hapax.inlibro.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm> *&branchcode=&module=suggestions&code=ACCEPTED*
When somedomain is onto one of our debian box (bullseye, 11), the branchcode= disappears on landing. Be it on the connection page or letter.pl, we do not have the branchcode= anymore, and the code throws an error (branchcode being undefined)
When running onto our laptops (Ubuntu) that doesn't happen.
We have no custom RewriteRule, so I'm trying to figure out WHERE this rewrite comes from.
All suggestions welcomed,
Best regards,
--
Philippe Blouin, Directeur de la technologie
Tél. : (833) 465-4276, poste 230 philippe.blouin@inLibro.com
inLibro | pour esprit libre | www.inLibro.com
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
--
Michael Hafen
Washington County School District Technology Department
Systems Analyst
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
Merci!!!!!!! Yeah, that's exactly it. I got sidetracked by reproducing it in prod, but it seems that it was on an old installation. Recent ones do not have the problem. It'll be very easy to fix. Big thanks! Philippe Blouin, Directeur de la technologie Tél.  : (833) 465-4276, poste 230 philippe.blouin@inLibro.com inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com> On 2023-06-08 15:15, Jonathan Druart wrote:
Have a look at bug 25548 maybe? It has been backported but maybe your apache config is not correct (see the RewriteRule)?
Le jeu. 8 juin 2023 à  18:03, Philippe Blouin <philippe.blouin@inlibro.com> a écrit :
Hi David,
Yes, connection being the login page. Any call to it with &variable=& will get see its empty variable get flushed, as you summarized with
http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED>
http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED>
The fact that it's not just branchcode, but any toto= or whatever= that gets flushed, seem to point to an apache setting.
BUT my question was really: is Koha doing it ? seems not, by your answers. Is Apache doing it by default (new version...), my googling doesn't point to that, obviously.
No redirect/rewrite in network.
But again, you're telling me it's not Koha, so I'll dig.
PS yes, the second link doesn't work. We created a fix, but I didn't like it because I wanted to explore the root cause.
Philippe Blouin, Directeur de la technologie
Tél.  : (833) 465-4276, poste 230 philippe.blouin@inLibro.com
inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com> On 2023-06-07 19:38, David Cook wrote:
First things first, Philippe, you havenât given enough information about the problem.
For instance:
http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=&module=suggestions&code=ACCEPTED>
http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED <http://localhost:8081/cgi-bin/koha/tools/letter.pl?op=delete_confirm&module=suggestions&code=ACCEPTED>
On koha-testing-docker, which admittedly is a later version, neither of these raise an error, although the second link wonât work as expected. So you should look at the actual error message in your log, and try to work it out from there. It might be that itâs a known issue thatâs been fixed upstream already.
Not sure what you mean by âthe connection pageâ. Is that the login screen for letter.pl <http://letter.pl> or something else?
When you say âthe branchcode= disappears on landingâ, itâs not clear what you mean. Take a look at the Network tab on your browser and see if there are any redirects. You can also increase the logging on your Apache to see what exactly itâs doing: https://httpd.apache.org/docs/2.4/mod/core.html#loglevel.
Maybe that problem instance has some Javascript running that is interfering with the location URL. You can add breakpoints in your browser so that it pauses at certain points in the process of loading.
My suggestion would be doing some hands-on troubleshooting. Work the problem. The truth is out there.
David Cook
Senior Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
*From:*Koha-devel <koha-devel-bounces@lists.koha-community.org> <mailto:koha-devel-bounces@lists.koha-community.org> *On Behalf Of *Michael Hafen *Sent:* Thursday, 8 June 2023 7:17 AM *To:* Philippe Blouin <philippe.blouin@inlibro.com> <mailto:philippe.blouin@inlibro.com> *Cc:* koha-devel@lists.koha-community.org *Subject:* Re: [Koha-devel] Rewrite of URLs, flushing all empty arguments
There are many layers interacting here. First is apache recieving the request, where it passes through any apache modules that are loaded, then it's passed to cgi or fcgi (you haven't mentioned whether you have plack enabled, but you probably do), then it's passed to Koha's codebase. There could be version differences between Debian and Ubuntu in either Apache modules or Perl CGI/FCGI modules that would cause an empty get variable to be dropped. The perl module versions would be the first thing I'd check.
On Wed, Jun 7, 2023 at 3:10âŻPM Philippe Blouin <philippe.blouin@inlibro.com> wrote:
Hello all!
New issue (in 22.05 here, but might be anywhere):
https://somedomain.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm <https://v22-test-intranet.hapax.inlibro.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm>_&*branchcode=*&module=suggestions&code=ACCEPTED_
When somedomain is onto one of our debian box (bullseye, 11), the branchcode= disappears on landing. Be it on the connection page or letter.pl <http://letter.pl>, we do not have the branchcode= anymore, and the code throws an error (branchcode being undefined)
When running onto our laptops (Ubuntu) that doesn't happen.
We have no custom RewriteRule, so I'm trying to figure out WHERE this rewrite comes from.
All suggestions welcomed,
Best regards,
--
Philippe Blouin, Directeur de la technologie
Tél.  : (833) 465-4276, poste 230 philippe.blouin@inLibro.com
inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com>
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
--
Michael Hafen
Washington County School District Technology Department
Systems Analyst
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/
On 8/06/23 9:10 am, Philippe Blouin wrote:
Hello all!
New issue (in 22.05 here, but might be anywhere):
https://somedomain.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm <https://v22-test-intranet.hapax.inlibro.net/cgi-bin/koha/tools/letter.pl?op=delete_confirm>_&*branchcode=*&module=suggestions&code=ACCEPTED_
When somedomain is onto one of our debian box (bullseye, 11), the branchcode= disappears on landing. Be it on the connection page or letter.pl, we do not have the branchcode= anymore, and the code throws an error (branchcode being undefined)
When running onto our laptops (Ubuntu) that doesn't happen.
hi Philippe which specific koha version, and ubuntu version?
participants (5)
-
David Cook -
Jonathan Druart -
Mason James -
Michael Hafen -
Philippe Blouin