A hostname with that name already exists.
-
Hello,
Ever since updating from FOG 1.2.0 to Trunk (v8424, SVN Revision 5837) I have been unable to register a new host via the Full Registration and Inventory option. When attempting to add a new host I get the message “A hostname with that name already exists.”
See the attached image:
I’m still able to register new hosts using the quick registration option and then changing the name from the web menu. It’s just obviously not as convenient.
-
try updating to the latest build.
-
Could also be a host with ID=0.
-
Unlikely. However it won’t hurt to try.
If you can get into the mysql shell, try this:
Of course backup the current DB in case something goes strange.
DELETE FROM hostMAC WHERE hmHostID NOT IN (SELECT hostID from hosts); DELETE FROM hostMAC WHERE hmHostID=0; DELETE FROM hosts WHERE hostID=0; DELETE FROM hosts WHERE hostID NOT IN (SELECT hmHostID from hostMAC);
-
I’ve had to go into MySQL and clean up the tables before when I encountered this issue. In my case it has always been because fog adds the mac address of a bluetooth adapter to a host, and then it gets orphaned or something when I rather delete a host, or make changes to the host. I use PHPMyAdmin instead of the console, but the query is the same.
-
@svalding in that case, i would manually add that address to a host (one you’ll keep track of) and check the checkboxes that say to ignore it. i do something similar with usb network adapters.
-
Sorry for the delay in response. Busy time of the year.
I had the guy with access to the database look for a Host with the ID of 0, but he didn’t get back to me, lol. Going to assume that means he didn’t find one.
I exported the FOG inventory and there wasn’t anything listed with that Host ID.
What I did notice, the MAC address listed in that picture is not the MAC address of the PC I was trying to register/inventory. No matter what device I attempt to full register it displays that MAC address.
I don’t have the MAC address in the inventory, but I think it used to belong to a HP dc5100 that caused me issues in the past.
Maybe attempt to find and delete an entry with that MAC address?
-
@Junkhacker said in A hostname with that name already exists.:
@svalding in that case, i would manually add that address to a host (one you’ll keep track of) and check the checkboxes that say to ignore it. i do something similar with usb network adapters.
I did this (since I don’t have database access) and it worked. Thanks!
Will mark issue as resolved.
-