IP addresses/netmask screwed up
We only had one (1) IP bound to eth0 so we wanted to add a /27 to one of our cPanel boxes and the tech typo'd the netmask and screwed things up. I got the IPs removed by removing them from /etc/ipaddrpool and /etc/ips (no help to the 'Show/Delete IP' screen since there was no way to actually remove them).
Ran 'service network restart' and 'service ipaliases restart'.
Now, when checking the IPs, the screen comes up blank, and when listing accounts, we get this:
Obviously WHM is trying to call a file that doesn't fit with it's expected result. Rebooted and still nothing - same errors. 'Show IP Address Usage' shows nothing, 'Show/Edit Reserved IPs' shows this error:
/etc/ipaddrpool and /etc/ips are empty since neither contained our original single IP. Something went haywire - not sure where, or what to do. Tried rebooting; no difference. Websites work, mail flows. Where to look? What to do?
Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
Cpanel::NAT::Object::load_file(Cpanel::NAT::Object=HASH(0x51483f0)) called at /usr/local/cpanel/Cpanel/NAT/Object.pm line 27
Cpanel::NAT::Object::new("Cpanel::NAT::Object") called at /usr/local/cpanel/Cpanel/NAT.pm line 20
Cpanel::NAT::cpnat() called at /usr/local/cpanel/Cpanel/NAT.pm line 29
Cpanel::NAT::get_public_ip("208.110.131.31") called at whostmgr/bin/whostmgr4.pl line 389
main::listaccts() called at whostmgr/bin/whostmgr4.pl line 163Obviously WHM is trying to call a file that doesn't fit with it's expected result. Rebooted and still nothing - same errors. 'Show IP Address Usage' shows nothing, 'Show/Edit Reserved IPs' shows this error:
undef error - Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54. /etc/ipaddrpool and /etc/ips are empty since neither contained our original single IP. Something went haywire - not sure where, or what to do. Tried rebooting; no difference. Websites work, mail flows. Where to look? What to do?
-
Hello :) Is this server setup on a NAT environment? If so, try running the following command and let us know if it helps: /scripts/build_cpnat
Thank you.0 -
]Hello :) Is this server setup on a NAT environment? If so, try running the following command and let us know if it helps:
/scripts/build_cpnat
Thank you.
No, not a NAT environment, but ran the script anyway:[ root@cp1 system># /scripts/build_cpnat info [build_cpnat] 208.110.131.31 => 208.110.131.31 info [build_cpnat] All publicly routeable addresses are the same as the local address. Not a NAT system. Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.0 -
Does /var/cpanel/cpnat exist on your system? If so, and if you are not on a NAT environment, please delete this file and let us know if the issue persists. Thank you. 0 -
]Does /var/cpanel/cpnat exist on your system? If so, and if you are not on a NAT environment, please delete this file and let us know if the issue persists. Thank you.
That did it - thanks. I figured it would be something simple like that. Sure beats un-tarring the system backup directories to try to figure out what needs to be changed/removed. I'd suggest an easier method to roll back to previous configurations from system backups might be a good idea.0 -
I am happy to see the issue is now resolved. Feel free to open a feature request for your system rollback idea via: Submit A Feature Request Thank you. 0 -
I have the same issue, here is what I got Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54. at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54. Cpanel::NAT::Object::load_file(Cpanel::NAT::Object=HASH(0x5daa510)) called at /usr/local/cpanel/Cpanel/NAT/Object.pm line 27 Cpanel::NAT::Object::new("Cpanel::NAT::Object") called at /usr/local/cpanel/Cpanel/NAT.pm line 20 Cpanel::NAT::cpnat() called at /usr/local/cpanel/Cpanel/NAT.pm line 29 Cpanel::NAT::get_public_ip("188.40.77.79") called at whostmgr
I also tried to restore from backup but I got the same error as below Warning: The system failed to reinstall the MySQL database "default_freshout" as "default_freshout" because of an error: Failed to grant "default" access to "default_freshout": Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54.
I ran the code provided above but it did not solve the issue I need help...0 -
Just a follow up, I ran /scripts/build-cpnat and this is what I got root@server [~]# /scripts/build_cpnat info [build_cpnat] 188.40.77.79 => 188.40.77.79 info [build_cpnat] All publicly routeable addresses are the same as the local address. Not a NAT system. Can't use an undefined value as a HASH reference at /usr/local/cpanel/Cpanel/NAT/Object.pm line 54. root@server [~]#
And the /var/cpanel/cpnat does not exist, I am not on NAT0 -
Are you sure "/var/cpanel/cpnat" does not exist on this system? The error message you posted often occurs when this file exists on a system that does not utilize a NAT environment. Thank you. 0 -
I am very sure, it is probably located on another path, can't find anything like it in /var/cpanel/cpnat 0 -
Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome. Thank you. 0
Please sign in to leave a comment.
Comments
10 comments