Cannot add/edit networks through Webui "The requested module does not acknowledge web requests" #1041

Closed
opened 2026-10-05 04:59:59 +02:00 by adam · 6 comments
Owner

I'm using ZNC 1.8.2+deb3.1 on Debian-stable (installed via apt).

When trying to add or edit networks through the WebUI I get redirected to this 404 page:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="UTF-8"/>
<title>404 Not Implemented</title>
</head>
<body>
<h1>Not Implemented</h1>
<p>The requested module does not acknowledge web requests</p>
<hr/>
<p>ZNC - <a href="[https://znc.in](view-source:https://znc.in/)">https://znc.in</a></p>
</body>
</html>

I am able to edit everything via controlpanel module, although it's a bit cumbersome compared to the webui sometimes.

I am running the WebUI through a reverse proxy, so maybe the issue lies here. It looks like this:

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;

  server_name znc.***.***;

  ssl_protocols TLSv1.3;# Requires nginx >= 1.13.0 else use TLSv1.2
  ssl_prefer_server_ciphers on;
  ssl_dhparam /etc/nginx/dhparam.pem; # openssl dhparam -out /etc/nginx/dhparam.pem 4096
  ssl_ciphers EECDH+CHACHA20:EECDH+AESGCM:EDH+AESGCM;
  ssl_conf_command Ciphersuites TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256;
  ssl_conf_command Options PrioritizeChaCha;
  ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
  ssl_session_timeout  10m;
  ssl_session_cache shared:SSL:10m;
  ssl_session_tickets off; # Requires nginx >= 1.5.9
  ssl_stapling on; # Requires nginx >= 1.3.7
  ssl_stapling_verify on; # Requires nginx => 1.3.7
  resolver 1.1.1.1 1.0.0.1 valid=300s;
  resolver_timeout 5s;
  add_header X-Frame-Options SAMEORIGIN;
  add_header X-Content-Type-Options nosniff;
  add_header X-XSS-Protection "1; mode=block";

  ssl_certificate /etc/letsencrypt/live/***.***/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/***.***/privkey.pem;

  #auth_basic "What's the password?";
  #auth_basic_user_file /etc/htpasswd;
  
  location / {
      proxy_pass http://[::1]:7000$uri;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

Is there another place ZNC logs to that I can find out more?

I'm using ZNC 1.8.2+deb3.1 on Debian-stable (installed via apt). When trying to add or edit networks through the WebUI I get redirected to this 404 page: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta charset="UTF-8"/> <title>404 Not Implemented</title> </head> <body> <h1>Not Implemented</h1> <p>The requested module does not acknowledge web requests</p> <hr/> <p>ZNC - <a href="[https://znc.in](view-source:https://znc.in/)">https://znc.in</a></p> </body> </html> ``` I am able to edit everything via controlpanel module, although it's a bit cumbersome compared to the webui sometimes. I am running the WebUI through a reverse proxy, so maybe the issue lies here. It looks like this: ``` server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name znc.***.***; ssl_protocols TLSv1.3;# Requires nginx >= 1.13.0 else use TLSv1.2 ssl_prefer_server_ciphers on; ssl_dhparam /etc/nginx/dhparam.pem; # openssl dhparam -out /etc/nginx/dhparam.pem 4096 ssl_ciphers EECDH+CHACHA20:EECDH+AESGCM:EDH+AESGCM; ssl_conf_command Ciphersuites TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256; ssl_conf_command Options PrioritizeChaCha; ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0 ssl_session_timeout 10m; ssl_session_cache shared:SSL:10m; ssl_session_tickets off; # Requires nginx >= 1.5.9 ssl_stapling on; # Requires nginx >= 1.3.7 ssl_stapling_verify on; # Requires nginx => 1.3.7 resolver 1.1.1.1 1.0.0.1 valid=300s; resolver_timeout 5s; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; ssl_certificate /etc/letsencrypt/live/***.***/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/***.***/privkey.pem; #auth_basic "What's the password?"; #auth_basic_user_file /etc/htpasswd; location / { proxy_pass http://[::1]:7000$uri; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } ``` Is there another place ZNC logs to that I can find out more? <!-- github-sync-id:2261396549 -->
adam closed this issue 2026-10-05 04:59:59 +02:00
Author
Owner

Is there another place ZNC logs to that I can find out more?

Depends on how exactly you run ZNC, but in general, running with --debug provides some output.

When trying to add or edit networks through the WebUI I get redirected to this 404 page:

Could you say something about the URL that your browser displays when you get this 404 page? I don't want to know the (possibly private) location of your web interface, but the relative URL for that. Specifically, which module are you accessing?

For example, if your browser were to display https://znc.in/foo/bar, I'd be interested in the /foo/bar part of this.

Another quick idea: What do the nginx logs say for this request? Perhaps there is something helpful in its access logs.

> Is there another place ZNC logs to that I can find out more? Depends on how exactly you run ZNC, but in general, running with `--debug` provides some output. > When trying to add or edit networks through the WebUI I get redirected to this 404 page: Could you say something about the URL that your browser displays when you get this 404 page? I don't want to know the (possibly private) location of your web interface, but the relative URL for that. Specifically, which module are you accessing? For example, if your browser were to display `https://znc.in/foo/bar`, I'd be interested in the `/foo/bar` part of this. Another quick idea: What do the nginx logs say for this request? Perhaps there is something helpful in its access logs. <!-- github-comment-id:2078969398 -->
Author
Owner

I have provided the relevant part of my nginx log below. As you can see, the URL its trying to access is /mods/global/webadmin/addnetwork, but the same thing happens for editnetwork and delnetwork.

2003:d4:****:****:****:****:****:****- - [26/Apr/2024:09:35:34 +0000] "GET /mods/global/webadmin/addnetwork?user=*** HTTP/2.0" 404 269 "https://znc.***.***/mods/global/webadmin>

I have provided the relevant part of my nginx log below. As you can see, the URL its trying to access is /mods/global/webadmin/addnetwork, but the same thing happens for editnetwork and delnetwork. `2003:d4:****:****:****:****:****:****- - [26/Apr/2024:09:35:34 +0000] "GET /mods/global/webadmin/addnetwork?user=*** HTTP/2.0" 404 269 "https://znc.***.***/mods/global/webadmin>` <!-- github-comment-id:2079030729 -->
Author
Owner

Well... okay, I don't know what is going and would be interested in hints from znc --debug.

2003:d4:****:****:****:****:****:****- - [26/Apr/2024:09:35:34 +0000] "GET /mods/global/webadmin/addnetwork?user=*** HTTP/2.0" 404 269 "https://znc.***.***/mods/global/webadmin>

How do I have to read this? nginx got a request for /mods/global/webadmin/addnetwork?user=***, I guess. But the /mods/global/webadmin at the end confuses me.

Looking at the code, The requested module does not acknowledge web requests comes from here: https://github.com/znc/znc/blob/82e82f0bf6f643839612968db668e135757129b4/src/WebModules.cpp#L893
This code is reached if a module "does nothing" in its OnWebRequest hook. The default implementation does nothing, but the implementation from webadmin definitely should do something: https://github.com/znc/znc/blob/82e82f0bf6f643839612968db668e135757129b4/modules/webadmin.cpp#L519-L736

Well... unless you are accessing a page it does not understand. All the return falses here could reach the code path you are seeing. Most of them are admin checks ("A non-admin is trying to do something that only admins may do"). I will assume that this is not the case for you.

Anyway, for your addnetwork case, this is the relevant code: https://github.com/znc/znc/blob/82e82f0bf6f643839612968db668e135757129b4/modules/webadmin.cpp#L537-L556

The Admin or self change-check could produce the error message you are seeing. Besides that, I don't see anything that could cause this (all the other paths should display an error message), but I might be missing something. This might also be a problem with the HTTP session getting lost.

Does the webadmin web page still shows your login name after clicking around a bit? The session magic uses cookies and that should still work behind a proxy. But perhaps "something" is going on with your proxy. Did you configure TrustedProxies?

Anyway, now I would be more interested in output from znc --debug when doing such a request.

Well... okay, I don't know what is going and would be interested in hints from `znc --debug`. ``` 2003:d4:****:****:****:****:****:****- - [26/Apr/2024:09:35:34 +0000] "GET /mods/global/webadmin/addnetwork?user=*** HTTP/2.0" 404 269 "https://znc.***.***/mods/global/webadmin> ``` How do I have to read this? nginx got a request for `/mods/global/webadmin/addnetwork?user=***`, I guess. But the `/mods/global/webadmin` at the end confuses me. Looking at the code, `The requested module does not acknowledge web requests` comes from here: https://github.com/znc/znc/blob/82e82f0bf6f643839612968db668e135757129b4/src/WebModules.cpp#L893 This code is reached if a module "does nothing" in its `OnWebRequest` hook. The default implementation does nothing, but the implementation from `webadmin` definitely should do something: https://github.com/znc/znc/blob/82e82f0bf6f643839612968db668e135757129b4/modules/webadmin.cpp#L519-L736 Well... unless you are accessing a page it does not understand. All the `return false`s here could reach the code path you are seeing. Most of them are admin checks ("A non-admin is trying to do something that only admins may do"). I will assume that this is not the case for you. Anyway, for your `addnetwork` case, this is the relevant code: https://github.com/znc/znc/blob/82e82f0bf6f643839612968db668e135757129b4/modules/webadmin.cpp#L537-L556 The `Admin or self change`-check could produce the error message you are seeing. Besides that, I don't see anything that could cause this (all the other paths should display an error message), but I might be missing something. This might also be a problem with the HTTP session getting lost. Does the webadmin web page still shows your login name after clicking around a bit? The session magic uses cookies and that should still work behind a proxy. But perhaps "something" is going on with your proxy. Did you configure `TrustedProxies`? Anyway, now I would be more interested in output from `znc --debug` when doing such a request. <!-- github-comment-id:2079121448 -->
Author
Owner

There is something weird going on with the webadmin for sure. The error happens when I'm trying to do changes on my own account, so while that one isn't an admin, it should still be allowed.

In fact, a different kind of silent error happens when trying to do stuff as admin from the webadmin interface. When trying to edit other accounts, I instead get redirected to the admin page instead. It shows /mods/global/webadmin/edituser?user=normalusername in the URL, but I'm clearly on the /mods/global/webadmin/edituser?user=admin page instead.

I have

TrustedProxy = 127.0.0.1
TrustedProxy = ::1

in my znc.conf.

I'll come back with znc --debug output later / tomorrow.

There is something weird going on with the `webadmin` for sure. The error happens when I'm trying to do changes on my own account, so while that one isn't an admin, it should still be allowed. In fact, a different kind of silent error happens when trying to do stuff as admin from the webadmin interface. When trying to edit other accounts, I instead get redirected to the admin page instead. It shows `/mods/global/webadmin/edituser?user=normalusername` in the URL, but I'm clearly on the `/mods/global/webadmin/edituser?user=admin` page instead. I have ``` TrustedProxy = 127.0.0.1 TrustedProxy = ::1 ``` in my znc.conf. I'll come back with `znc --debug` output later / tomorrow. <!-- github-comment-id:2079326107 -->
Author
Owner

Could it be that the ?user=foo part gets lost between the proxy and znc?

I don't really understand it, but Google sounds like this is a not-unusual problem: https://serverfault.com/questions/656380/nginx-proxy-pass-with-uri-modification

Could it be that the `?user=foo` part gets lost between the proxy and znc? I don't really understand it, but Google sounds like this is a not-unusual problem: https://serverfault.com/questions/656380/nginx-proxy-pass-with-uri-modification <!-- github-comment-id:2079380337 -->
Author
Owner

Thanks for that link, that must have been it!

Changing proxy_pass http://[::1]:7000$uri; in the relevant nginx config to proxy_pass http://[::1]:7000; seems to have fixed the problem!

Closing this as resolved.

Thanks for that link, that must have been it! Changing `proxy_pass http://[::1]:7000$uri;` in the relevant nginx config to `proxy_pass http://[::1]:7000;` seems to have fixed the problem! Closing this as resolved. <!-- github-comment-id:2079509567 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#1041