hypercrypt / octopus-db

Importer for Octopus Energy API Data
5 stars 0 forks source link

PHP warnings when running manually #22

Open NiccyB opened 8 months ago

NiccyB commented 8 months ago

Hi,

I ran the command

/usr/bin/php ~/octopus-db/octo octopus/import

manually and the following was output:

PHP Warning:  Attempt to read property "token" on null in /home/nicholas/octopus-db/classes/OctopusEnergy.php on line 58

Warning: Attempt to read property "token" on null in /home/nicholas/octopus-db/classes/OctopusEnergy.php on line 58
PHP Deprecated:  str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/nicholas/octopus-db/classes/OctopusEnergy.php on line 60

Deprecated: str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/nicholas/octopus-db/classes/OctopusEnergy.php on line 60
PHP Warning:  Attempt to read property "upcoming" on null in /home/nicholas/octopus-db/scripts/octopus/import.php on line 48

Warning: Attempt to read property "upcoming" on null in /home/nicholas/octopus-db/scripts/octopus/import.php on line 48
fetching Z04FFxxxxxx's electricity usage page #1
fetching 19L3xxxxxx's electricity usage page #1
fetching 19L3xxxxxx's electricity usage page #2

Everything seems to be continuing to work (in terms of import to the database).

I'm pretty sure I haven't seen those errors previously. PHP version is:

PHP 8.2.10 (cli) (built: Sep  4 2023 08:11:43) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.10, Copyright (c), by Zend Technologies
hypercrypt commented 8 months ago

That suggests that it is having issues turning your API Token into a token that can be used with the GraphQL API

hypercrypt commented 8 months ago

Doesn't look like it's being used yet but will need to look at why it's failing for you.