Raistlfiren / garmin-csv-plan

A quick n' dirty way of "automating" training plans into Garmin Connect.
https://raistlfiren.github.io/garmin-csv-plan/
37 stars 6 forks source link

AbstractStep::setGarminID() must be of the type int or null #17

Closed pygoubet closed 3 years ago

pygoubet commented 3 years ago

Hi @Raistlfiren,

The last version of garmin-csv-plan does not run on my raspbian. Could you help me? Thanks advance,

Validating and accessing - tests/Resource/all-example.csv

[OK] File valid

Parsing Workouts

Creating workouts

[error] Error thrown while running command "garmin:workout 'tests/Resource/all-example.csv' -n". Message: "Argument 1 passed to App\Library\Parser\Model\Step\AbstractStep::setGarminID() must be of the type int or null, float given, called in /home/pi/garmin-csv-plan/src/Service/GarminHelper.php on line 73"

[critical] Uncaught Error: Argument 1 passed to App\Library\Parser\Model\Step\AbstractStep::setGarminID() must be of the type int or null, float given, called in /home/pi/garmin-csv-plan/src/Service/GarminHelper.php on line 73

In AbstractStep.php line 153:

Argument 1 passed to App\Library\Parser\Model\Step\AbstractStep::setGarminID() must be of the type int or null, float given, called in /home/pi/garmin-csv-plan/src/S
ervice/GarminHelper.php on line 73

garmin:workout [-m|--email EMAIL] [-p|--password PASSWORD] [-x|--delete] [-X|--delete-only] [--dry-run] [-r|--prefix [PREFIX]] [-s|--start START] [-d|--end END] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] []

Raistlfiren commented 3 years ago

What version of PHP are you running? Please make sure you are running 7.4.

pygoubet commented 3 years ago

Same error:

In AbstractStep.php line 153:

  Argument 1 passed to App\Library\Parser\Model\Step\AbstractStep::setGarminID() must be of the type int or null, flo  
  at given, called in /home/pi/garmin-csv-plan/src/Service/GarminHelper.php on line 73

I will test with a Fedora in a VM instead of Raspbian on Raspberry Pi 3.

Raistlfiren commented 3 years ago

The ID I am getting from Garmin is an int. Can you try it now? I changed int to float. Maybe you get a different type of ID than what I am getting? The Id I am getting from Garmin is 324544696...

Raistlfiren commented 3 years ago

I am going to see if I can't spin up Raspbian in Virtualbox to test as well. Weird it isn't working there. It should be okay.

pygoubet commented 3 years ago

"int to float": same problem on my raspbian. I have tried on cloud instance (scaleway) of Fedora 32 x86_64 and it works fine! But same error message with an ARM instance running Ubuntu Bionic and PHP7.4. It has to be related to either ARM architecture or Debian based OS.

Raistlfiren commented 3 years ago

@pygoubet - I got VirtualBox installed with Raspbian in a VM. I also ran into the same issue. I don't know why it is being detected as a float but I just pushed a commit that should resolve the issue. https://github.com/Raistlfiren/garmin-csv-plan/commit/5d1712db10ac43fb795d2e6edb532803ad2ee257

I tested the code in my Raspbian VM and it worked just fine. Please try it out and see how it works for you. Thanks!

pygoubet commented 3 years ago

Thanks @Raistlfiren the commit 5d1712d fixed the problem I have encountered