Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth appeared successful but there was an error sending the service ticket to Garmin #526

Closed
pawperdoo opened this issue Sep 26, 2023 · 37 comments · Fixed by #531
Closed
Assignees

Comments

@pawperdoo
Copy link

Describe the bug
I installed P2G yesterday, Sept 24, 2023 and uploaded my workouts from Peloton to Garmin without problems. I tried to sync today's workout, but get the error "Auth appeared successful but there was an error sending the service ticket." in the webui.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Sync' and select any of today's workout.
  2. Click on 'Sync'

Expected behavior
This was working yesterday and I didn't change any password or settings.

Logs

I see the following messages and stack trace on the log file,

1782 2023-09-25 21:21:22.266 -05:00 [INF] Found 1 workouts remaining after filte ring ExcludedWorkoutTypes. 1783 2023-09-25 21:21:22.273 -05:00 [INF] Converting workouts...
1784 2023-09-25 21:21:22.312 -05:00 [INF] Uploading workouts to Garmin...
1785 2023-09-25 21:21:23.881 -05:00 [INF] HTTP Request: GET - "https://connect.g armin.com/modern/" - Cookie: __cflb=02DiuJLbVZHipNWxN8wwnxZhF2QbAv3GYq9Ufwr MnjJC4; _cfuvid=cjuUxkw8qUHiMQnxEbQF2oZetTKiOAF2nLbMFVi8Lfw-1695694883535-0 -604800000; ADRUM_BTa=R:0|g:df639b31-c29c-4a4a-99cc-7ce9990d5664|n:garmin_8 69629ee-d273-481d-b5a4-f4b0a8c4d5a3; SameSite=None; SESSIONID=YjUyNDFjN2QtN zZlMS00N2RkLThkNWMtOGIwMTE4YTc4OWY0
1786 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/50.0
1787 Accept-Encoding: gzip, deflate
1788 traceparent: 00-1009cb9bf01c97c677baed6f0a2c83c8-57208ab6d382d2f2-00
1789 -
1790 2023-09-25 21:21:23.882 -05:00 [INF] HTTP Response: "Redirect" - GET - "htt ps://connect.garmin.com/modern/" - Date: Tue, 26 Sep 2023 02:21:23 GMT
1791 Connection: keep-alive
1792 Cache-Control: no-store, must-revalidate, no-cache, max-age=0
1793 Location: https://connect.garmin.com/signin/?service=https%3A%2F%2Fconnect. garmin.com%2Fmodern%2F
1794 Pragma: no-cache
1795 Set-Cookie: ADRUM_BTa=R:0|g:df639b31-c29c-4a4a-99cc-7ce9990d5664|n:garmin_8 69629ee-d273-481d-b5a4-f4b0a8c4d5a3; Max-Age=0; Expires=Thu, 01-Jan-1970 00 :00:10 GMT; Path=/; Secure, ADRUM_BTa=R:0|g:3a0f460b-53c5-4132-bb8b-77169a5 86d11; Max-Age=30; Expires=Tue, 26-Sep-2023 02:21:53 GMT; Path=/; Secure, A DRUM_BTa=R:0|g:3a0f460b-53c5-4132-bb8b-77169a586d11|n:garmin_869629ee-d273- 481d-b5a4-f4b0a8c4d5a3; Max-Age=30; Expires=Tue, 26-Sep-2023 02:21:53 GMT; Path=/; Secure, SameSite=None; Max-Age=30; Expires=Tue, 26-Sep-2023 02:21:5 3 GMT; Path=/; Secure, SESSIONID=; Max-Age=0; Expires=Thu, 1 Jan 1970 00:00 :00 GMT; Path=/; Secure; HttpOnly; SameSite=Lax
1796 Strict-Transport-Security: max-age=31536000 ; includeSubDomains
1797 X-Content-Type-Options: nosniff
1798 X-Frame-Options: DENY
1799 x-vcap-request-id: a2aafecf-0b27-4065-4e27-507a2a71647e
1800 X-XSS-Protection: 1; mode=block
1801 CF-Cache-Status: DYNAMIC
1802 Report-To: {"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v3 ?s=1dvcXhwozisc8ggo%2FN8PpbicpD6mr92x5q8eeiJIELkihDozqNO6QaZA%2F3arKlhHIQP0 xrmtwvStL902TcBdMbltCmo7ryM%2BDhzqgpioZ51%2FDgt9z6779XyEx8azGcfTPIWhug%3D%3 D"}],"group":"cf-nel","max_age":604800}
1803 NEL: {"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}
1804 Server: cloudflare
1805 CF-RAY: 80c8087fcbc5cff5-SJC
1806 -
1807 2023-09-25 21:21:23.884 -05:00 [INF] HTTP Request: GET - "https://sso.garmi n.com/sso/login?service=https%3A%2F%2Fconnect.garmin.com%2Fmodern%2F&webhos t=https%3A%2F%2Fconnect.garmin.com&gateway=true&generateExtraServiceTicket= true&generateTwoExtraServiceTickets=true&clientId=GarminConnect" - Cookie: SESSION=13bcc366-a33a-4f73-ba97-07e2479a38ad; VCAP_ID=1f9df7fa-5c0a-45a 1-7014-c55b; __cflb=0H28vqK2vhBdjKAHtwTJuV59urJCcVoSLpRrnMf54ZS; __cf_bm=jo fmBF0k0EXYBD5YNZodgrZdQyh8NL7dHBjQanqPvfk-1695694882-0-Ac0VwcD2lGxc1j0hI8v0 21ErdSzzewlsQsZb7aML5khXfMzVUdIMX6A365ICtQhCVLbPjXZ7s9ohxXupKPsZoVw=; _cfuv id=DXxzlDodFDNR5WCmoPSj2I9N4RzZUqyw6ERj5DHNnXc-1695694882502-0-604800000; o rg.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE=en_US; GARM IN-SSO=1; GarminNoCache=true; GARMIN-SSO-GUID=EDA9E03434C08FD78DEF3FCB4D2CE C9925DA3A00; GARMIN-SSO-CUST-GUID=6298b53c-2427-4996-9f3c-84a4896f8f46; CAS TGC=TGT-155414-jzf15LtU7BT5CYxuhkgqcNisB9XrnGoY2ZWfPV2F7yrWDqaTt2-cas; __cf ruid=74895fbc6d8da36532c7ef6f2e754c43141071e6-1695694883
1808 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/50.0
1809 Accept-Encoding: gzip, deflate
1810 traceparent: 00-1009cb9bf01c97c677baed6f0a2c83c8-0622bcc1338c52f9-00
1811 -
1812 2023-09-25 21:21:23.885 -05:00 [INF] HTTP Response: "Redirect" - GET - "htt ps://sso.garmin.com/sso/login?service=https%3A%2F%2Fconnect.garmin.com%2Fmo dern%2F&webhost=https%3A%2F%2Fconnect.garmin.com&gateway=true&generateExtra ServiceTicket=true&generateTwoExtraServiceTickets=true&clientId=GarminConne ct" - Date: Tue, 26 Sep 2023 02:21:23 GMT
1813 Connection: keep-alive
1814 Location: https://connect.garmin.com/modern/
1815 CF-Ray: 80c8087f2cbc982b-SJC
1816 CF-Cache-Status: DYNAMIC
1817 Access-Control-Allow-Origin: https://www.garmin.com
1818 Set-Cookie: org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCAL E=en; Path=/, CASTGC=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Pa th=/; Secure; HttpOnly, CASTGC=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00: 10 GMT; Path=/sso; Secure; HttpOnly, CASRMC=; Max-Age=0; Expires=Thu, 01-Ja n-1970 00:00:10 GMT; Path=/; Secure; HttpOnly, CASRMC=; Max-Age=0; Expires= Thu, 01-Jan-1970 00:00:10 GMT; Path=/sso; Secure; HttpOnly, CASMFA=; Max-Ag e=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly, CASMF A=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/sso; Secure; Ht tpOnly, GARMIN-SSO=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Doma in=garmin.com; Path=/, GARMIN-SSO=; Max-Age=0; Expires=Thu, 01-Jan-1970 00: 00:10 GMT; Domain=garmin.com; Path=/sso, GarminNoCache=; Max-Age=0; Expires =Thu, 01-Jan-1970 00:00:10 GMT; Domain=garmin.com; Path=/, GarminNoCache=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Domain=garmin.com; Path=/ sso, GARMIN-SSO-GUID=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Do main=garmin.com; Path=/, GARMIN-SSO-GUID=; Max-Age=0; Expires=Thu, 01-Jan-1 970 00:00:10 GMT; Domain=garmin.com; Path=/sso, GARMIN-SSO-CUST-GUID=; Max- Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Domain=garmin.com; Path=/, GA RMIN-SSO-CUST-GUID=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Doma in=garmin.com; Path=/sso, GarminBuyCacheKey=; Max-Age=0; Expires=Thu, 01-Ja n-1970 00:00:10 GMT; Domain=garmin.com; Path=/, GarminBuyCacheKey=; Max-Age =0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Domain=garmin.com; Path=/sso
1819 Access-Control-Allow-Credentials: true
1820 Access-Control-Allow-Headers: Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Contr ol-Request-Headers
1821 Access-Control-Allow-Methods: GET,POST,OPTIONS
1822 X-Application-Context: casServer:cloud,prod,prod-US_1102:7
1823 X-B3-Traceid: 5c8d09122c91189150d9ac03dcc4d6d1
1824 X-Robots-Tag: noindex
1825 X-Vcap-Request-Id: 8f4c4857-17d4-4e73-64ea-4b2db510634c
1826 Report-To: {"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v3 ?s=Okx%2FiRjPon3HyaIn1C2Tm3tUbdqq4VQ5umMg5UJCrd%2Fm6%2FSW%2BMRLOYNSqjo6MdAK hZ5QnJoM10Vu6PQ7Zd8X6tO3Dh9AZxDh2d51RxBE7wewx9dOfMoO6yXtQDqnhMbz"}],"group" :"cf-nel","max_age":604800}
1827 NEL: {"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}
1828 Vary: Accept-Encoding
1829 Server: cloudflare
1830 -
1831 2023-09-25 21:21:23.887 -05:00 [INF] HTTP Request: GET - "https://connect.g armin.com/modern/" - Cookie: GARMIN-SSO=1; GarminNoCache=true; GARMIN-SSO-G UID=EDA9E03434C08FD78DEF3FCB4D2CEC9925DA3A00; GARMIN-SSO-CUST-GUID=6298b53c -2427-4996-9f3c-84a4896f8f46; __cflb=02DiuJLbVZHipNWxN8wwnxZhF2QbAv3GYq9Ufw rMnjJC4; _cfuvid=cjuUxkw8qUHiMQnxEbQF2oZetTKiOAF2nLbMFVi8Lfw-1695694883535- 0-604800000
1832 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/50.0
1833 Accept-Encoding: gzip, deflate
1834 traceparent: 00-1009cb9bf01c97c677baed6f0a2c83c8-83991bbf59cb29ce-00
1835 -
1836 2023-09-25 21:21:23.890 -05:00 [INF] HTTP Response: "Redirect" - GET - "htt ps://connect.garmin.com/modern/" - Date: Tue, 26 Sep 2023 02:21:23 GMT
1837 Connection: keep-alive
1838 Cache-Control: no-store, must-revalidate, no-cache, max-age=0
1839 Location: https://sso.garmin.com/sso/login?service=https%3A%2F%2Fconnect.ga rmin.com%2Fmodern%2F&webhost=https%3A%2F%2Fconnect.garmin.com&gateway=true& generateExtraServiceTicket=true&generateTwoExtraServiceTickets=true&clientI d=GarminConnect
1840 Pragma: no-cache
1841 Set-Cookie: ADRUM_BTa=R:0|g:df639b31-c29c-4a4a-99cc-7ce9990d5664; Max-Age=3 0; Expires=Tue, 26-Sep-2023 02:21:53 GMT; Path=/; Secure, ADRUM_BTa=R:0|g:d f639b31-c29c-4a4a-99cc-7ce9990d5664|n:garmin_869629ee-d273-481d-b5a4-f4b0a8 c4d5a3; Max-Age=30; Expires=Tue, 26-Sep-2023 02:21:53 GMT; Path=/; Secure, SameSite=None; Max-Age=30; Expires=Tue, 26-Sep-2023 02:21:53 GMT; Path=/; S ecure, SESSIONID=YjUyNDFjN2QtNzZlMS00N2RkLThkNWMtOGIwMTE4YTc4OWY0; Path=/; Secure; HttpOnly; SameSite=Lax
1842 Strict-Transport-Security: max-age=31536000 ; includeSubDomains
1843 X-Content-Type-Options: nosniff
1844 X-Frame-Options: DENY
1845 x-vcap-request-id: 072ea369-76f5-4692-5ae7-3e8cca65dfea
1846 X-XSS-Protection: 1; mode=block
1847 CF-Cache-Status: DYNAMIC
1848 Report-To: {"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v3 ?s=1%2FCrHZe2Y212bsS8%2F7Y4RokCEV%2BYhxcO6fqEPRJrfttKp%2B4PM8l8TuPStTTdA%2B zVFC5ZKOlQ7uoGGotwAxSh5wG6CYi5pukODdVO7pEc4ApJRz0lOTpK2M6C3x8JNZny3Qkj8w%3D %3D"}],"group":"cf-nel","max_age":604800}
1849 NEL: {"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}
1850 Server: cloudflare
1851 CF-RAY: 80c8087e3a13cff5-SJC
1852 -
1853 2023-09-25 21:21:23.892 -05:00 [INF] HTTP Request: GET - "https://connect.g armin.com/?ticket=ST-2432068-TENHFDGwdsU6yRN4tMRX-cas" - User-Agent: Mozill a/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/50.0
1854 Cookie: GARMIN-SSO=1; GarminNoCache=true; GARMIN-SSO-GUID=EDA9E03434C08FD78 DEF3FCB4D2CEC9925DA3A00; GARMIN-SSO-CUST-GUID=6298b53c-2427-4996-9f3c-84a48 96f8f46
1855 Accept-Encoding: gzip, deflate
1856 traceparent: 00-1009cb9bf01c97c677baed6f0a2c83c8-37923306fea58e55-00
1857 -
1858 2023-09-25 21:21:23.893 -05:00 [INF] HTTP Response: "Redirect" - GET - "htt ps://connect.garmin.com/?ticket=ST-2432068-TENHFDGwdsU6yRN4tMRX-cas" - Date : Tue, 26 Sep 2023 02:21:23 GMT
1859 Connection: keep-alive
1860 Location: /modern/
1861 Cache-Control: no-cache
1862 CF-Cache-Status: DYNAMIC
1863 Report-To: {"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v3 ?s=aGmhiCHJcqGH%2B9EVkDSZcOzHvAGil7AyxQcvWwTQxLkZUuNY%2Biz41rpFX7CGIlp3MO%2 F9eEoge8cRU9FKbi2JKpvJ8umSulnDJ%2B57oPaLS8nZKo7XnHdntsdS9Iz0tKB8GdW4wQ%3D%3 D"}],"group":"cf-nel","max_age":604800}
1864 NEL: {"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}
1865 Set-Cookie: __cflb=02DiuJLbVZHipNWxN8wwnxZhF2QbAv3GYq9UfwrMnjJC4; SameSite= None; Secure; path=/; expires=Wed, 27-Sep-23 01:21:23 GMT; HttpOnly, _cfuvi d=cjuUxkw8qUHiMQnxEbQF2oZetTKiOAF2nLbMFVi8Lfw-1695694883535-0-604800000; pa th=/; domain=.connect.garmin.com; HttpOnly; Secure; SameSite=None
1866 Server: cloudflare
1867 CF-RAY: 80c8087db987cff5-SJC
1868 -
1869 2023-09-25 21:21:23.895 -05:00 [ERR] Sync failed to authenticate with Garmi n. Auth appeared successful but there was an error sending the service tick et.
1870 Garmin.Auth.GarminAuthenticationError: Auth appeared successful but there w as an error sending the service ticket.
1871 ---> Flurl.Http.FlurlHttpException: Circular redirects detected.
1872 at Flurl.Http.FlurlRequest.HandleExceptionAsync(FlurlCall call, Exceptio n ex, CancellationToken token)
1873 at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent conten t, CancellationToken cancellationToken, HttpCompletionOption completionOpti on)
1874 at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent conten t, CancellationToken cancellationToken, HttpCompletionOption completionOpti on)
1875 at Garmin.Auth.GarminAuthenticationService.CompleteGarminAuthenticationA sync(String loginResult, GarminApiAuthentication auth) in /build/src/Garmin /Auth/GarminAuthenticationService.cs:line 174
1876 --- End of inner exception stack trace ---
1877 at Garmin.Auth.GarminAuthenticationService.CompleteGarminAuthenticationA sync(String loginResult, GarminApiAuthentication auth) in /build/src/Garmin /Auth/GarminAuthenticationService.cs:line 181
1878 at Garmin.Auth.GarminAuthenticationService.RefreshGarminAuthenticationAs ync() in /build/src/Garmin/Auth/GarminAuthenticationService.cs:line 147
1879 at Garmin.Auth.GarminAuthenticationService.GetGarminAuthenticationAsync( ) in /build/src/Garmin/Auth/GarminAuthenticationService.cs:line 70
1880 at Garmin.GarminUploader.UploadAsync(String[] files, Settings settings) in /build/src/Garmin/GarminUploader.cs:line 96
1881 at Garmin.GarminUploader.UploadToGarminAsync() in /build/src/Garmin/Garm inUploader.cs:line 84
1882 at Sync.SyncService.SyncAsync(IEnumerable1 workoutIds, ICollection1 ex clude) in /build/src/Sync/SyncService.cs:line 162

Installation (please complete the following information):

  • OS: Mac OS 13.2.1
  • Method: Docker
  • Version: 3.5.1

Additional context
Add any other context about the problem here.

@pawperdoo pawperdoo added the bug label Sep 26, 2023
@mapperist
Copy link

I'm also seeing this in Docker CLI on Ubuntu Server.

[22:25:43 INF] *********************************************
[22:25:43 INF] P2G Version: p2g_console 3.5.1
[22:25:43 INF] Operating System: Unix
[22:25:43 INF] OS Version: Unix 5.15.0.84
[22:25:43 INF] DotNet Runtime: Unix 5.15.0.84
[22:25:43 INF] Docker Deployment: True
[22:25:43 INF] Config path: /app/configuration.local.json
[22:25:43 INF] *********************************************

@mgsimon
Copy link

mgsimon commented Sep 26, 2023

I have the same issue running on raspberry pi with default docker-compose configuration.

Last sync from yesterday was working fine, but today getting following error message also.

Auth appeared successful but there was an error sending the service ticket.

@mgsimon
Copy link

mgsimon commented Sep 26, 2023

Now I try to import generated tcx-files using garmin connect web UI, but then are many stats, the VO2-max calculation and training-load missing. :-(

General new issue or do I can use any workaround to get sync working again?

@manc74
Copy link

manc74 commented Sep 26, 2023

Seeing the same error here.

Ubuntu 20.04, latest docker image.

Output log shows:

2023-09-26 05:35:57.251 +01:00 [ERR] Sync failed to authenticate with Garmin. Auth appeared successful but there was an error sending the service ticket. Garmin.Auth.GarminAuthenticationError: Auth appeared successful but there was an error sending the service ticket. ---> Flurl.Http.FlurlHttpException: Circular redirects detected. at Flurl.Http.FlurlRequest.HandleExceptionAsync(FlurlCall call, Exception ex, CancellationToken token) at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption) at Flurl.Http.FlurlRequest.SendAsync(HttpMethod verb, HttpContent content, CancellationToken cancellationToken, HttpCompletionOption completionOption) at Garmin.Auth.GarminAuthenticationService.CompleteGarminAuthenticationAsync(String loginResult, GarminApiAuthentication auth) in /build/src/Garmin/Auth/GarminAuthenticationService.cs:line 187 --- End of inner exception stack trace --- at Garmin.Auth.GarminAuthenticationService.CompleteGarminAuthenticationAsync(String loginResult, GarminApiAuthentication auth) in /build/src/Garmin/Auth/GarminAuthenticationService.cs:line 187 at Garmin.Auth.GarminAuthenticationService.RefreshGarminAuthenticationAsync() in /build/src/Garmin/Auth/GarminAuthenticationService.cs:line 147 at Garmin.Auth.GarminAuthenticationService.GetGarminAuthenticationAsync() in /build/src/Garmin/Auth/GarminAuthenticationService.cs:line 71 at Garmin.GarminUploader.UploadAsync(String[] files, Settings settings) in /build/src/Garmin/GarminUploader.cs:line 96 at Garmin.GarminUploader.UploadToGarminAsync() in /build/src/Garmin/GarminUploader.cs:line 88 at Sync.SyncService.SyncAsync(IEnumerable1 workoutIds, ICollection1 exclude) in /build/src/Sync/SyncService.cs:line 162

@mgsimon
Copy link

mgsimon commented Sep 26, 2023

Now I try to import generated tcx-files using garmin connect web UI, but then are many stats, the VO2-max calculation and training-load missing. :-(

General new issue or do I can use any workaround to get sync working again?

Using generated fit- instead of tcx-files are my workaround now.

Result looks similar by uploading these files using Garmin Connect Web UI.

@philosowaffle
Copy link
Owner

philosowaffle commented Sep 26, 2023

I'm seeing the same. Looks like Garmin changed something in their auth flow. it will take me a bit to reverse engineer it. In the meantime, the workaround is to manually upload your files to Garmin.

Will work on getting a fix, but may not be till the weekend.


unrelated to the auth issue....

Now I try to import generated tcx-files using garmin connect web UI, but then are many stats, the VO2-max calculation and training-load missing. :-(

Yes, TCX spec does not support many of the newer data fields. FIT is the preferred format to use if you want the most amount of data captured.

@the-mace
Copy link

I already had "Convert to FIT" set and have this problem

@app4g
Copy link

app4g commented Sep 27, 2023

some sleuthing here, but no outcome yet
pe-st/garmin-connect-export#95 (comment)

@app4g
Copy link

app4g commented Sep 28, 2023

There's some details as to what is now expected.

#lswiderski/mi-scale-exporter#20 (comment)

@philosowaffle
Copy link
Owner

philosowaffle commented Sep 28, 2023

Small update. Good news, several other projects on GitHub have reached a solution for our annual auth issue with Garmin. The solution has been written in Python, so I need to translate that over to C# for us to use. Looks like I'll be doing #524 earlier than expected 😄

Right now I'm estimating I can have this done sometime this weekend (or copy/paste @lswiderski if they beat me to it).

In the meantime the recommendation remains the same, enable SaveLocalCopy and manually upload your files to Garmin. Unfortunately, this is not an option for folks running via GitHub actions 😞. But you should be able to back-sync this weeks workouts once I get the fix pushed.

Thanks to @anlesk, if you're syncing via GitHub Action then you can update to the the latest version of the action and set this new parameter to true. This will save your workouts to the Github Action result as a zip file, which you can then download and manually upload to Garmin.

@Pharkas45
Copy link

I just installed P2G yesterday and experienced the above error. Once the coding is fixed what will I need to do? Will I need to download a new version or does it happen automatically. I was able to upload the fit files to Garmin via the import function in Garmin Connect and that worked very well and it is amazing to have all of my workout data under one APP. I am new to this and very excited to have this upload happen automatically in the background. Thank you

@anlesk
Copy link
Contributor

anlesk commented Sep 28, 2023

Unfortunately, this is not an option for folks running via GitHub actions 😞

@philosowaffle, Wouldn't https://github.com/actions/upload-artifact help to save file to the output?
I can work on PR -> #532

@philosowaffle
Copy link
Owner

Perfect! Merged.

@philosowaffle
Copy link
Owner

Good news, I've got auth working for the non-mfa flow, it needs some polish and more testing before I can hand it off to y'all but should have it done this weekend. MFA flow may take a bit longer to figure out... that or just need to use fresh eyes tmrw.

@philosowaffle
Copy link
Owner

I'm blocked waiting on Activity Upload to be back online so I can verify end to end everything is working.

@philosowaffle
Copy link
Owner

philosowaffle commented Oct 1, 2023

Fix has been merged. Please note that MFA flow is still not working. You can follow issue #541 for updates on this.

To get the latest version of P2G with the fix:

  1. Modify your config file or settings to use upload strategy 2 (NativeImplV1).

Windows exe users

You can download the latest exe here.

Docker users

Please temporarily switch to using the latest tag to get these changes. I'd like to wait to cut a new release until I have MFA flow working as well.

  • console-latest
  • api-latest
  • webui-latest

GitHub Action users

Modify this line, to say :console-latest instead of :stable

@jlambert121
Copy link

I can confirm this is working now, thanks @philosowaffle!

@gunjanmarwah
Copy link

Thanks @philosowaffle when you have a moment, can you please help me validate that I did it correctly? Or whether I need to wait until the other issue you mentioned? I tried to rerun for a few days worth but nothing came through. Thank you for all your work here!

@mapperist
Copy link

Thanks @philosowaffle when you have a moment, can you please help me validate that I did it correctly? Or whether I need to wait until the other issue you mentioned? I tried to rerun for a few days worth but nothing came through. Thank you for all your work here!

If you have MFA turned on, where you have to enter a security code from Garmin, to login or run this tool - you'll have to wait until @philosowaffle gets that flow working again.

@gunjanmarwah
Copy link

gunjanmarwah commented Oct 1, 2023 via email

@philosowaffle
Copy link
Owner

@gunjanmarwah looks like I made a mistake in my original recommendation. Try changing to :console-latest instead of :latest. (will update my original comment to reflect this)

@wfhartford
Copy link

Hi, I'm still getting Error: Invalid credentials after upgrading by docker compose file to use the :console-latest tag. I'm not using MFA and can log in to garmin connect by copying credentials from my configuration file. I've attached the log file.
p2g-log.txt

Thanks for any advice you can provide.

@philosowaffle
Copy link
Owner

@wfhartford can you update your config file to match this line and then try again?

P2G supports two different ways of doing uploads. The first option uses a library maintained by another developer, that project has not been updated with a fix yet. The second strategy (which the above config change will put you on) uses my implementation that has the fix.

Will update original comment to call this out as well.

@wfhartford
Copy link

That worked. Thank you! All the workouts got uploaded. I'm still getting one error at the end of the upload:

[17:04:24 INF] Upload complete.
[17:04:24 ERR] Failed to clean up directory: ./working
System.IO.IOException: Device or resource busy : '/app/working'
   at System.IO.FileSystem.RemoveDirectoryInternal(DirectoryInfo directory, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound)
   at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
   at System.IO.Directory.Delete(String path, Boolean recursive)
   at Common.IOWrapper.Cleanup(String dir) in /build/src/Common/FileHandling.cs:line 177
[17:04:24 INF] Done
[17:04:24 INF] Sleeping for 3600 seconds...

Is that anything to be concerned about?

@philosowaffle
Copy link
Owner

Nothing to be concerned about on your end, shouldn't impact functionality. After all this auth stuff is squared away I'll need to take a closer look, I thought I had squashed that error a while ago.

@wfhartford
Copy link

Is there another issue I should comment on for that? Would you like me to raise one?

@philosowaffle
Copy link
Owner

Dug through some old issues and remember now. I didn't exactly fix it, instead the recommendation is to not mount that directory as it is meant to be transient, something P2G can create and delete at will. When mounted as a volume, it gets locked and P2G can't delete it. In the latest versions of P2G the output directory is the preferred directory to mount. Logs and converted files (when SaveLocalCopy is enabled) get saved there by default.

@wfhartford
Copy link

Thanks again. I removed the entry that made that a mounted directory and the warning is gone.

@aclarke-GH
Copy link

Thank you for your efforts on this, philosowaffle! I am up and running via the github actions method.

@gunjanmarwah
Copy link

gunjanmarwah commented Oct 2, 2023 via email

@manc74
Copy link

manc74 commented Oct 2, 2023

Thanks so much for fixing this!

@the-mace
Copy link

the-mace commented Oct 2, 2023

Updates here worked for me. It didnt pick up prior items it missed so I had to manually select those and tell them to sync but after that looks good!

ClaireE93 added a commit to ClaireE93/peloton-to-garmin that referenced this issue Oct 2, 2023
@velozriding
Copy link

Thanks @philosowaffle for fixing this, much appreciated!

hone added a commit to hone/peloton-to-garmin that referenced this issue Oct 3, 2023
@mgsimon
Copy link

mgsimon commented Oct 5, 2023

Thanks @philosowaffle it's working again with latest. 🚴

@philosowaffle
Copy link
Owner

v3.6.0 is available now.

@pawperdoo
Copy link
Author

I installed v3.6.0 on Docker and verified that I can again sync all my workouts to Garming p2g-webui. Thank you so much for your support and for the quick fix.

@itsBryantP
Copy link

Thanks you @philosowaffle, pulled the latest update and confirmed that auth is now working!

@philosowaffle philosowaffle unpinned this issue Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.