Node registration failed in 1.3.0-RC30
-
Server
- FOG Version: 1.3.0-RC30
- OS: Ubuntu 16.04
Client
- Service Version: Not installed yet
- OS: Windows 7 Pro
Description
I tried to register the node via iPXE, but failed at the last moment.
The node’s screen showed few lines of “Attempting to send inventory…failed” and “Rebooting system as task is completed”. And then the node just hung there.
The server syslog has following lines:
Dec 9 17:00:46 relay FOGPingHosts[11744]: PHP Fatal error: Uncaught Error: Cannot unset string offsets in /var/www/fog/lib/service/pinghosts.class.php:180
Dec 9 17:00:46 relay FOGPingHosts[11744]: Stack trace:
Dec 9 17:00:46 relay FOGPingHosts[11744]: #0 /var/www/fog/lib/service/pinghosts.class.php(209): PingHosts->_commonOutput()
Dec 9 17:00:46 relay FOGPingHosts[11744]: #1 /opt/fog/service/FOGPingHosts/FOGPingHosts(34): PingHosts->serviceRun()
Dec 9 17:00:46 relay FOGPingHosts[11744]: #2 {main}
Dec 9 17:00:46 relay FOGPingHosts[11744]: thrown in /var/www/fog/lib/service/pinghosts.class.php on line 180 -
Updated to RC36, and both full & quick registration worked as expected!
-
I don’t follow.
You’re trying register a node into fog? (Do you mean a host, or an actual FOG Storage Node?)
The error log you posted has nothing to do with host registration.
-
He means a host.
-
@Wayne-Workman How do you know that?
-
@Tom-Elliott because of the error he quoted, “Attempting to send inventory…failed”
-
@Wayne-Workman How do we know what the OP is trying to do?
You know for a fact that they’re trying to register a host? I don’t know that based on the information.
Maybe they’re trying to create a new FOG Storage Node thinking they need to “register it” like a normal host?
We don’t know what the OP is trying to do, which is why I asked the question of the OP.
-
I meant to register a host to fog… I tried again, same result, but syslog had no error messages.
I can find the host in management GUI, but except MAC address, all other fields are empty, not sure if this is right.
-
@Maorui2k These are some DB cleanup commands, run them and share their output with us, and after you run them try to register the host again. Run these via terminal on your server.
sudo -i mysql -D fog DELETE FROM `hosts` WHERE `hostID` = '0'; DELETE FROM `hostMAC` WHERE hmID = '0' OR `hmHostID` = '0'; DELETE FROM `groupMembers` WHERE `gmID` = '0' OR `gmHostID` = '0' OR `gmGroupID` = '0'; DELETE FROM `snapinGroupAssoc` WHERE `sgaID` = '0' OR `sgaSnapinID` = '0' OR `sgaStorageGroupID` = '0'; DELETE from `snapinAssoc` WHERE `saID` = '0' OR `saHostID` = '0' OR `saSnapinID` = '0'; DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`); DELETE FROM `hostMAC` WHERE `hmhostID` NOT IN (SELECT `hostID` FROM `hosts`); DELETE FROM `snapinAssoc` WHERE `saHostID` NOT IN (SELECT `hostID` FROM `hosts`); DELETE FROM `groupMembers` WHERE `gmHostID` NOT IN (SELECT `hostID` FROM `hosts`); quit
-
Here is the output, seems no hostID=0 record. I de-registered and re-registered, same error message. I also reinstalled the Ubuntu & fog server, the result is same.
mysql> select * from hosts; +--------+--------------+--------------------------------------------------+--------+-----------+--------------+---------------------+---------------------+--------------+-----------+--------------+----------+------------+------------+------------------+----------------+------------------+----------------+------------+------------+----------+-------------+------------+--------------+---------------------+--------------+--------------+-------------+-------------+ | hostID | hostName | hostDesc | hostIP | hostImage | hostBuilding | hostCreateDate | hostLastDeploy | hostCreateBy | hostUseAD | hostADDomain | hostADOU | hostADUser | hostADPass | hostADPassLegacy | hostProductKey | hostPrinterLevel | hostKernelArgs | hostKernel | hostDevice | hostInit | hostPending | hostPubKey | hostSecToken | hostSecTime | hostPingCode | hostExitBios | hostExitEfi | hostEnforce | +--------+--------------+--------------------------------------------------+--------+-----------+--------------+---------------------+---------------------+--------------+-----------+--------------+----------+------------+------------+------------------+----------------+------------------+----------------+------------+------------+----------+-------------+------------+--------------+---------------------+--------------+--------------+-------------+-------------+ | 1 | 00e04c6939cd | Created by FOG Reg on December 13, 2016, 5:00 am | | 0 | 0 | 2016-12-13 05:00:40 | 0000-00-00 00:00:00 | fog | | | | | | | | | | | | | | | | 0000-00-00 00:00:00 | | | | | +--------+--------------+--------------------------------------------------+--------+-----------+--------------+---------------------+---------------------+--------------+-----------+--------------+----------+------------+------------+------------------+----------------+------------------+----------------+------------+------------+----------+-------------+------------+--------------+---------------------+--------------+--------------+-------------+-------------+ 1 row in set (0.00 sec) mysql> mysql> DELETE FROM `hosts` WHERE `hostID` = '0'; Query OK, 0 rows affected (0.00 sec) mysql> DELETE FROM `hostMAC` WHERE hmID = '0' OR `hmHostID` = '0'; Query OK, 0 rows affected (0.00 sec) mysql> DELETE FROM `groupMembers` WHERE `gmID` = '0' OR `gmHostID` = '0' OR `gmGroupID` = '0'; Query OK, 0 rows affected (0.00 sec) mysql> DELETE FROM `snapinGroupAssoc` WHERE `sgaID` = '0' OR `sgaSnapinID` = '0' OR `sgaStorageGroupID` = '0'; Query OK, 0 rows affected (0.00 sec) mysql> DELETE from `snapinAssoc` WHERE `saID` = '0' OR `saHostID` = '0' OR `saSnapinID` = '0'; Query OK, 0 rows affected (0.00 sec) mysql> DELETE FROM `hosts` WHERE `hostID` NOT IN (SELECT `hmHostID` FROM `hostMAC`); Query OK, 0 rows affected (0.00 sec) mysql> DELETE FROM `hostMAC` WHERE `hmhostID` NOT IN (SELECT `hostID` FROM `hosts`); Query OK, 0 rows affected (0.00 sec) mysql> DELETE FROM `snapinAssoc` WHERE `saHostID` NOT IN (SELECT `hostID` FROM `hosts`); Query OK, 0 rows affected (0.00 sec) mysql> DELETE FROM `groupMembers` WHERE `gmHostID` NOT IN (SELECT `hostID` FROM `hosts`); Query OK, 0 rows affected (0.00 sec) mysql> quit Bye
-
I found some error messages in Apache logs.
==> /var/log/apache2/other_vhosts_access.log <== 192.168.1.2:80 192.168.1.100 - - [13/Dec/2016:13:38:07 +0800] "GET /fog/service/getversion.php HTTP/1.1" 200 517 "-" "Wget/1.17.1 (linux-gnu)" 192.168.1.2:80 192.168.1.100 - - [13/Dec/2016:13:38:07 +0800] "POST /fog/service/auto.register.php HTTP/1.1" 200 509 "-" "Wget/1.17.1 (linux-gnu)" ==> /var/log/apache2/error.log <== [Tue Dec 13 13:38:19.421859 2016] [php7:error] [pid 15341] [client 192.168.1.100:47434] PHP Fatal error: Uncaught Error: Cannot access self:: when no class scope is active in /var/www/fog/service/inventory.php:30\nStack trace:\n#0 {main}\n thrown in /var/www/fog/service/inventory.php on line 30 ==> /var/log/apache2/other_vhosts_access.log <== 192.168.1.2:80 192.168.1.100 - - [13/Dec/2016:13:38:19 +0800] "POST /fog/service/inventory.php HTTP/1.1" 500 524 "-" "Wget/1.17.1 (linux-gnu)" ==> /var/log/apache2/error.log <== [Tue Dec 13 13:38:21.622073 2016] [php7:error] [pid 15342] [client 192.168.1.100:47436] PHP Fatal error: Uncaught Error: Cannot access self:: when no class scope is active in /var/www/fog/service/inventory.php:30\nStack trace:\n#0 {main}\n thrown in /var/www/fog/service/inventory.php on line 30 ==> /var/log/apache2/other_vhosts_access.log <== 192.168.1.2:80 192.168.1.100 - - [13/Dec/2016:13:38:21 +0800] "POST /fog/service/inventory.php HTTP/1.1" 500 524 "-" "Wget/1.17.1 (linux-gnu)"
-
There were some issues with registration recently (like this one) that have been fixed, can you please update to the latest RC and try again?
-
Updated to RC36, and both full & quick registration worked as expected!