[squid-users] cachemgr.cgi & Internal Error: Missing Template MGR_INDEX

Alex Rousskov rousskov at measurement-factory.com
Mon Jul 31 14:27:45 UTC 2023


On 7/30/23 11:25, Brendan Kearney wrote:
> the cachemgr.cgi i am using is packaged with the squid server i run, all 
> from the fedora rpm.  i have two instances, one older and one recently 
> upgraded.
> 
> you can see in the squid logs all of the requests. cachemgr.cgi/6.1 
> always returns a 404.  cachemgr.cgi/4.14 does work and is the instance 
> on the older box connecting/talking to the squid instance on the new 
> box.  i do get a 404 in the browser.

Assuming the log records your shared correspond to cachemgr.cgi 
communication with Squid, Squid answers with 404 to cachemgr.cgi/v6 
requests, as expected. Why cachemgr.cgi/v6 (allegedly) translates that 
expected 404 answer to a 404 response to the browser (instead of 
translating it to the expected 200 response), I do not know -- it could 
be a cachemgr.cgi/v6 bug or a problem with those expectations.


> are the below logs enough or would 
> it help if i am to run a packet capture?

This question is best answered by those who will be assisting you 
further. At this point, the information you have provided appears to 
clear Squid itself from wrongdoing (as I detailed above). I could help 
you with Squid, but I do not know enough about cachemgr.cgi and do not 
have enough free time to gain that knowledge (especially since I believe 
that tool should not be a part of Squid in the first place). I hope that 
others will volunteer to assist you with cachemgr.cgi.


Good luck,

Alex.


> [root at server2 ~]# journalctl -rlu squid |grep cachemgr.cgi
> Jul 29 10:56:04 server2 (squid-1)[288884]: 
> 192.168.88.2,server2.bpk2.com,-,29/Jul/2023:10:56:04 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 29 10:55:29 server2 (squid-1)[288884]: 
> 192.168.88.2,server2.bpk2.com,-,29/Jul/2023:10:55:29 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 29 10:54:38 server2 (squid-1)[288884]: 
> 192.168.88.2,192.168.88.2,-,29/Jul/2023:10:54:38 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 20:02:08 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:20:02:08 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 19:55:00 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:19:55:00 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 13:13:48 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:13:48 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/config","cachemgr.cgi/4.14",200,18284,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:13:45 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:13:45 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/","cachemgr.cgi/4.14",200,3817,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:10:29 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:10:29 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/info","cachemgr.cgi/4.14",200,2571,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:10:24 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:10:24 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/menu","cachemgr.cgi/4.14",200,3817,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:10:12 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:10:12 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/idns","cachemgr.cgi/4.14",200,1545,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:10:10 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:10:10 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/menu","cachemgr.cgi/4.14",200,3817,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:10:03 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:10:03 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/fqdncache","cachemgr.cgi/4.14",200,1394,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:10:01 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:10:01 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/menu","cachemgr.cgi/4.14",200,3817,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:09:54 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:09:54 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/ipcache","cachemgr.cgi/4.14",200,201730,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:09:50 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:09:50 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/menu","cachemgr.cgi/4.14",200,3817,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:09:30 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:09:30 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/config","cachemgr.cgi/4.14",200,18284,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:09:26 server2 (squid-1)[227457]: 
> 192.168.88.1,server1.bpk2.com,-,28/Jul/2023:13:09:26 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","cache_object://server2.bpk2.com/","cachemgr.cgi/4.14",200,3817,-,"TCP_MISS/HIER_NONE","text/plain"
> Jul 28 13:08:44 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:13:08:44 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 13:04:46 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:13:04:46 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 13:03:30 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:13:03:30 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 13:01:02 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:13:01:02 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 12:59:15 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:12:59:15 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 12:59:11 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:12:59:11 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 12:58:27 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:12:58:27 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> Jul 28 12:58:14 server2 (squid-1)[227457]: 
> 192.168.88.2,server2.bpk2.com,-,28/Jul/2023:12:58:14 
> -0400,192.168.88.2,3128,-,"squid",GET,"HTTP/1.0","http://proxy2.bpk2.com:3128/squid-internal-mgr/","cachemgr.cgi/6.1",404,372,-,"TCP_MISS/HIER_NONE","text/html"
> 
> On 7/29/23 4:01 PM, Alex Rousskov wrote:
>> On 7/29/23 12:31, Brendan Kearney wrote:
>>> i am not following.
>>
>> Sorry, I was just gathering evidence and explaining what you saw. I 
>> have not confirmed a bug and have not been offering a solution (yet?).
>>
>>
>>> squid 4.14 on fedora 32 does not have the file, nor does it exhibit 
>>> the issue.
>>
>>> squid 6.1 on fedora 38 does not have the file, but does exhibit the 
>>> issue.
>>
>> ... and you do not have a MGR_INDEX file and, presumably, did not have 
>> that file before. That piece of information was missing. Now we have 
>> it. Let's call that progress, even though it may not look like one :-).
>>
>> One additional checkbox to tick is to make sure that the cachemgr.cgi 
>> script you are using comes from the Squid version you are testing.
>>
>>
>>> what am i missing, and is there a way to provide this functionality 
>>> in 6.1?  if an external tool, or different package, is needed what is 
>>> that?
>>
>> cachemgr.cgi is not my area of expertise, but I believe that, bugs 
>> notwithstanding, the functionality you want should be available 
>> without an external tool.
>>
>> The next step, AFAICT, is for you to detail:
>>
>> * what HTTP response cachemgr.cgi script gets from Squid and
>> * what HTTP response your browser gets from cachemgr.cgi
>>
>> According to [2], Squid should send a 404 response to cachemgr.cgi. 
>> You may be able to find some Squid response details (e.g., status 
>> code) in Squid access.log. If your cachemgr.cgi is sending plain text 
>> requests to Squid, you can also capture HTTP traffic to and from 
>> cachemgr.cgi using tcpdump, wireshark, or similar tools.
>>
>> [2] https://github.com/squid-cache/squid/pull/1176#discussion_r1010645870
>>
>>
>> Thank you,
>>
>> Alex.
>>
>>
>>> On 7/29/23 12:22 PM, Alex Rousskov wrote:
>>>> On 7/29/23 11:07, Brendan Kearney wrote:
>>>>
>>>>> the package installed does not have any file named MGR_INDEX. 
>>>>> running "rpm -ql squid |grep -i index" does not return anything. 
>>>>> searching in /usr/share/squid for the file does not find it, 
>>>>> either. funny that neither the old version of squid, nor the new 
>>>>> version of squid have that file at all.
>>>>
>>>> Yes, the lack of MGR_INDEX file in Squid sources is "by design" of 
>>>> that MGR_INDEX feature -- an "external tool" is supposed to provide 
>>>> that file in certain cases[1]. Please do not misinterpret my 
>>>> statement as defense of the corresponding design decisions or their 
>>>> side effects; I am just stating the facts rather than trying to 
>>>> justify bad user experience.
>>>>
>>>> [1] 
>>>> https://github.com/squid-cache/squid/pull/1176#discussion_r1010534845
>>>>
>>>>
>>>> Alex.
>>>>
>>>>
>>>>> @amos,
>>>>>
>>>>> i ran firefox with developer tools open, and browsed to the 
>>>>> cachemgr URL, and reproduced the issue.  the traffic is not being 
>>>>> proxied through squid, and is making the requests directly.  i am 
>>>>> not sure if that is what you mean.  i saved the session as a HAR 
>>>>> file, if that helps.
>>>>>
>>>>> thank you,
>>>>>
>>>>> brendan
>>>>>
>>>>> On 7/29/23 1:26 AM, Amos Jeffries wrote:
>>>>>> On 29/07/23 14:42, Alex Rousskov wrote:
>>>>>>> On 7/28/23 20:08, Brendan Kearney wrote:
>>>>>>>
>>>>>>>> i am running squid 6.1 on fedora 38, and cannot get the 
>>>>>>>> cachemgr.cgi working on this box.  I am getting the error:
>>>>>>>>
>>>>>>>> Internal Error: Missing Template MGR_INDEX
>>>>>>>>
>>>>>>>> when i try to connect using the cache manager interface.
>>>>>>>
>>>>>>
>>>>>> That is the expected output when you are trying to access the 
>>>>>> manager interface directly from Squid. **Instead** of via the 
>>>>>> cachemgr.cgi.
>>>>>>
>>>>>> If you want to try the new manager interface I have a prototype 
>>>>>> javascript tool available at <https://github.com/yadij/cachemgr.js/>.
>>>>>>
>>>>>>
>>>>>> Amos
>>>>>> _______________________________________________
>>>>>> squid-users mailing list
>>>>>> squid-users at lists.squid-cache.org
>>>>>> http://lists.squid-cache.org/listinfo/squid-users
>>>>> _______________________________________________
>>>>> squid-users mailing list
>>>>> squid-users at lists.squid-cache.org
>>>>> http://lists.squid-cache.org/listinfo/squid-users
>>>>
>>>> _______________________________________________
>>>> squid-users mailing list
>>>> squid-users at lists.squid-cache.org
>>>> http://lists.squid-cache.org/listinfo/squid-users
>>> _______________________________________________
>>> squid-users mailing list
>>> squid-users at lists.squid-cache.org
>>> http://lists.squid-cache.org/listinfo/squid-users
>>
>> _______________________________________________
>> squid-users mailing list
>> squid-users at lists.squid-cache.org
>> http://lists.squid-cache.org/listinfo/squid-users
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users



More information about the squid-users mailing list