LKDevelopment / hetzner-cloud-php-sdk

A PHP SDK for the Hetzner Cloud API
MIT License
104 stars 51 forks source link

Undefined property: stdClass::$description #95

Closed fliespl closed 1 year ago

fliespl commented 1 year ago

Experiencing this from a few days:

WARNING: Notice: Undefined property: stdClass::$description {"exception":"[object] (ErrorException(code: 0): Notice: Undefined property: stdClass::$description at /opt/hetzner-ha/vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/FloatingIps/FloatingIp.php:308)"}

Probably a change in hetzner API?

fliespl commented 1 year ago
  "exception" => ErrorException {
    #message: "Notice: Undefined property: stdClass::$description"
    #code: 0
    #file: "./vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/FloatingIps/FloatingIp.php"
    #line: 308
    #severity: E_NOTICE
    trace: {
      ./vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/FloatingIps/FloatingIp.php:308 { …}
      ./vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/FloatingIps/FloatingIps.php:172 { …}
      LKDev\HetznerCloud\Models\FloatingIps\FloatingIps->LKDev\HetznerCloud\Models\FloatingIps\{closure}() {}
      ./vendor/tightenco/collect/src/Collect/Support/Collection.php:695 { …}
      ./vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/FloatingIps/FloatingIps.php:173 { …}
      ./vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/FloatingIps/FloatingIps.php:184 { …}
      ./vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/FloatingIps/FloatingIps.php:70 { …}
      ./vendor/lkdevelopment/hetzner-cloud-php-sdk/src/Models/FloatingIps/FloatingIps.php:109 { …}
      ./src/Command/VerifyCommand.php:56 {
        App\Command\VerifyCommand->verify()^
        › 
        › $floatingIp = $this->apiClient->floatingIps()->getByName($instanceName);
fliespl commented 1 year ago

It's E_NOTICE on PHP 7.4 and E_WARNING on PHP8+

LKaemmerling commented 1 year ago

Hey @fliespl,

thank you for the notice. Indeed we currently perform a change on the cloud API which had the unintended side-effect that the description was removed when it is null. We deployed a fix already. As we rolled out this specific change (that caused the side-effect) gradually only a tiny portion of the traffic was affected. Thanks for the heads up!