Facing unknown host - network is down error - Cyberpanel on ubuntu 22 installation

At line number 204 on cyberpanel.sh file, there is check IP function which tries to get the IP of the server. And I think it is not able to do that and that’s why in my error logs above it shows - 404 cannot detect IP.

 204 Check_Server_IP() {
 205 Server_IP=$(curl --silent --max-time 30 -4 https://cyberpanel.sh/?ip)
 206   if [[ $Server_IP =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
 207     echo -e "Valid IP detected..."
 208   else
 209     echo -e "Can not detect IP, exit..."
 210     Debug_Log2 "Can not detect IP. [404]"
 211     exit
 212   fi
 213

However, in the very beginning of the installation, before even putting in our choices like 1 for litespeed, Y for Memcached and so, at initialization stage, it prints there - Valid Ip detected.

So something during the installation happens, that blocks the script to get the IP and it returns 404 and then > Ping: unknown host >> network is down error >> installation stops or fails.

I tried to modified the script at line 204, I removed that check IP function’s curl command that you see above. Instead, harcoded my server IP there, so the script has it now.

Check_Server_IP() {
  # Hardcode the public IP instead of relying on curl to fetch it
  Server_IP="I entered IP here"
  echo -e "Valid IP detected..."
}

By the way, this suggestion was provided by Chatgpt.

And then the installation didn’t gave unknown host error, and went ahead. However, during that installation happening for 20 minutes, I was looking at the terminal and there were many errors at various parts. At the end of the installation, I checked the logs and there were around 24 errors, and when I opened port 8090 of my server, it returned 503 error.

So, now I was expected to fix all these errors, however I am a beginner in this server level setup of things. And therefore I am still trying to find a way that the installer works fine itself without me needing to hardcode the IP, and then make it run, but then get all these errors and doubts that there might be other things as well that didn’t went well but hadn’t been noticed yet.

My ping to google always works. Nslookup returns IP of any website. MTR test of 500 pings was almost 100% successful. There was no packet loss. Only hop 7 had 3%. But other hops had zero. I also setup firewall and opened all ports needed such as 80, 443, 8090, 22 and so on.

Can anybody relate this problem and drop in advice? Thanks

My server is at netcup, Rs 1000 G11 with 8GB Ram, AMD EPYC 4 cores, 256GB storage.
IP is german.

Wait, is it because Cyberpanel script might be blocking my server IP? Is there a workaround?

I see a similar post here - Error in installation of cyber panel: installLogs.txt - #4 by die2mrw007