Skip to content

cannot retrieve load balancers #351

@nosilver4u

Description

@nosilver4u

Similar error to #350, I cannot retrieve load balancers:

PHP Fatal error:  Uncaught TypeError: Cannot assign string to property DigitalOceanV2\Entity\LoadBalancer::$name of type int in /var/optimize/vendor/toin0u/digitalocean-v2/src/Entity/LoadBalancer.php:70
Stack trace:
#0 /var/optimize/vendor/toin0u/digitalocean-v2/src/Entity/AbstractEntity.php(35): DigitalOceanV2\Entity\LoadBalancer->build()
#1 /var/optimize/vendor/toin0u/digitalocean-v2/src/Api/LoadBalancer.php(39): DigitalOceanV2\Entity\AbstractEntity->__construct()
#2 [internal function]: DigitalOceanV2\Api\LoadBalancer->DigitalOceanV2\Api\{closure}()
#3 /var/optimize/vendor/toin0u/digitalocean-v2/src/Api/LoadBalancer.php(38): array_map()
#4 /var/optimize/utility/exactdn_cert_update.php(17): DigitalOceanV2\Api\LoadBalancer->getAll()
#5 {main}
  thrown in /var/optimize/vendor/toin0u/digitalocean-v2/src/Entity/LoadBalancer.php on line 70

I changed the expected type of $name to string in Entity/LoadBalancer.php and it appears to work, but comparing the existing properties with the available ones in the docs appears to show quite a few missing: https://docs.digitalocean.com/reference/api/digitalocean/#tag/Load-Balancers
With that, I'm not certain fixing the $name property will be sufficient to get the LoadBalancer entity working well enough to perform a subsequent update operation. That is, I'm afraid if someone is using newer features, like global load balancers, performing an update with the object retrieved via getAll() might break their existing lb config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions