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

[Question] - Any idea what I could be doing wrong? #142

Closed
talledo86 opened this issue Jul 13, 2021 · 3 comments
Closed

[Question] - Any idea what I could be doing wrong? #142

talledo86 opened this issue Jul 13, 2021 · 3 comments

Comments

@talledo86
Copy link

I started to experience this issue today, any idea what I could be doing wrong? I've been using the Windows version.

Here is the error I receive when I run the file:

Peloton To Garmin
Unhandled exception. System.FormatException: Could not parse the JSON file.
---> System.Text.Json.JsonReaderException: ',' is invalid after a single JSON value. Expected end of data. LineNumber: 10 | BytePositionInLine: 1.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenUntilAfterAllCommentsAreSkipped(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextToken(Byte marker) at System.Text.Json.Utf8JsonReader.ConsumeNextTokenOrRollback(Byte marker) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.JsonDocument.Parse(ReadOnlySpan1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack)
at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedBytes) at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory1 json, JsonDocumentOptions options)
at System.Text.Json.JsonDocument.Parse(String json, JsonDocumentOptions options)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream input)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
--- End of inner exception stack trace ---
at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
--- End of stack trace from previous location ---
at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at PelotonToGarminConsole.Program.Main(String[] args)

Here is my config. file:

{
// Config Documentation: https://github.com/philosowaffle/peloton-to-garmin/wiki/Configuration
"App": {
"OutputDirectory": "./output",
"WorkingDirectory": "./working",
"SyncHistoryDbPath": "./syncHistory.json",
"EnablePolling": true,
"PollingIntervalSeconds": 86400,
"PythonAndGUploadInstalled": false
}
},

"Format": {
"Fit": true,
"Json": false,
"Tcx": false,
"SaveLocalCopy": true,
"IncludeTimeInHRZones": true,
"IncludeTimeInPowerZones": true
},

"Peloton": {
"Email": "@gmail.com",
"Password": "
*",
"NumWorkoutsToDownload": 10,
"ExcludeWorkoutTypes":
},

"Garmin": {
"Email": "**@gmail.com",
"Password": "
",
"Upload": true,
"FormatToUpload": "fit",
"UploadStrategy": 1
},

"Observability": {

"Prometheus": {
  "Enabled": false,
  "Port": 4000
},

"Jaeger": {
  "Enabled": false,
  "AgentHost": "localhost",
  "AgentPort": 6831
},

"Serilog": {
  "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
  "MinimumLevel": "Information",
  "WriteTo": [
    { "Name": "Console" },
    {
      "Name": "File",
      "Args": {
        "path": "./output/log.txt",
        "rollingInterval": "Day",
        "retainedFileCountLimit": 7
      }
    }
  ]
}

}
}

@philosowaffle
Copy link
Owner

Your json config file is not written correctly. Has extra } after the App section and a missing value for Peloton.ExcludeWorkoutTypes. You can use online validators like this one to help identify where the syntax is incorrect. Below is a corrected file:

{
	"App": {
		"OutputDirectory": "./output",
		"WorkingDirectory": "./working",
		"SyncHistoryDbPath": "./syncHistory.json",
		"EnablePolling": true,
		"PollingIntervalSeconds": 86400,
		"PythonAndGUploadInstalled": false
	},

	"Format": {
		"Fit": true,
		"Json": false,
		"Tcx": false,
		"SaveLocalCopy": true,
		"IncludeTimeInHRZones": true,
		"IncludeTimeInPowerZones": true
	},

	"Peloton": {
		"Email": "@gmail.com",
		"Password": "*",
		"NumWorkoutsToDownload": 10,
		"ExcludeWorkoutTypes": []
	},

	"Garmin": {
		"Email": "**@gmail.com",
		"Password": "",
		"Upload": true,
		"FormatToUpload": "fit",
		"UploadStrategy": 1
	},

	"Observability": {

		"Prometheus": {
			"Enabled": false,
			"Port": 4000
		},

		"Jaeger": {
			"Enabled": false,
			"AgentHost": "localhost",
			"AgentPort": 6831
		},

		"Serilog": {
			"Using": ["Serilog.Sinks.Console", "Serilog.Sinks.File"],
			"MinimumLevel": "Information",
			"WriteTo": [{
					"Name": "Console"
				},
				{
					"Name": "File",
					"Args": {
						"path": "./output/log.txt",
						"rollingInterval": "Day",
						"retainedFileCountLimit": 7
					}
				}
			]
		}
	}
}

@talledo86
Copy link
Author

Thank you for the quick reply. My rides are now working fine, however, Strength and Stretch Classes are not. Those are moved to the failed folder. Any ideas on how to get these working?

image

@philosowaffle
Copy link
Owner

Checkout issue #138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants