mgifos / quick-plan

Defines and schedules Garmin workouts
Apache License 2.0
137 stars 23 forks source link

Unable to create workout #56

Open stevenbitner opened 4 years ago

stevenbitner commented 4 years ago

I tried running the source via sbt and also the released executable and the connectiin seems to be working although actual workout creation seems to fail. I've tried with "import" and "schedule" commands and get the same error:

Successfully logged in to Garmin Connect!

Creating workouts:
Exception in thread "main" java.util.concurrent.ExecutionException: Boxed Error
    at scala.concurrent.impl.Promise$.resolver(Promise.scala:87)
    at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:79)
    at scala.concurrent.impl.Promise$KeptPromise$.apply(Promise.scala:406)
    at scala.concurrent.Promise$.fromTry(Promise.scala:142)
    at scala.concurrent.Promise$.failed(Promise.scala:128)
    at scala.concurrent.Future$.failed(Future.scala:623)
    at com.github.mgifos.workouts.GarminConnect.$anonfun$createWorkouts$3(GarminConnect.scala:67)
    at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
    at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
    at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
    at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
    at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
    at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.Error: Cannot create workout
    ... 15 more
GrygoriyChk commented 4 years ago

Hi, can you help for dummies, what you did to progress to this step? Just unpack and run .bat file? I am trying to do so but cmd doesn't recognize bat. thanks!

stevenbitner commented 4 years ago

For running from the release, I followed this https://github.com/mgifos/quick-plan#installation and used the command line options examples that follow that. I'm on a Mac, on Windows it would be the .bat executable.

Raistlfiren commented 4 years ago

@stevenbitner - I think this is a problem with logging in and authenticating the requests. I ran into this as well, but I haven't found a solid workaround for it. It is like the SESSIONID isn't being relayed with the cookies after logging in properly.

stevenbitner commented 4 years ago

@Raistlfiren - you say you haven't found a solid workaround for it. Any chance you're willing to share a flimsy kludge workaround 😄 ?

GrygoriyChk commented 4 years ago

For running from the release, I followed this https://github.com/mgifos/quick-plan#installation and used the command line options examples that follow that. I'm on a Mac, on Windows it would be the .bat executable.

I am on Windows. I do follow instructions, Java 8 seems to be in place, copy, unzip and run bat and than command line. In Command line it doesn't recognize "quick-plan" as bat. Tried to fix path, did the same on a few machines and still nothing.

mgifos commented 4 years ago

I can confirm the similar behavior on Linux, I got this:

Successfully logged in to Garmin Connect! [error] (run-main-0) java.util.concurrent.ExecutionException: Boxed Error [error] java.util.concurrent.ExecutionException: Boxed Error [error] at scala.concurrent.impl.Promise$.resolver(Promise.scala:87) [error] at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:79) [error] at scala.concurrent.impl.Promise$KeptPromise$.apply(Promise.scala:406) [error] at scala.concurrent.Promise$.fromTry(Promise.scala:142) [error] at scala.concurrent.Promise$.failed(Promise.scala:128) [error] at scala.concurrent.Future$.failed(Future.scala:623) [error] at com.github.mgifos.workouts.GarminConnect.$anonfun$getWorkoutsMap$1(GarminConnect.scala:158) [error] at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307) [error] at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41) [error] at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64) [error] at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) [error] at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91) [error] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) [error] at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85) [error] at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91) [error] at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) [error] at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44) [error] at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [error] at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [error] at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [error] at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [error] Caused by: java.lang.Error: Cannot retrieve workout list from Garmin Connect [error] at com.github.mgifos.workouts.GarminConnect.$anonfun$getWorkoutsMap$1(GarminConnect.scala:158) [error] at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307) [error] at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41) [error] at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64) [error] at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) [error] at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91) [error] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) [error] at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85) [error] at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91) [error] at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) [error] at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44) [error] at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [error] at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [error] at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [error] at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [error] Nonzero exit code: 1 [error] (Compile / run) Nonzero exit code: 1

It seems we need a new release of the software. My guess would be that Garmin has changed something in their API.

Raistlfiren commented 4 years ago

@mgifos and @stevenbitner - I noticed that this Python project works okay - https://github.com/petergardfjall/garminexport authenticating to Garmin Connect. It is in essence getting the body of the login request, grabbing the response_url from the HTML body, and fetching the session from that URLs response. I was trying to replicate the functionality, but my Scala is limited. I started work on it, but I am unsure how to do a synchronous request in Scala to get the ticket URL since I keep on getting Future[String] or something like that.

Here is the method that extracts the url - https://github.com/petergardfjall/garminexport/blob/master/garminexport/garminclient.py#L137 This is the authenticate method - https://github.com/petergardfjall/garminexport/blob/master/garminexport/garminclient.py#L103

JCPvanHooren commented 4 years ago

Seems a new release is needed indeed; getting the same behavior. Happy to help testing, but I have no knowledge of Scala.

Brilgwae commented 4 years ago

Hi @mgifos,

Any luck for a release ?

Here's what I got today

Successfully logged in to Garmin Connect! Exception in thread "main" java.util.concurrent.ExecutionException: Boxed Error at scala.concurrent.impl.Promise$.resolver(Promise.scala:87) at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:79) at scala.concurrent.impl.Promise$KeptPromise$.apply(Promise.scala:406) at scala.concurrent.Promise$.fromTry(Promise.scala:142) at scala.concurrent.Promise$.failed(Promise.scala:128) at scala.concurrent.Future$.failed(Future.scala:623) at com.github.mgifos.workouts.GarminConnect.$anonfun$getWorkoutsMap$1(GarminConnect.scala:158) at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307) at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44) at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.lang.Error: Cannot retrieve workout list from Garmin Connect ... 15 more

andygoundry commented 4 years ago

Yeah, me too... I also see the same errors "Cannot retrieve workout list from Garmin Connect" and "Cannot create workout"

andygoundry commented 4 years ago

Is this project still being maintained?

mgifos commented 4 years ago

It is, but it seems there's no one else but me to fix this and I'm over busy these days :(

8cH9azbsFifZ commented 4 years ago

Same for me. A fix release would be great.

pygoubet commented 4 years ago

This project looks great, can we expect a fix to: Successfully logged in to Garmin Connect!

Creating workouts: Exception in thread "main" java.util.concurrent.ExecutionException: Boxed Error at scala.concurrent.impl.Promise$.resolver(Promise.scala:87) at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:79) at scala.concurrent.impl.Promise$KeptPromise$.apply(Promise.scala:406) at scala.concurrent.Promise$.fromTry(Promise.scala:142) at scala.concurrent.Promise$.failed(Promise.scala:128) at scala.concurrent.Future$.failed(Future.scala:623) at com.github.mgifos.workouts.GarminConnect.$anonfun$createWorkouts$3(GarminConnect.scala:67) at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307) at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44) at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.lang.Error: Cannot create workout ... 15 more

Brilgwae commented 3 years ago

Hi @mgifos, I guess this project is dead, right ?

pygoubet commented 3 years ago

Hi @mgifos, I guess this project is dead, right ?

It seems so... Have a look to https://github.com/Raistlfiren/garmin-csv-plan I have just tested it. It works great!

Raistlfiren commented 3 years ago

CAUTION Be careful on using what I created. I made it for myself and my plans are purely just for running. If I could have figured out the login issue in Scala, then I would have wrote it for this project. YMMV.