FOG Registration Error. Hostname with that name already exists
-
@cojohnson Something like this for MAC searching:
mysql use fog; select * from hostMAC where hmMAC = '68:1c:a2:06:38:b9';
Example:
Something like this for hostname searching:
mysql use fog; select hostName,hostID from hosts where hostName = 'r0219510530wdmb';
-
@Wayne-Workman Sorry for the delay. It is crunch time for us here at school getting all the 1 - 1 devices ready and staff stopping by.
I am having troubles connecting to MySQL to perform a query.
Below is a screenshot of my error.
-
@cojohnson Looks like you have a password set for the MySQL root user. Connect to MySQL using this line:
mysql -u root -p
-
@Wayne-Workman I suspect Ubuntu 16.04, so possibly needs to run with:
sudo mysql -u root
Then run the ALTER USER statement.
-
@Wayne-Workman I am running Ubuntu 14.04. Sorry for the extreme delay. We have just made it past the first week of school. I am able to sign in to the MySQL Server. I am unsure how to run the ALTER USER statement. Any tips? This is my first time interacting with MySQL.
Since I was able to log in to MySQL, is there a need to execute ALTER USER?
-
@cojohnson
Don’t log in with the fogstorage user, use the root user.
mysql -u root -p
then press enter, and supply the correct root password. You should be able to find the root password inside of/opt/fog/.fogsettings
it is labeled assnmysqlpass=
The alter user stuff is only necessary if you want to change your root pass for MySQL (or freshly installing on Ubuntu 16). Once in MySQL, It would be like this:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPasswordGoesHere';
If you don’t want a password set, just remove the pass, leave it as just a set of empty quotes like
''
If you change the password, you must correct this inside/opt/fog/.fogsettings
as well. the setting is labeled assnmysqlpass=
and then re-run the installer. Again, only if changing the password. -
@Wayne-Workman
I have decided not to change my “root” password for “mysql” since i am able to log in.
Could there be a misconfigured setting in MYSQL? Or maybe something to do with PXE?I am able to add host via FOG’s Apache interface, but am still unable to add host via PXE boot.
Any Ideas?
-
@cojohnson I think it’s a bug in the version you’re on. This bug report sounds similar: https://forums.fogproject.org/topic/8524/host-registration-broken
It’s possible that rc-8 was also affected. As soon as rc-10 is out, update to it and try. -
Issue is now fixed in 10. It wasn’t registering any new hosts with the name expected from your typing.
-
@Tom-Elliott
I just upgraded all of the nodes and the server to 10. The issue persists.I did a search on the server for the hostname and MAC. No results were found.
-
This is what it looks like on
Image 1) PXE Boot
Image 2) FOG Registration
Image 3) CMD MAC
Image 4) Server host search for duplicate clients MAC
Image 5) Server host search for duplicate name???
Image 6) Pending hosts on serverImage 1 PXE Boot
Image 2 FOG Registration
Image 3 CMD MAC
Image 4 Search host search for duplicate clients MAC
Image 5 Server host search for duplicate name???
Image 6 Pending hosts on server
-
@cojohnson the issue is the name is in use by another system from the messages I’m seeing. RC 10 fixes the issue that was causing this, but it will not fix the database for you. I am limited to cell phone so I can’t provide decent help maybe one of our other moderators or devs can be more forthcoming?
-
@cojohnson This command will select the host ID, hostname, and MAC from the db where the mac is that one I typed.
sudo -i mysql -D fog select hostMAC.hmHostID,hostMAC.hmMAC,hosts.hostName from hostMAC INNER JOIN hosts ON hosts.hostID = hostMAC.hmHostID where hmMAC='18:5e:0f:f0:a9:55'; quit
You can then either do some searching on the returned information, or delete it via MySQL.
-
@Wayne-Workman
I dont think my issue is caused by that hostname being used by another system. I am trying to perform a Full Host Registration and Inventory on a Dell Laptop. The Dell’s MAC Address is 64:31:50:12:d2:5d. I searched the database for that MAC and got no results.However, during the registration process, I get an error saying
A hostname with that name already exists.
The MAC Address associated with this is: 18:5e:0f:9c:11:24When i searched for that MAC, the query returns that the "hmHostID"s Value is 0.
This happens when trying to register any device. -
@cojohnson are you on RC 10?
-
@Tom-Elliott Yes,
-
@cojohnson so just use SQL to delete that host from both the
hosts
table and thehostMAC
table, and potentially from the groups association table as well. -
@Wayne-Workman
That might help. How do i delete just this host from mysql?Why does FOG seem to be “defaulting” to this host during the Full Host Registration Process?
I did a query on the table and FOG appears to be overwritting the host in the “hosts” table again from looking at the “hostCreateDate” field -
@Wayne-Workman
I deleted that host from both the hosts table and the hostMAC table in mysql. I am still getting the same error when attempting to Register a Host -
I was able to resolve this issue by deleting all (10) hosts with a hmID = 0