webmin Error - Missing Content-Type Header

hi,

Since the upgrade to 1.970

Upgrade: webmin:amd64 (1.962, 1.970)

the webmin landing page https://xxx:10000 page is in error, we cannot login and reinstalling the webmin package do not change anything.

{
"Status": "500Missing Content-Type Header",
"Version": "HTTP/1.0",
"Transferred": "253 B (90 B size)"
}
{
"Response Headers (163 B)": {
"headers": [
{
"name": "Connection",
"value": "close"
},
{
"name": "Content-type",
"value": "text/html; Charset=utf-8"
},
{
"name": "Date",
"value": "Thu, 7 Jan 2021 10:25:34 GMT"
},
{
"name": "Server",
"value": "MiniServ/1.970"
}
]
}
}

the favicon loads fine.

regards, Ghislain.

Status: 
Active
Virtualmin version: 
d
Webmin version: 
1.970

Comments

reverting to 1.962 and all works again.

apt-get install webmin=1.962

Ilia's picture
Submitted by Ilia on Thu, 01/07/2021 - 05:58

Hi,

How about installing 1.970 and running manually afterwards:

/etc/webmin/restart

hi,

i restarted several time with no success. I done a restart and several stop, wait 10, start but no change. but i done it with service webmin (start/stop/restart) not the one you have in the ticket /etc/webmin/restart, i will test this immediatly.

regards, Ghislain.

nope, restarting with /etc/webmin/restart do not change

VSGUEST:root@edited:[/usr/local/.aqadmin/monitoring/bin]: /etc/webmin/restart
Stopping Webmin server in /usr/share/webmin
Starting Webmin server in /usr/share/webmin

VSGUEST:root@edited:[/usr/local/.aqadmin/monitoring/bin]: ps auxwf|grep webmin
root      14137  0.0  0.5  98296 71252 ?        Ss   13:42   0:00 /usr/share/webmin/virtual-server/lookup-domain-daemon.pl
root      18457  0.0  0.6 153548 82712 ?        Ss   13:47   0:00 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf

VSGUEST:root@edited:[/usr/local/.aqadmin/monitoring/bin]: sleep 60;/etc/webmin/restart;ps auxwf|grep webmin
Stopping Webmin server in /usr/share/webmin
Starting Webmin server in /usr/share/webmin
root      14137  0.0  0.5  98296 71252 ?        Ss   13:42   0:00 /usr/share/webmin/virtual-server/lookup-domain-daemon.pl
root      19745  0.0  0.6 151468 81528 ?        Ds   13:48   0:00 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf

VSGUEST:root@edited:[/usr/local/.aqadmin/monitoring/bin]: curl -I https://edited.edited.com:10000
HTTP/1.0 500 Missing Content-Type Header
Server: MiniServ/1.970
Date: Thu, 7 Jan 2021 12:58:06 GMT
Content-type: text/html; Charset=utf-8
Connection: close

VSGUEST:root@edited:[/usr/local/.aqadmin/monitoring/bin]: apt-get install webmin=1.962
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be DOWNGRADED:
  webmin
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 12 not upgraded.
Need to get 29.3 MB of archives.
After this operation, 1,171 kB disk space will be freed.
Do you want to continue? [Y/n] 
Get:1 https://software.virtualmin.com/vm/6/gpl/apt/ virtualmin-universal/main webmin all 1.962 [29.3 MB]
Fetched 29.3 MB in 3s (7,559 kB/s)  
dpkg: warning: downgrading webmin from 1.970 to 1.962
(Reading database ... 149972 files and directories currently installed.)
Preparing to unpack .../archives/webmin_1.962_all.deb ...
Unpacking webmin (1.962) over (1.970) ...
Processing triggers for systemd (215-17+deb8u13) ...
Setting up webmin (1.962) ...
Webmin install complete. You can now login to https://edited.edited.com:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.

VSGUEST:root@edited:[/usr/local/.aqadmin/monitoring/bin]: curl -I https://edited.edited.com:10000
HTTP/1.0 200 Document follows
Date: Thu, 7 Jan 2021 12:59:52 GMT
Server: MiniServ/1.962
Connection: close
Auth-type: auth-required=1
Set-Cookie: redirect=1; path=/; secure; httpOnly
Set-Cookie: testing=1; path=/; secure; httpOnly
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-src 'self'; child-src 'self'
X-Content-Type-Options: nosniff
Content-type: text/html; Charset=UTF-8

Ilia's picture
Submitted by Ilia on Thu, 01/07/2021 - 14:36

Does anything gets logged under /var/webmin log files when you install Webmin 1.970 and trying to access it?

Have you tried force-reloading browser's page or trying incognito/private tab?

tail /var/webmin/*log show only:

/var/webmin/webmin.log
1610081609.17530.0 [08/Jan/2021 05:53:29] - - - virtual-server run-postinstalls.pl "postinstall" "-" "-"


== /var/webmin/miniserv.log ==
185.63.172.127 - - [08/Jan/2021:08:58:41 +0100] "GET / HTTP/1.1" 500 90
185.63.172.127 - - [08/Jan/2021:08:58:42 +0100] "GET /favicon.ico HTTP/1.1" 200 15086
94.125.164.151 - - [08/Jan/2021:08:58:55 +0100] "GET / HTTP/1.1" 500 90

for the access i used also curl on the command line which does not cache anything and the result was the same so it is not a browser issue as command line curl has the same error.

I can confirm the behavior on debian 10 also (tried this morning on another host).

all system are on virtualized box on sysvinit (no systemd). All run the new theme also.

best regards, Ghislain.

here is a strace of the webmin process when i access it

https://pastebin.com/raw/XhPta87U

[pid 34365] write(2, "Undefined subroutine &miniserv::getenv called at /usr/share/webmin/authentic-theme/session_login.cgi line 12.\n", 110) = 110

perhaps ?

best regards, Ghislain.

Ilia's picture
Submitted by Ilia on Fri, 01/08/2021 - 06:48

I am confused. What is the output of :

cat  /usr/share/webmin/miniserv.pl |grep -B 1 -A 6 getenv
cat /usr/share/webmin/version

When you manually restart Webmin does the pid change?

Ilia's picture
Submitted by Ilia on Fri, 01/08/2021 - 07:31

Ghislain,

If you open and edit /usr/share/webmin/authentic-theme/index.cgi adding die($ENV{'THEME_ROOT'}); before do .., and refresh the page - what is the output?

Ilia's picture
Submitted by Ilia on Fri, 01/08/2021 - 07:32

.. or to session_login.cgi file if it's a login page?

/usr/share/webmin/authentic-theme/session_login.cgi if i put the die before the do it change nothing.

in /usr/share/webmin/authentic-theme/index.cgi if i put the die before the do it change nothing.

/usr/share/webmin/session_login.cgi as no 'do', i put it but it does not change.

here is the modification: https://pastebin.com/raw/tyPHsZ01

i restarted webmin between all changes before testing the url.

it hit the line line 2685/6469 of /usr/share/webmin/miniserv.pl:

                        elsif ($cgiheader{"content-type"} eq "") {
                                close(CGIOUTr); close(CGIERRr);
                                unlink($infile) if ($infile);
                                $errs = &read_errors(CGIERRr);
                                &http_error(500, "BMissing Content-Type Header",
                                    $config{'noshowstderr'} ? undef : $errs);
                                }

(yes i modified by putting B in front :p

Ilia's picture
Submitted by Ilia on Fri, 01/08/2021 - 11:28

Have a look here. For now, please fix your configs as mentioned on the comment.

thanks for the quick answer, will wait for next release.

best regards, Ghislain.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

hi,

i upgraded to 1.972 and i still got the same "Error — Missing Content-Type Header" but in uppercase and red but still the same error webmin cannot print the login screen, since 1.962 webmin stopped working.

if i put

miniserv.conf
preroot=gray-theme
preroot_root=authentic-theme

i can login but the UI is not usable the virtualmin panel is gone.

miniserv.conf
preroot=gray-theme
preroot_root=authentic-theme

i tried several combinaison that follow but they dont work or give me a panel without virtualmin.

config:theme=gray-theme
config:theme_root=authentic-theme
miniserv.conf:preroot=gray-theme
miniserv.conf:preroot_root=authentic-theme

is not usable as i have only webmin not any virtualmin panel and it looks like last century webmin ;p

:root@server:[/etc/webmin]: grep theme config miniserv.conf
config:theme=authentic-theme
config:theme_root=gray-theme
miniserv.conf:preroot=authentic-theme
miniserv.conf:preroot_root=gray-theme

:root@server:[/etc/webmin]: service webmin restart
Stopping Webmin server in /usr/share/webmin
Starting Webmin server in /usr/share/webmin

:root@server:[/etc/webmin]: curl -I https://server.xsxx.net:10000/
HTTP/1.0 500 Missing Content-Type Header
Server: MiniServ/1.972
Date: Sat, 6 Mar 2021 07:18:20 GMT
Content-type: text/html; Charset=utf-8
Connection: close

i must say that root is forbidden to connect to webmin on my setup(in case it matters).

regards, Ghislain.

Ilia's picture
Submitted by Ilia on Sat, 03/06/2021 - 17:28

Remove forkcgis directive from your miniserv.conf file and restart Webmin.

Upcoming Webmin 1.973+ will not have such issue disregard of the mentioned option, and will work just fine either way.

hi,

i dont know what this option does but this solves the problem. Thanks !

Ghislain.