How to fix "Error while proxying request: x509: certificate is valid for ..." error
This error might show up in UMHLens / OpenLens when the IP address of the device changed after the installation. This can happen if you got the IP in the installation via DHCP, and then you set it to a different static one.
Are you getting an
Error while proxying request: x509: certificate is valid for ...
error in UMHLens / OpenLens after changing the IP address of your device? This is a common issue that can occur when the device's IP address changes from DHCP to static after installation. Fortunately, there are some easy ways to fix this error, and in this article, we'll walk you through two options.
Option 1: basically ignoring the cause (quickest)
If you get an error like this, you need to add
insecure-skip-tls-verify: true
to the the cluster and remove the ca certificate, so it looks like the screenshot below.
Option 2: adjusting the IP address (permanent, flatcar only)
Once you've changed the IP address, SSH back to the server using the new IP. Follow these steps to reset the cluster and change the IP:
Stop k3s with:
sudo systemctl stop k3s
Reset the cluster etcd with:
sudo /opt/bin/k3s server --cluster-reset
Start k3s again:
sudo systemctl start k3s
Check the status of the server:
sudo systemctl status k3s
Change the IP for the cluster in the lens config.
Done! You have successfully changed your server to a static IP.
If you're unsure how to adjust the IP address, the article includes a small script from DanielH that can handle the change. Change the
chmod
to
+xu
and run it with
sudo
. Note that there are no guarantees that it will work, so you may want to add some wait time after changing the IP before running the rest and some feedback from the cluster reset before starting the cluster again.
StaticIP
A script to change the IP in flatcar.
staticIP.sh
385 Bytes
Want to Learn More?
Discover guides on Unified Namespace, IT/OT architecture, and essential tools. Start your journey with the United Manufacturing Hub today!