dotnet / try

Try .NET provides developers and content authors with tools to create interactive experiences.
MIT License
2.9k stars 526 forks source link

Internal Error 500: Running any snippet will cause an error #855

Open zmjack opened 4 years ago

zmjack commented 4 years ago

Describe the bug

I used the command 'dotnet try --verbose' and the site started up. But if I run any code snippets on the website, I get an error:

[MLS.Agent.Middleware.ExceptionFilter] ? System.NotSupportedException: Unsupported log file format. Latest supported version is 7, the log file has version 9.

Did this error occur while using dotnet try or online?

What kind of error was it?

2020-07-08T08:24:01.7676428Z [|6143940c-482c8867e8e63d61.1.] [MLS.Agent.Middleware.ExceptionFilter] ? System.NotSupportedException: Unsupported log file format. Latest supported version is 7, the log file has version 9. at Microsoft.Build.Logging.StructuredLogger.BinLogReader.Replay(Stream stream) in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BinLogReader.cs:line 53

Screenshots

image image

Please complete the following:

jonsequitur commented 4 years ago

Please try installing the latest version:

> dotnet tool uninstall -g dotnet-try
> dotnet tool install -g Microsoft.dotnet-try
zmjack commented 4 years ago

Unfortunately, I installed the Microsoft.dotnet-try 1.0.20268.1, but the error has not disappeared.

2020-07-08T15:45:03.4488876Z [MLS.Agent.Middleware.ExceptionFilter] ❌ System.AggregateException: One or more errors occurred. (Unsupported log file format. Latest supported version is 7, the log file has version 9.) ---> System.NotSupportedException: Unsupported log file format. Latest supported version is 7, the log file has version 9. at Microsoft.Build.Logging.StructuredLogger.BinLogReader.Replay(Stream stream) in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BinLogReader.cs:line 53 at Microsoft.Build.Logging.StructuredLogger.BinLogReader.Replay(String sourceFilePath) in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BinLogReader.cs:line 37 at Buildalyzer.AnalyzerManager.Analyze(String binLogPath, IEnumerable`1 buildLoggers) at WorkspaceServer.Packaging.Package.LoadDesignTimeBuildFromBuildLogFile(Package package, FileSystemInfo binLog) --- End of inner exception stack trace ---

colombod commented 4 years ago

@zmjack we have a newer version not yet published on nuget.org could you see if upgrading using the following command addresses the issues you are encountering

dotnet tool update -g --add-source "https://dotnet.myget.org/F/dotnet-try/api/v3/index.json" Microsoft.dotnet-try
zmjack commented 4 years ago

@colombod Thanks! I tried the newer version and it's working now.

But I think it still has some bugs.

Please look at the GIF: Honeycam 2020-07-09 15-54-25

When I run a snippet, a red block will be displayed if the file 'package_fullBuild.binlog' is not in the directory (./snippets). Wait until the file is generated and everything is fine.

colombod commented 4 years ago

Looks like a race condition on first build action

colombod commented 4 years ago

@colombod Thanks! I tried the newer version and it's working now.

But I think it still has some bugs.

Please look at the GIF: Honeycam 2020-07-09 15-54-25

When I run a snippet, a red block will be displayed if the file 'package_fullBuild.binlog' is not in the directory (./snippets). Wait until the file is generated and everything is fine.

Looks like that the binlog generation is in flight when you attempt the first run. Looks like a race condition to address