threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

🐞 [Bug]: CapRover Dashboard App: Details of Workers disappear after few seconds #3281

Open Mik-TF opened 3 months ago

Mik-TF commented 3 months ago

Is there an existing issue for this?

which package/s did you face the problem with?

Dashboard

What happened?

Steps To Reproduce

  1. deploy worker + 2 leaders note
  2. after deployment check the Details page
  3. It changes to only showing leader after some time

which network/s did you face the problem on?

Main

version

Latest

Twin ID/s

No response

Node ID/s

No response

Farm ID/s

No response

Contract ID/s

No response

Relevant screenshots/screen records

image

image

image

Relevant log output

{
  "version": 0,
  "contractId": 47003,
  "nodeId": 20,
  "name": "leader1",
  "created": 1723218864,
  "status": "ok",
  "message": "",
  "flist": "https://hub.grid.tf/tf-official-apps/tf-caprover-latest.flist",
  "publicIP": {
    "ip": "185.206.122.151/24",
    "ip6": "",
    "gateway": "185.206.122.1"
  },
  "planetary": "300:a038:4456:dba6:c5c4:3f0e:cb08:1f32",
  "myceliumIP": "568:c45b:bfd:fdf6:ff0f:0:400:2",
  "interfaces": [
    {
      "network": "nwhrn1a",
      "ip": "10.20.4.2"
    }
  ],
  "capacity": {
    "cpu": 1,
    "memory": 2048
  },
  "mounts": [
    {
      "name": "data0",
      "mountPoint": "/var/lib/docker",
      "size": 53687091200,
      "state": "ok",
      "message": ""
    }
  ],
  "env": {
    "SWM_NODE_MODE": "leader",
    "CAPROVER_ROOT_DOMAIN": "threefold.pro",
    "CAPTAIN_IMAGE_VERSION": "latest",
    "PUBLIC_KEY": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDVRwvsIUUudUJt+DvzX/Jre2hAHS2Y1HDutbe6vxK5Hnr9QoA7iKuTjqcRu9yDR2mN/JFHFIef7nFiXNjERbISqrFK4HIaFLHXuJaGMbUj7Bl3d1g5xGYeDtgh6+rmgeKvxauopY/VwGKVcZ83UYmT6ffkJRCgCqbrVzvfKJUNvucehZPpELcwbVSk3yNmqX+n3twuVsvoyH/m6D6DxiBrbQ0HfW1nDPp4AVfD7cn1fyNOleuHp9vvHy970a+2K5/fpU62sFLDAlvjpKBHaheAPdY+Sck7MfNlSrzAlt1+VSGnj8MsSvcdV1CAdc7muus77o59aIquUxwCfBLfeI85WBLQ63EsafDmkHeF7sJ90Jq5gnzX++fhgAySMFUJKX30HlWJhPCQTaEMSbXkrbqJGchoeY6fH/CWhiBmuZDTe5JOLbpKvSrVz91asD7+mIl+/CFLGwSgilzty+zwgmdlR5PAfK9oiA+cxorZmSu/S7iZv5+rB+mSXbvVONa+LDk= pcone@pcone-computer",
    "DEFAULT_PASSWORD": "10iRQIiS2n",
    "CAPTAIN_IS_DEBUG": "true"
  },
  "entrypoint": "/sbin/zinit init",
  "metadata": "",
  "description": "",
  "rootfs_size": 524288000,
  "corex": false,
  "gpu": [],
  "deploymentName": "leader1",
  "projectName": "caprover/leader1",
  "billing": "No Data Available",
  "wireguard": "[Interface]\nAddress = 100.64.20.3/32\nPrivateKey = ktGQ1KdWvc3h6PpPGrtXVt7EFYsVkO3lOkQYOMZiiyg=\n\n[Peer]\nPublicKey = FnRcXFvMjDU4Do9R0JbdxDHYz2f9q1uTcQtc60eeqG4=\nAllowedIPs = 10.20.0.0/16, 100.64.20.0/32\nPersistentKeepalive = 25\nEndpoint = 185.206.122.131:21837",
  "workers": [
    {
      "version": 0,
      "contractId": 47005,
      "nodeId": 5,
      "name": "work1",
      "created": 1723218869,
      "status": "ok",
      "message": "",
      "flist": "https://hub.grid.tf/tf-official-apps/tf-caprover-latest.flist",
      "publicIP": {
        "ip": "185.206.122.155/24",
        "ip6": "",
        "gateway": "185.206.122.1"
      },
      "planetary": "300:9c4a:29ac:6e0b:c0de:8c84:779b:7c87",
      "myceliumIP": "4e9:c850:c016:888c:ff0f:0:500:2",
      "interfaces": [
        {
          "network": "nwhrn1a",
          "ip": "10.20.5.2"
        }
      ],
      "capacity": {
        "cpu": 1,
        "memory": 2048
      },
      "mounts": [
        {
          "name": "data0",
          "mountPoint": "/var/lib/docker",
          "size": 53687091200,
          "state": "ok",
          "message": ""
        }
      ],
      "env": {
        "SWM_NODE_MODE": "worker",
        "PUBLIC_KEY": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDVRwvsIUUudUJt+DvzX/Jre2hAHS2Y1HDutbe6vxK5Hnr9QoA7iKuTjqcRu9yDR2mN/JFHFIef7nFiXNjERbISqrFK4HIaFLHXuJaGMbUj7Bl3d1g5xGYeDtgh6+rmgeKvxauopY/VwGKVcZ83UYmT6ffkJRCgCqbrVzvfKJUNvucehZPpELcwbVSk3yNmqX+n3twuVsvoyH/m6D6DxiBrbQ0HfW1nDPp4AVfD7cn1fyNOleuHp9vvHy970a+2K5/fpU62sFLDAlvjpKBHaheAPdY+Sck7MfNlSrzAlt1+VSGnj8MsSvcdV1CAdc7muus77o59aIquUxwCfBLfeI85WBLQ63EsafDmkHeF7sJ90Jq5gnzX++fhgAySMFUJKX30HlWJhPCQTaEMSbXkrbqJGchoeY6fH/CWhiBmuZDTe5JOLbpKvSrVz91asD7+mIl+/CFLGwSgilzty+zwgmdlR5PAfK9oiA+cxorZmSu/S7iZv5+rB+mSXbvVONa+LDk= pcone@pcone-computer"
      },
      "entrypoint": "/sbin/zinit init",
      "metadata": "",
      "description": "",
      "rootfs_size": 524288000,
      "corex": false,
      "gpu": [],
      "deploymentName": "leader1",
      "projectName": "caprover/leader1",
      "billing": "No Data Available",
      "wireguard": "[Interface]\nAddress = 100.64.20.3/32\nPrivateKey = ktGQ1KdWvc3h6PpPGrtXVt7EFYsVkO3lOkQYOMZiiyg=\n\n[Peer]\nPublicKey = FnRcXFvMjDU4Do9R0JbdxDHYz2f9q1uTcQtc60eeqG4=\nAllowedIPs = 10.20.0.0/16, 100.64.20.0/32\nPersistentKeepalive = 25\nEndpoint = 185.206.122.131:21837"
    },
    {
      "version": 0,
      "contractId": 47006,
      "nodeId": 1,
      "name": "work2",
      "created": 1723218871,
      "status": "ok",
      "message": "",
      "flist": "https://hub.grid.tf/tf-official-apps/tf-caprover-latest.flist",
      "publicIP": {
        "ip": "185.206.122.156/24",
        "ip6": "",
        "gateway": "185.206.122.1"
      },
      "planetary": "300:2589:76ee:f44e:ce6e:7a22:e0b5:169d",
      "myceliumIP": "588:b6c9:bec0:1dbf:ff0f:0:200:2",
      "interfaces": [
        {
          "network": "nwhrn1a",
          "ip": "10.20.2.2"
        }
      ],
      "capacity": {
        "cpu": 1,
        "memory": 2048
      },
      "mounts": [
        {
          "name": "data0",
          "mountPoint": "/var/lib/docker",
          "size": 53687091200,
          "state": "ok",
          "message": ""
        }
      ],
      "env": {
        "SWM_NODE_MODE": "worker",
        "PUBLIC_KEY": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDVRwvsIUUudUJt+DvzX/Jre2hAHS2Y1HDutbe6vxK5Hnr9QoA7iKuTjqcRu9yDR2mN/JFHFIef7nFiXNjERbISqrFK4HIaFLHXuJaGMbUj7Bl3d1g5xGYeDtgh6+rmgeKvxauopY/VwGKVcZ83UYmT6ffkJRCgCqbrVzvfKJUNvucehZPpELcwbVSk3yNmqX+n3twuVsvoyH/m6D6DxiBrbQ0HfW1nDPp4AVfD7cn1fyNOleuHp9vvHy970a+2K5/fpU62sFLDAlvjpKBHaheAPdY+Sck7MfNlSrzAlt1+VSGnj8MsSvcdV1CAdc7muus77o59aIquUxwCfBLfeI85WBLQ63EsafDmkHeF7sJ90Jq5gnzX++fhgAySMFUJKX30HlWJhPCQTaEMSbXkrbqJGchoeY6fH/CWhiBmuZDTe5JOLbpKvSrVz91asD7+mIl+/CFLGwSgilzty+zwgmdlR5PAfK9oiA+cxorZmSu/S7iZv5+rB+mSXbvVONa+LDk= pcone@pcone-computer"
      },
      "entrypoint": "/sbin/zinit init",
      "metadata": "",
      "description": "",
      "rootfs_size": 524288000,
      "corex": false,
      "gpu": [],
      "deploymentName": "leader1",
      "projectName": "caprover/leader1",
      "billing": "No Data Available",
      "wireguard": "[Interface]\nAddress = 100.64.20.3/32\nPrivateKey = ktGQ1KdWvc3h6PpPGrtXVt7EFYsVkO3lOkQYOMZiiyg=\n\n[Peer]\nPublicKey = FnRcXFvMjDU4Do9R0JbdxDHYz2f9q1uTcQtc60eeqG4=\nAllowedIPs = 10.20.0.0/16, 100.64.20.0/32\nPersistentKeepalive = 25\nEndpoint = 185.206.122.131:21837"
    }
  ]
}
Mahmoud-Emad commented 2 months ago

Check the load deployments in the node deployment list

Mahmoud-Emad commented 2 months ago

During the navigation, I found some extra issues

  1. The Caprover listing isn't working as expected which is reported in this issue.
  2. When attaching a new worker we expect to add it to the same cluster, what happens is right, but we're not doing a watch on it. after adding it I found that it's not listed out, even with the fix of the first point.
  3. The delete button doesn't behave as it should, I deployed a Caprover leader and 2 workers, and then I pressed the delete button, I expected to delete all of the cluster leader and workers, but what happened is that it deleted only the leader and after that it listed the first worker then after deleting it, it listed the second worker as well as it shouldn't happen.

Screencast from 09-03-2024 01:49:58 PM.webm

Mahmoud-Emad commented 2 months ago

The listing issue is fixed in the mentioned PR, However, there is another issue with deleting all of the cluster

Mahmoud-Emad commented 2 months ago

I believe displaying a message to users, informing them that their deployment contains 'leader/workers' and requesting confirmation before deleting all of the cluster, would be helpful. This is the current behavior.

image

Mahmoud-Emad commented 1 month ago

Issue update

Work done

Fix Caprover listing

Changes

Mahmoud-Emad commented 1 month ago

However, there is another issue with deleting all of the cluster

This one also should be fixed in the mentioned PR

Mahmoud-Emad commented 4 weeks ago

Issue update

Some issues were found while applying the fix

Changes

Test Scenarios

  1. Deploy leader, and worker, Go go to the contracts page and delete the deployed leader.
  2. Deploy leader, attach a worker to it then delete the whole cluster just in time without refreshing the page.
  3. Deploy leader, and worker, delete the deployed worker and attach another, then delete the whole cluster just in time without refreshing the page.
  4. Deploy a cluster with 1 leader and 2 workers check the deployment listing dialog and make sure all of them are listed
  5. Delete a cluster with the leader and more than 3 workers and make sure all of them are deleted.
0oM4R commented 2 weeks ago

reopened due: https://github.com/threefoldtech/tfgrid-sdk-ts/pull/3543#issuecomment-2443669305

Mahmoud-Emad commented 3 days ago

Due to https://github.com/threefoldtech/tfgrid-sdk-ts/pull/3543#pullrequestreview-2401254503 the listing is working fine now, however, there is an issue with deleting the Caprover cluster reported in https://github.com/threefoldtech/tfgrid-sdk-ts/pull/3543#issuecomment-2443669305

https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3614

A-Harby commented 3 days ago

Devnet 1ea3613.

I deployed a caprover leader with 2 worekers, and they were listed. image Then I deployed 2 more workers, and none of them were listed either on manage worker or on deployment details!! image image image image