Closed Chris-126 closed 1 day ago
Hey there @autinerd, mind taking a look at this issue as it has been labeled with an integration (webmin
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
webmin documentation webmin source (message by IssueLinks)
I didn't know this was possible (the webmin integration), so I added the integration (running 2024.3.0) and added one of my machines. It came right up. I left the checkbox for SSL, but otherwise just put in the IP, user, and password. Maybe try deleting your machine from the integration and adding again. Or, delete the integration and add again.
Hey CiniRyan, I cannot remove ... it's not yet implemented.
just tested the following setup attempts:
Each time closed the integration popup and restarted the setup.
So, in regards to my second attempt. Did you use a dedicated user? If so: any special settings? Permissions? I just used "Webmin --> Webmin Users --> Create a new privileged user" then choose "Select all" under "Available Webmin modules". After creation a flagged "yes" for "Can accept RPC calls" and saved.
Unfortunately the last action seems to be not saved at all. Every time I come back to the user details it says "Only for root or admin" instead. But that may be ok, as the user is privileged?
So, which user did you use?
After activating webmin debug log I can see the following entries for the second attempt:
531586 [12/Mar/2024 20:04:06.806030] userabcdefg xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxx - READ "/usr/share/webmin/authentic-theme/config"
531586 [12/Mar/2024 20:04:06.807615] userabcdefg xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxx - READ "/etc/webmin/custom-lang"
531586 [12/Mar/2024 20:04:06.808551] userabcdefg xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxx - READ "/usr/share/webmin//defaultacl"
531586 [12/Mar/2024 20:04:06.808744] userabcdefg xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxx - READ "/etc/webmin/userabcdefg.acl"
531586 [12/Mar/2024 20:04:06.808960] userabcdefg xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxx - READ "/etc/webmin//userabcdefg.acl"
531586 [12/Mar/2024 20:04:06.809342] userabcdefg xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxx - STOP "runtime=0"
Is there a way to debug the setup itself?
Hi, thanks for your report! I don't have any experiences with Virtualmin, so maybe they do something different.
Can you please run this Python script (after filling out your connection details in <USERNAME>
, <PASSWORD>
and <HOST>
) and enter the result?
import ssl
import urllib
from xmlrpc.client import SafeTransport, ServerProxy
USERNAME = urllib.parse.quote("<USERNAME>")
PASSWORD = urllib.parse.quote("<PASSWORD>")
HOST = urllib.parse.quote("<HOST>")
WEBMIN_ADDRESS = f"https://{USERNAME}:{PASSWORD}@{HOST}:10000/xmlrpc.cgi"
with ServerProxy(WEBMIN_ADDRESS, transport=SafeTransport(context=ssl._create_unverified_context())) as client:
print(client.net.active_interfaces())
(You can redact the last two hexadecimal groups of all MAC addresses with :xx:xx
and fully redact all IP addresses in the result)
So, I ran the script on my Home Assistant command line using my new (privileged) user:
python3 webmin_script.py Traceback (most recent call last): File "/homeassistant/python_scripts/webmin_script.py", line 11, in
print(client.net.active_interfaces()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/xmlrpc/client.py", line 1122, in call return self.send(self.name, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/xmlrpc/client.py", line 1464, in request response = self.transport.request( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/xmlrpc/client.py", line 1166, in request return self.single_request(host, handler, request_body, verbose) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/xmlrpc/client.py", line 1182, in single_request return self.parse_response(resp) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/xmlrpc/client.py", line 1354, in parse_response return u.close() ^^^^^^^^^ File "/usr/lib/python3.11/xmlrpc/client.py", line 668, in close raise Fault(**self._stack[0]) xmlrpc.client.Fault: <Fault 1: 'Invalid user for RPC'>
Actually, that is the very same response ...
When I try the very same with "root" (although I try to avoid it as far as possible):
[ { 'address': '127.0.0.1', 'index': 0, 'fullname': 'lo', 'netmask6': [128], 'mtu': 65536, 'name': 'lo', 'netmask': '255.0.0.0', 'edit': 1, 'address6': ['::1'], 'up': 1, 'broadcast': 0, 'scope6': ['host'] }, { 'address': '8x.2xx.xxx.xxx', 'netmask6': [128], 'fullname': 'venet0', 'mtu': 1500, 'index': 1, 'edit': 1, 'netmask': '255.255.255.255', 'name': 'venet0', 'scope6': ['global'], 'up': 1, 'broadcast': '8x.2xx.xxx.xxx', 'address6': ['2axx:23x:42xx:3xxx:exxx:xxx:xxxx:xxxx'] }, { 'mtu': 1500, 'fullname': 'venet0:0', 'index': 2, 'address': '8x.2xx.xxx.xxx', 'virtual': 0, 'broadcast': '8x.2xx.xxx.xxx', 'up': 1, 'edit': 1, 'netmask': '255.255.255.255', 'name': 'venet0' } ]
So, the "root" login during setting up the integration is failing with "Unknown error occurred". This seems to be caused by the fact that there actually is NO mac address ?
I just verified the result with ifconfig / ip link on the target server... matches the result: no mac address.
`sudo ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
venet0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500
inet 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0 destination 127.0.0.1
inet6 2axx:23x:42xx:3xxx:exxx:xxx:xxxx:xxxx prefixlen 128 scopeid 0x0
venet0:0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500 inet 8x.2xx.xxx.xxx netmask 255.255.255.255 broadcast 8x.2xx.xxx.xxx destination 8x.2xx.xxx.xxx unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
sudo ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default link/void`
This is a VPS, a Virtual Privat Server hosted by a provider, a kernel-based virtual machine (KVM). It shares the kernel with the underlying host.
So, ... end of my attempt? I guess your solution is based on the mac address....
Thank you very much! Yes, currently the unique ID is based on the MAC address, but so I will need to implement a fallback.
I used my linux username - not a webmin user. I'm not at home at the moment, but I do not think my account has any special permissions because I sudo for everything admin-wise.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
This is still not working in current version of Home Assistant. So, keeping this open.
The problem
Hi there,
I found the Webmin integration and would like to utilize it. Unfortunately it was first throwing "Unknown error occurred" and since I've assigned more permissions and enabled "Can accept RPC calls?" = yes (instead of default "Only for root and admin") in Webmin I get the error "Fault 1: Invalid user for RPC" the users is a privileged user with access to everything (for now, I really would like to reduce later).
During the "Unknown error occured" phase the logs has shown the following errors. Now, with the new "RPC" error, there is no new log entry to be found.
I can perfectly login to Webmin with the given user and password.
I've seen the recent issue where you did a limitation to WiFi and Ethernet interfaces. If the mentioned mac addresses are from the target then this might have an effect here. The server is based on a kernel-based virtual machine. So I do have a loopback device as well as virtual interfaces named "venet0" and "venet0:0". Not sure, if this is related...
Do you have any ideas on this?
Thanks in advance and best regards Christian
What version of Home Assistant Core has the issue?
core-2024.3.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Webmin
Link to integration documentation on our website
https://www.home-assistant.io/integrations/webmin/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
The target is a Ubuntu 22.04 based webserver which is managed with Virtualmin which is based on Webmin.