Submitted by h4ns3n on Tue, 04/25/2017 - 10:36 Pro Licensee
I was in the process of migrating a bunch of virtual servers across hosts and while testing I came across an issue which might be a bug (maybe a configuration issue on my side - if so please chnage to support request and advise correct steps).
Steps to reproduce:
Create any virtual server with SSL enabled (Ensure default http --> https redirect exists) Services --> Preview website
https://host.domain.tld:10000/virtual-server/link.cgi/81.xx.xx.96/https:...
Result: Bad request: Your browser sent a request that this server could not understand.
Tested on a brand new install of Virtualmin, domains tested are working correctly and tested with new created server with no dns working.
Status:
Closed (fixed)
Comments
@h4ns3n
hi, let me check that for you :)
@h4ns3n
any thoughts?
Submitted by h4ns3n on Tue, 04/25/2017 - 11:28 Pro Licensee Comment #3
I'm using Let's Encrypt.
I have this issue on a Debian 8 and a CentOS host.
Submitted by andreychek on Tue, 04/25/2017 - 11:36 Comment #4
Thanks, we'll look deeper into this.
Submitted by cyrus on Tue, 04/25/2017 - 16:41 Pro Licensee Comment #5
I can confirm this on a Debian 8 system
Submitted by JamieCameron on Tue, 04/25/2017 - 18:43 Comment #6
Can you post what gets logged to
/var/log/virtualmin/yourdomain.com_error_log
on the server? I'd like to see where that "Your browser sent a request that this server could not understand" message is coming from.Submitted by cyrus on Fri, 04/28/2017 - 01:17 Pro Licensee Comment #7
On my CentOS box an error is logged for a site that has SSL enabled. For a site that does not have SSL enabled I can preview that particular website.
The error logged for the SSL enabled site is:
[Fri Apr 28 01:06:04.262565 2017] [ssl:error] [pid 11259] AH02032: Hostname 67.xxx.xxx.xx provided via SNI and hostname www.mydomain.org provided via HTTP are different
On my Debian 8 box I cannot preview any website, whether SSL is enabled or not. Also, there is nothing logged in the error report.
Submitted by JamieCameron on Fri, 04/28/2017 - 23:03 Comment #8
I think I might know the cause... do you have redirection from the non-SSL to SSL website setup?
Submitted by cyrus on Fri, 04/28/2017 - 23:40 Pro Licensee Comment #9
I can't remember enabling anything for a virtual domain after requesting a Letsencrypt certificate. If I enter the domain name in the address bar it goes directly to https
Where could I look to establish if redirection from the non-SSL to SSL is setup, to answer your question?
Submitted by h4ns3n on Sat, 04/29/2017 - 05:52 Pro Licensee Comment #10
Yes, I can confirm that there is a redirect. Although it's not a redirect created by any admin, it's seemingly created when SSL is enabled.
The redirect is created as follows:
Source url path: ^/(?!.well-known) URL at other website; https://domain.com/$1
You can see the redirect on the screenshot here: https://www.evernote.com/l/APME8gBQ0fVBTo_Xf_vv9Me1eKoZziXOfQQ
Removing that redirect has worked in some cases, but in other cases not. I'm not sure why it doesn't work consistently.
Submitted by JamieCameron on Sat, 04/29/2017 - 16:59 Comment #11
Ok, this will be fixed in the next Webmin release (1.840).
Submitted by JamieCameron on Sat, 04/29/2017 - 16:59 Comment #12
Submitted by IssueBot on Sat, 05/13/2017 - 17:07 Comment #13
Automatically closed - issue fixed for 2 weeks with no activity.
Submitted by cyrus on Sat, 05/13/2017 - 23:21 Pro Licensee Comment #14
On Webmin 1.840. I still cannot preview websites with a letsencrypt certificate on CentOS. Ones with an SSL certificate show the same error in the domian's Apache error log:
[Sat May 13 23:05:14.557602 2017] [ssl:error] [pid 30010] AH02032: Hostname 67.xxx.xxx.xx provided via SNI and hostname www.mydomain.org provided via HTTP are different
I can preview domains without an SSL certificate.
On Debian 8 all websites cannot be previewed, those with an SSL cerificate or not, but again as mentioned earlier, there is no error that comes up in the logs.
Can anyone else confirm this please?
Submitted by quacky on Sun, 05/14/2017 - 02:20 Comment #15
I'm using ubuntu 14.04, just updated to version 1.840. I also cannot preview my http website. It says:
Bad Request
Your browser sent a request that this server could not understand.
Nothing is found in the error log for the domain I want to preview.
Submitted by h4ns3n on Sun, 05/14/2017 - 02:41 Pro Licensee Comment #16
I found this issue to have a few variations to it when it manifests itself.
The problem was always consistent whenever I transferred a server from an old VPS to a new one. No matter what configuration the destination VPS was in, preview website would not work regardless of SSL or no SSL. I thought this was the extent of the problem I had reported, but I have found subsequently that there is more to it than just this.
Creating a virtual server directly on the new VPS with SSL enabled: When I use preview, then the site shown is always the http version. If there is a default redirect, then I will get the error reported in the above post ("browser cannot understand blah blah"). If there is no automatic redirect to SSL, then the http version shows without an error.
To clarify the above:
https://myhostserver.com:10000/virtual-server/link.cgi/12.34.56.78/https://myclientsite.com/?1494747056
The above does not work. I get the same browser error
https://myhostserver.com:10000/virtual-server/link.cgi/12.34.56.78/http://myotherclientsite.com/?1494747250
The above does work.
Both clients sites are setup exactly the same. Lets Encrypt SSL exists on both. However the first one contains a default redirect (not setup in website redirects, it must be setup in .htaccess but have not confirmed. it is not possible to load the page with http:// The second does not redirect automatically, it is possible to load the page with http://.
I would suggest others experiencing this issue test along these same cases to see f the problem persists, or if mine is merely a configuration issue that only I am experiencing.
Submitted by quacky on Sun, 05/14/2017 - 02:49 Comment #17
In my case, the problem happens on both new and existing domains, which worked fine before the upgrade. I don't have https site, only http
backlog report
EDIT : official linux chromium package is included... it all worked just fine.
Submitted by cyrus on Sun, 05/14/2017 - 13:44 Pro Licensee Comment #19
Interesting .. did that but it didn't work for me :)
Submitted by h4ns3n on Sun, 05/14/2017 - 14:01 Pro Licensee Comment #20
I'm running Centos 7 and mine was initially also tested on a brand new install.
Submitted by JamieCameron on Mon, 05/15/2017 - 00:53 Comment #21
If anyone is seeing this issue and could grant Virtualmin staff access to a system that is experiencing it, please let me know.
Submitted by h4ns3n on Mon, 05/15/2017 - 01:05 Pro Licensee Comment #22
I'm willing to give access.
Submitted by cyrus on Mon, 05/15/2017 - 01:12 Pro Licensee Comment #23
Not a problem Jamie on both servers, CentOS and Debian 8. All of you already have login rights, I'd just have to let you know the addresses and port numbers
Submitted by JamieCameron on Mon, 05/15/2017 - 13:22 Comment #24
Please email me the login details at jcameron@virtualmin.com
Submitted by JamieCameron on Mon, 05/15/2017 - 18:54 Comment #25
@cyrus - I have patched your system to fix this, and will include the same fix in the next Webmin release.
The trigger is cases where non-SSL requests are redirected to SSL.
Submitted by postlounge on Sat, 05/27/2017 - 00:56 Comment #26
Are you able to share the patch until the new version of virtualmin comes out? I am running a vps with a fresh install of Deb 8 64 uptodate & webmin 1.8.40 . Restored a virtual server which has an http site and when previewing the site get error:
Bad Request Your browser sent a request that this server could not understand.
(https://ip.ip.ip.ip:10000/virtual-server/link.cgi/127.0.0.2/http://www.d...)
Thanks.
Submitted by JamieCameron on Sat, 05/27/2017 - 23:38 Comment #27
You can see the patch needed here : https://github.com/virtualmin/virtualmin-gpl/commit/c0d4ea146204095844ca...
Submitted by cyrus on Sun, 05/28/2017 - 03:13 Pro Licensee Comment #28
sorry to bring this up again but I made those changes on my Debian server at
/usr/share/webmin/virtual-server/link.cgi
and it didn't work for me. Restarted webmin, cleared my browser cache, didn't see any pertaining entries in the error log ...Submitted by postlounge on Sun, 05/28/2017 - 03:41 Comment #29
Yes same for me. Updated file, rebooted, cleared browser cache with same result "Bad Request - Your browser sent a request that this server could not understand."
Submitted by JamieCameron on Sun, 05/28/2017 - 14:16 Comment #30
For those still seeing the error - what message are you getting in the domain's error_log file under /var/log/virtualmin ?
Submitted by cyrus on Sun, 05/28/2017 - 14:54 Pro Licensee Comment #31
Log file is empty
in most. One domain however shows :[Sun May 28 06:25:51.100223 2017] [ssl:warn] [pid 10430] AH01906: domain.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun May 28 06:25:51.100252 2017] [ssl:warn] [pid 10430] AH01909: domain.com:443:0 server certificate does NOT include an ID which matches the server name
Submitted by postlounge on Sun, 05/28/2017 - 18:56 Comment #32
The domain log file is empty for me.
Submitted by JamieCameron on Mon, 05/29/2017 - 00:13 Comment #33
@postlounge - how about the access_log file - does anything get logged when you try the Preview link?
Submitted by postlounge on Mon, 05/29/2017 - 01:53 Comment #34
Hi Jamie
Both file empty, access_log & error_log.
Submitted by andreychek on Mon, 05/29/2017 - 09:35 Comment #35
If the log file for that domain is empty, that suggests that the requests are being answered by a different domain.
Are you able to determine from the logs in /var/log/virtualmin which domain is receiving the requests?
Submitted by postlounge on Mon, 05/29/2017 - 14:04 Comment #36
This is only a test vps for now so one domain setup. One set of logs in the /var/log/virtualmin folder, both empty.
Submitted by andreychek on Mon, 05/29/2017 - 15:22 Comment #37
What about the access_log located in /var/log/httpd/ or /var/log/apache2/, does it contain anything?
Submitted by postlounge on Mon, 05/29/2017 - 20:44 Comment #38
Access log shows:
127.0.0.2 - - [30/May/2017:13:41:47 +1200] "GET / HTTP/1.0" 400 0 "-" "-"
Submitted by Badidon on Fri, 06/02/2017 - 10:30 Comment #39
Hello,
I have 3 different VPS with Webmin/Virtualmin (Debian 7).
On 2 of them i have a 400 error "Bad request" when i want to use "Preview Website" in Services.
VPS 1 : Webmin 1.830 / Virtualmin 5.05.gpl : OK
VPS 2 : Webmin 1.831 / Virtualmin 5.07.gpl : KO - error 400
VPS 3 : Webmin 1.840 / Virtualmin 5.07.gpl : KO - error 400
Furthermore, on the VPS 2 i have a website with Revive Ads Server and the redirection of the banners didn't work anymore.
Do you know if this is a problem with 5.07 version or a different configuration ? What can i do or where can i go to see/solve the problem ?
Thanks in advance for your help. Gil
Submitted by JamieCameron on Fri, 06/02/2017 - 10:59 Comment #40
You might want to try upgrading to Webmin 1.843 or 1.844 from http://www.webmin.com/devel.html , as it fixes a few bugs in this area.
Submitted by Badidon on Fri, 06/02/2017 - 11:33 Comment #41
Thanks for your reply. Is it possible to upgrade with webmin UI ?
Submitted by JamieCameron on Fri, 06/02/2017 - 12:47 Comment #42
No, it's easier to do on the command line. Which linux distribution are you running there?
Submitted by Badidon on Fri, 06/02/2017 - 13:08 Comment #43
I am on Debian 7
Submitted by JamieCameron on Fri, 06/02/2017 - 16:04 Comment #44
The simplest way to upgrade is just to run
dpkg --install http://download.webmin.com/devel/deb/webmin_1.844_all.deb
Submitted by postlounge on Fri, 06/02/2017 - 21:18 Comment #45
"dpk g --install http://download.webmin.com/devel/deb/webmin_1.844_all.deb" didn't work for me, I got error: "dpkg: error processing archive http://download.webmin.com/devel/deb/webmin_1.844_all.deb (--install): cannot access archive: No such file or directory"
So I did: wget wget http://download.webmin.com/devel/deb/webmin_1.844_all.deb & dpkg --install webmin_1.844_all.deb
This installed 1.844. Logged in to virtualmin and confirmed running webmin 1.844.
Same error "Bad Request Your browser sent a request that this server could not understand."
Logs for domain empty. Apached logs show: 127.0.0.2 - - [03/Jun/2017:14:14:22 +1200] "GET / HTTP/1.0" 400 0 "-" "-" 127.0.0.2 - - [03/Jun/2017:14:14:25 +1200] "GET / HTTP/1.0" 400 0 "-" "-"
Submitted by postlounge on Sat, 06/03/2017 - 19:49 Comment #46
As Badidon found Webmin 1.830 / Virtualmin 5.05.gpl does work OK is it possible to give a download link and install for that version or can you not downgrade via terminal?
If not, I am happy to start from scratch with my beta vps and reinstall a working vs of virtualmin. Can you install a specific vs?
Submitted by JamieCameron on Sun, 06/04/2017 - 14:34 Comment #47
Also, we just released Virtualmin 5.99 - can you upgrade to that?
Submitted by postlounge on Sun, 06/04/2017 - 17:33 Comment #48
Process to upgrade? Virtualmin ui does not show upgrade available for 5.07.
Submitted by postlounge on Mon, 06/05/2017 - 02:08 Comment #49
Ok Followed install instructions from http://www.webmin.com/vdownload.html and got this error:
Downloading http://download.webmin.com/download/virtualmin/webmin-virtual-server_5.9... (1.84 MB) .. Received 1024 bytes (0 %) Received 189 kB (10 %) Received 377 kB (20 %) Received 565 kB (30 %) Received 753 kB (40 %) Received 941 kB (50 %) Received 1.10 MB (60 %) Received 1.29 MB (70 %) Received 1.47 MB (80 %) Received 1.65 MB (90 %) Received 1.84 MB (100 %) .. download complete. Failed to install module from http://download.webmin.com/download/virtualmin/webmin-virtual-server_5.9... : Not a valid module file : tar: This does not look like a tar archive tar: Skipping to next header tar: Exiting with failure status due to previous errors
Submitted by JamieCameron on Mon, 06/05/2017 - 17:20 Comment #50
You'd be better off waiting approx 24 hours until the upgrade appears on the System Information page.
Submitted by Badidon on Wed, 06/07/2017 - 04:59 Comment #51
Hello,
I have updated the VPS 2 & 3 in Webmin 1.844 and i still have the same trouble. I am waiting for available upgrade to Virtualmin 5.99
Does this probleme could impact the ReviveAds Server delevery on a website or is it something else ?
Thanks Gil
Submitted by JamieCameron on Wed, 06/07/2017 - 23:58 Comment #52
The trigger for this is typically just having a website that redirects from http to https.
Submitted by postlounge on Thu, 06/08/2017 - 00:04 Comment #53
Hi Jamie
Non of the websites I have hosted redirect to https.
Submitted by postlounge on Thu, 06/08/2017 - 13:42 Comment #54
I notice this article has been marked "fixed/closed" but the problem is still there????
Submitted by postlounge on Thu, 06/08/2017 - 21:47 Comment #55
Just updated to 5.99 and same problem. Did reboot after update and cleared browser cache. Did preview in Chrome and Firefox
Debian 8 on vps Linux 2.6.32-042stab120.6 on x86_64 Virtualmin 5.99.gpl
https://myip:10000/virtual-server/link.cgi/myip/http://www.domain.co.nz/
400 Bad request Bad Request
Your browser sent a request that this server could not understand.
Submitted by JamieCameron on Fri, 06/09/2017 - 00:26 Comment #56
If you're seeing a 400 error from a http website, check the log file at
/var/log/virtualmin/domain.co.nz_error_log
Submitted by postlounge on Fri, 06/09/2017 - 02:55 Comment #57
access & error logs empty for domain.
Submitted by Badidon on Fri, 06/09/2017 - 02:57 Comment #58
I have updated my VPS 3 in 5.99.gpl, rebooted, et cleared browser cache and it's still Bad Request in FF and Chrome...
Submitted by JamieCameron on Fri, 06/09/2017 - 15:57 Comment #59
Does this website work without using the Preview feature?
Submitted by cyrus on Fri, 06/09/2017 - 16:15 Pro Licensee Comment #60
@JamieCameron - You had fixed this issue for me on my CentOS server but my Debian server preview website feature didn't work after applying your patch.
I have now moved my sites from the CentOS server to the Debian one. Can confirm that the websites work but unfortunately can't give you any further information as surprisingly there isn't any entry in the error logs for specific virtual domains. Not a big deal, but the feature is definitely not working. Running all latest versions to date.
Submitted by postlounge on Fri, 06/09/2017 - 17:08 Comment #61
I can't absolutely confirm the website works on this server as the dns is set for the main server and I don't want to change it for testing purposes. However it is a backup/ restore using virtualmin of a working website hosted on an earlier version of Virtualmin and Debian and preview does work on that server.
As others have commented about this problem too it seems to be a bug but am happy to try and fault find for you with any new tests and or code you can suggest.
Submitted by postlounge on Fri, 06/09/2017 - 17:22 Comment #62
Ok, just tried this on another VPS with working website. Same result "400 bad request". No related errors showing in virtualmin domain error log or apache log. Debian Linux 7 Virtualmin version 5.99.gpl https://vps-ip:10000/virtual-server/link.cgi/vps-ip/http://www.domain.co... Bad Request - Your browser sent a request that this server could not understand.
Submitted by JamieCameron on Sat, 06/10/2017 - 20:54 Comment #63
Would it be possible to get remote access to this system to see what's going wrong?
Submitted by postlounge on Sat, 06/10/2017 - 21:05 Comment #64
Yes can do that. Ssh? PM me.
Submitted by JamieCameron on Sun, 06/11/2017 - 00:03 Comment #65
Yes, SSH will work. You can contact me directly at jcameron@virtualmin.com
Submitted by Badidon on Tue, 06/13/2017 - 04:03 Comment #66
@ JamieCameron Yes the website works without preview. I have also disabled "Apache SSL website enabled?" off virtual server.
Submitted by h4ns3n on Tue, 06/13/2017 - 04:21 Pro Licensee Comment #67
As the OP on the thread, I just want to confirm that the issue is resolved for me. All sites whether SSL enabled or not are working using the preview feature.
Thanks to all for the fix.
Submitted by postlounge on Tue, 06/13/2017 - 05:10 Comment #68
Sadly the issue is not resolved for me. Jamie spent some time looking at my vps and cannot find the issue so preview does not seem to be an option. Thanks for your time Jamie.
Submitted by quacky on Wed, 06/14/2017 - 03:23 Comment #69
My fresh installation of virtualmin on ubuntu 16.04 also have the same problem. It cannot preview both ssl and regular websites: "Your browser sent a request that this server could not understand"
Hope this issue will be fixed in a near future.
Thanks!
my 2 cents to this - sadly after update today, it does not work for me as well.. debian jessie latest... edit: perhaps you should and would edit your hosts file.
Submitted by burstsolutions on Sat, 07/08/2017 - 17:35 Comment #71
I just ran a full update and the preview website is no long working and returning a 400 Bad Request for all my sites on the server.
Operating system: Ubuntu Linux 16.04.2 Webmin version: 1.850 Usermin version: 1.720 Virtualmin version: 5.99
https://104.#.#.#:10000/virtual-server/link.cgi/104.#.#.#/http://www.example.org/
There is no errors reported in any of the /var/log files or in /var/log/virtualmin.
This bug report is closed. I'm wondering if another one needs to be opened for this issue that still seems to be occuring?
Thanks, David
Submitted by agentbleu on Mon, 07/24/2017 - 06:13 Comment #72
i can confirm i have the same issue and the install on ubuntu 16.04 lts new install persists, i checked the link.cgi script and it was the new version as above.
Submitted by JamieCameron on Mon, 07/24/2017 - 18:09 Comment #73
Another user reported this, and I was finally able to track down the cause! The fix can be seen here : https://github.com/virtualmin/virtualmin-gpl/commit/a9e93b6c101941d03ff2...
It will also be included in the next Virtualmin release.
Submitted by q7joey on Thu, 07/27/2017 - 12:06 Comment #74
just ran into this issue and the one line patch from jamie on 7/24 does indeed fix things.
Submitted by postlounge on Thu, 08/03/2017 - 16:00 Comment #75
Could you post the location of link.cgi thanks.
PS - OK that was a stupid question, a simple search found it. Thanks for the fix Jason. usr/share/webmin/virtual-server/link.cgi