yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.88k stars 1.05k forks source link

[Platform] Error populating several fields in NodeDetails and CloudSpecificInfo #6605

Open sb-yb opened 3 years ago

sb-yb commented 3 years ago

Failure to set "subnet" "server_type" "zone" etc. there are no matching fields to reflect. The field names in the beans are subnet_id, az etc. This reflection code in AnsibleNodeUpdateInfo needs to be reworked.

2020-12-09 16:03:34.192 INFO  AnsibleUpdateNodeInfo.java:47 [TaskPool-CreateUniverse(REDACTED)-2] Updating node details for univ uuid=REDACTED, node name=yb-admin-ShashankTestCentOS6-n1.
2020-12-09 16:03:34.195 WARN  AnsibleUpdateNodeInfo.java:90 [TaskPool-CreateUniverse(435d5d0f-c0ca-4c9e-af3d-4bd0088e759a)-2] Skipping field subnet with value "subnet-REDACTED" due to error subnet.
2020-12-09 16:03:34.195 WARN  AnsibleUpdateNodeInfo.java:90 [TaskPool-CreateUniverse(435d5d0f-c0ca-4c9e-af3d-4bd0088e759a)-2] Skipping field name with value "yb-admin-ShashankTestCentOS6-n1" due to error name.
2020-12-09 16:03:34.195 WARN  AnsibleUpdateNodeInfo.java:90 [TaskPool-CreateUniverse(435d5d0f-c0ca-4c9e-af3d-4bd0088e759a)-2] Skipping field zone with value "us-west-2d" due to error zone.
2020-12-09 16:03:34.195 WARN  AnsibleUpdateNodeInfo.java:90 [TaskPool-CreateUniverse(435d5d0f-c0ca-4c9e-af3d-4bd0088e759a)-2] Skipping field server_type with value "cluster-server" due to error server_type.
2020-12-09 16:03:34.196 WARN  AnsibleUpdateNodeInfo.java:90 [TaskPool-CreateUniverse(435d5d0f-c0ca-4c9e-af3d-4bd0088e759a)-2] Skipping field launch_time with value "2020-12-09T23:54:08+00:00" due to error launch_time.
2020-12-09 16:03:34.196 WARN  AnsibleUpdateNodeInfo.java:90 [TaskPool-CreateUniverse(435d5d0f-c0ca-4c9e-af3d-4bd0088e759a)-2] Skipping field launched_by with value "sbapat" due to error launched_by.
2020-12-09 16:03:34.196 WARN  AnsibleUpdateNodeInfo.java:90 [TaskPool-CreateUniverse(435d5d0f-c0ca-4c9e-af3d-4bd0088e759a)-2] Skipping field vpc with value "vpc-REDACTED" due to error vpc.
2020-12-09 16:03:34.196 WARN  AnsibleUpdateNodeInfo.java:90 [TaskPool-CreateUniverse(435d5d0f-c0ca-4c9e-af3d-4bd0088e759a)-2] Skipping field id with value "i-03c689bad10d56034" due to error id.
sb-yb commented 3 years ago

Checked database for json: { "nodeIdx": 1, "nodeName": "yb-admin-ShashankTestCentOS6-n1", "nodeUuid": null, "cloudInfo": { "private_ip": "172.151.70.21", "public_ip": "44.238.100.237", "public_dns": "ec2-44-238-100-237.us-west-2.compute.amazonaws.com", "private_dns": "ip-172-151-70-21.us-west-2.compute.internal", "instance_type": "c5.large", "subnet_id": "subnet-05b0315804f92030c", "az": "us-west-2d", "region": "us-west-2", "cloud": "aws", "assignPublicIP": true, "useTimeSync": false, "mount_roots": null ...

The Node info in UI is showing almost no info out of this: image

sb-yb commented 3 years ago

I am assuming that these field names are going to be platform dependent and that's the reason behind mismatch. In that case the easiest fix may be just using json node instead of bean and hacking up reflection. @bmatican For triage/history/suggestion since this code is from 2016 :)

sb-yb commented 3 years ago

Also @streddy-yb FYI. @yb-andrew @sshev since its a UI bug: Will using JsonNode be better in this case?

sshev commented 3 years ago

@sb-yb the Cloud Info from the screenshot above is rendered basing on universeDetails.nodeDetailsSet[i].cloudInfo of universe json

sb-yb commented 3 years ago

@sb-yb I know. That's the one not getting populated properly above. It only ends up populating az,region,cloud Following fields are not getting populated:

  // The private ip address
  public String private_ip = null;
  // The public ip address.
  public String public_ip = null;
  // The public dns name of the node.
  public String public_dns = null;
  // The private dns name of the node.
  public String private_dns = null;

  // Type of the node (example: c3.xlarge on aws).
  public String instance_type = null;

  // The id of the subnet into which this node is deployed.
  public String subnet_id = null;
sb-yb commented 3 years ago

@sshev to be clear when I say UI bug I mean it exhibits as UI bug. The bug is in backend code that is trying to use reflection to set fields in CloudSpecificInfo bean.