Repository navigation
UI: Host already in the database when adding host #8597
Copy link
Copy link
Closed
Milestone
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
API
CLOUDSTACK VERSION
4.17.1 to 4.18.1
CONFIGURATION
Advanced Networking
KVM
OS / ENVIRONMENT
CentOS 7
Oracle Linux 9
SUMMARY
Error message shown when adding new host, but the host was added actually even with error message. This error happen since 4.17.1, likely there are some DB record influence the process and the API can't handle.
STEPS TO REPRODUCE
Add a new host into cluster
EXPECTED RESULTS
Host added without error.
ACTUAL RESULTS
Hosted added but with error.
2024-02-02 13:43:05,541 DEBUG [c.c.a.ApiServer] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) CIDRs from which account 'Account [{"accountName":"admin","id":2,"uuid":"9189844c-0005-11eb-92dc-52540044e551"}]' is allowed to perform API calls: 0.0.0.0/0,::/0
2024-02-02 13:43:05,543 INFO [o.a.c.a.DynamicRoleBasedAPIAccessChecker] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Account [Account [{"accountName":"admin","id":2,"uuid":"9189844c-0005-11eb-92dc-52540044e551"}]] is Root Admin or Domain Admin, all APIs are allowed.
2024-02-02 13:43:05,545 INFO [o.a.c.a.ProjectRoleBasedApiAccessChecker] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Account [admin] is Root Admin or Domain Admin, all APIs are allowed.
2024-02-02 13:43:05,546 DEBUG [o.a.c.a.StaticRoleBasedAPIAccessChecker] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) RoleService is enabled. We will use it instead of StaticRoleBasedAPIAccessChecker.
2024-02-02 13:43:05,547 INFO [o.a.c.r.ApiRateLimitServiceImpl] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Account [{"accountName":"admin","uuid":"9189844c-0005-11eb-92dc-52540044e551"}] is Root Admin, in this case, API limit does not apply.
2024-02-02 13:43:05,550 WARN [c.c.a.d.ParamGenericValidationWorker] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Received unknown parameters for command addHost. Unknown parameters : clustertype projectid
2024-02-02 13:43:05,552 INFO [c.c.r.ResourceManagerImpl] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Trying to add a new host at http://compute-2.apac-1b.example.com in data center 14
2024-02-02 13:43:05,555 DEBUG [c.c.h.k.d.LibvirtServerDiscoverer] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7
2024-02-02 13:43:05,555 WARN [c.c.h.k.d.LibvirtServerDiscoverer] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) can't setup agent, due to com.cloud.utils.exception.CloudRuntimeException: Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7 - Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7
2024-02-02 13:43:05,555 DEBUG [c.c.h.k.d.LibvirtServerDiscoverer] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) can't setup agent, due to com.cloud.utils.exception.CloudRuntimeException: Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7 - Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7
2024-02-02 13:43:05,556 DEBUG [c.c.r.ResourceManagerImpl] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Could not add host at [http://compute-2.apac-1b.example.com] with zone [14], pod [14] and cluster [11] due to: [ can't setup agent, due to com.cloud.utils.exception.CloudRuntimeException: Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7 - Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7].
2024-02-02 13:43:05,556 INFO [c.c.u.e.CSExceptionErrorCode] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Could not find exception: com.cloud.exception.DiscoveryException in error code list for exceptions
2024-02-02 13:43:05,556 WARN [o.a.c.a.c.a.h.AddHostCmd] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Exception:
2024-02-02 13:43:05,558 INFO [c.c.a.ApiServer] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) Could not add host at [http://compute-2.apac-1b.example.com] with zone [14], pod [14] and cluster [11] due to: [ can't setup agent, due to com.cloud.utils.exception.CloudRuntimeException: Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7 - Skipping host 172.17.0.22 because 3f752e3a-b121-34d7-b98e-efa49c276445 is already in the database for resource 3f752e3a-b121-34d7-b98e-efa49c276445-LibvirtComputingResource with ID 350274d9-d7b1-4cdd-a2e6-fe5f6ee76ec7].
2024-02-02 13:43:05,558 DEBUG [c.c.a.ApiServlet] (qtp1437654187-1615:ctx-e10e9666 ctx-5839d082) (logid:e1b7ea00) ===END=== 0:0:0:0:0:0:0:1 -- POST command=addHost&response=json&projectid=e61c599d-76fb-4cbc-9179-a47b381f49a2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
rajujith commentedon Feb 2, 2024
@levindecaro is the issue with a specific host ? then check the 'host' for any existing records.
weizhouapache commentedon Feb 2, 2024
@levindecaro
can you check if there is another host with same Ip "172.17.0.22" ?
levindecaro commentedon Feb 3, 2024
the hostname and IP are new, and checked host db table did not contain duplicate records.
weizhouapache commentedon Feb 3, 2024
I recall there was a similar issue in the past.
it seems to be a ui bug. Can you try with 4.19.0rc4?
ShiroDN commentedon Feb 29, 2024
Hi, I am trying to set up a POC of 4.19 on my local workstation with 1x management server + 1x hypervisor VPS, and I am encountering the same error with Core/Advanced with security groups in the initial setup wizard.
With Core/Basic setup with security groups, the setup is successful.
I have tried several times and even reinstalled both VPS to be sure. As an OS, I used the standard installation of Ubuntu 22.04.4.
In the management-server.log, I can see that the first "Adding of the host" is successful (in the initial setup wizard) and then it continues through primary storage setup, secondary, and then after secondary storage, it will try to add the same host again, which obviously fails and as a result, the setup wizard fails too.
Here is a log https://gist.github.com/ShiroDN/7f84e6736b2a0db34f812ec93745c460 starting before zone creation up to the service stop. You can see "Adding of the host..." on lines L425 and L1098.
weizhouapache commentedon Feb 29, 2024
@ShiroDN
this seems to be a UI issue with zone creation wizard.
However, the zone should have been created successfully without any issue.
can you check if the zone/cluster/pod/hosts/primary storage/secondary storage are all created ? if yes, and zone is still disabled, you can enable the zone.
ShiroDN commentedon Feb 29, 2024
@weizhouapache Yes, you are right. After enabling a zone, it comes up; zone/cluster/pod/hosts/primary storage/secondary storage were created. Should I create a new issue for this UI bug, or is it enough here?
weizhouapache commentedon Feb 29, 2024
thanks for the update @ShiroDN
we can use this ticket for followup, no need to create an new issue
[-]Host already in the database when adding host[/-][+]UI: Host already in the database when adding host[/+]4 remaining items
sureshanaparti commentedon Jun 26, 2024
Fixed in #9231