Failed to initialize CoreCLR, HRESULT: 0x80131500 running autorest inside a container
See original GitHub issueI am trying to run autorest
and generate C# code inside a Docker container. The base image I am using is microsoft/dotnet:sdk
.
Here’s a minimal dockerfile:
FROM microsoft/dotnet:sdk
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
RUN apt-get update && \
apt-get nodejs -y
RUN npm install autorest -g && autorest --version=latest
dotnet --version:
root@moby:/# dotnet --version
2.0.0
Autorest --help output from the inside of the container:
root@moby:/# autorest --help
AutoRest Code Generator
(c) 2017 Microsoft Corporation. https://aka.ms/autorest
Build Information
Autorest Bootstrapper : 1.2.2
NetCore framework : 1.0.5
Latest Core Installed : 1.2.2
Requested Core Version : <none>
The issue is when I try to generate the C# code, I get this error (autorest with --debug and --verbose):
22:36:57] Network Enabled: true
AutoRest Code Generator
(c) 2017 Microsoft Corporation. https://aka.ms/autorest
[22:36:57] Requested '1.2.2' version
DEBUG: Creating ConfigurationView : 7 sections.
DEBUG: Creating ConfigurationView : 24 sections.
DEBUG: Creating ConfigurationView : 2 sections.
DEBUG: Creating ConfigurationView : 2 sections.
DEBUG: Creating ConfigurationView : 2 sections.
DEBUG: Creating ConfigurationView : 2 sections.
DEBUG: Creating ConfigurationView : 2 sections.
DEBUG: pipeline-emitter - START
DEBUG: swagger-document-override/md-override-loader - START
DEBUG: swagger-document/loader - START
DEBUG: Emitting 'pipeline' at file:///generated_code/pipeline
DEBUG: pipeline-emitter - END
DEBUG: swagger-document-override/md-override-loader - END
DEBUG: swagger-document/loader - END
DEBUG: swagger-document/individual/transform - START
DEBUG: swagger-document/individual/transform - END
DEBUG: swagger-document/compose - START
DEBUG: swagger-document/compose - END
DEBUG: swagger-document/transform-immediate - START
DEBUG: Creating ConfigurationView : 2 sections.
DEBUG: swagger-document/transform-immediate - END
DEBUG: swagger-document/transform - START
DEBUG: swagger-document/transform - END
DEBUG: swagger-document/emitter - START
DEBUG: csharp/modeler - START
DEBUG: Emitting 'swagger-document' at file:///generated_code/Microsoft.Azure.Namespace.blah
DEBUG: swagger-document/emitter - END
Failed to initialize CoreCLR, HRESULT: 0x80131500
FATAL: csharp/modeler - FAILED
FATAL: Error: AutoRest plugin terminated.
Process() Cancelled due to exception : AutoRest plugin terminated.
AutoRest plugin terminated.
{ Error: AutoRest plugin terminated.
at channel.onClose (/root/.autorest/plugins/autorest/1.2.2/node_modules/autorest-core/lib/pipeline/plugin-endpoint.js:44:88)
at CallbackList.invoke (/root/.autorest/plugins/autorest/1.2.2/node_modules/autorest-core/node_modules/vscode-jsonrpc/lib/events.js:114:39)
at Emitter.fire (/root/.autorest/plugins/autorest/1.2.2/node_modules/autorest-core/node_modules/vscode-jsonrpc/lib/events.js:178:36)
at closeHandler (/root/.autorest/plugins/autorest/1.2.2/node_modules/autorest-core/node_modules/vscode-jsonrpc/lib/main.js:212:26)
at CallbackList.invoke (/root/.autorest/plugins/autorest/1.2.2/node_modules/autorest-core/node_modules/vscode-jsonrpc/lib/events.js:114:39)
at Emitter.fire (/root/.autorest/plugins/autorest/1.2.2/node_modules/autorest-core/node_modules/vscode-jsonrpc/lib/events.js:178:36)
at StreamMessageWriter.AbstractMessageWriter.fireClose (/root/.autorest/plugins/autorest/1.2.2/node_modules/autorest-core/node_modules/vscode-jsonrpc/lib/messageWriter.js:48:27)
at Socket.<anonymous> (/root/.autorest/plugins/autorest/1.2.2/node_modules/autorest-core/node_modules/vscode-jsonrpc/lib/messageWriter.js:70:63)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:511:12) exitCode: 1 }
Running the exact same thing on a MacOS works fine (no errors).
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
self-contained asp.net core web api is getting - Stack Overflow
self-contained asp.net core web api is getting:- Failed to initialize CoreCLR, HRESULT: 0x80131500 on Ubuntu 16.10-x64 · Ask Question. Asked 5 ...
Read more >Issue with VSTS Agent on Ubuntu – Failed to initialize ...
Failed to initialize CoreCLR, HRESULT: 0x80131500. I received this error message when trying to run the “config.sh” command ;.
Read more >Failed to initialize CoreCLR, HRESULT: 0x80131500 - MSDN
Hi Team,. We are in the process of containerizing (Linux container) our .net core console application using Docker. We are able to successfully ......
Read more >dotnet raises the error Failed to initialize CoreCLR, HRESULT ...
use dotnet CLI runner; Run step within Docker container: mcr.microsoft.com/dotnet/core/sdk:2.2-stretch; Docker image platform: Linux; run tests.
Read more >Migrated From Asp.Net Core 1.1 To 2.0. Fails With ... - ADocLib
Fails With "Failed To Initialize Coreclr, Hresult: 0X80004005" ... choosing base image to make.net Core 2.0 service API run on Docker container in....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI, I’m adding a pre-install check to notify about the node version at install time.
And, we’re going to try and repro the macos bug.
Awesome! Reinstalled on MacOS and didn’t get any errors.