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

Failed to initialize CoreCLR, HRESULT: 0x80004005 when starting on CentOS 7.3 #733

Closed
fobaz opened this issue Jul 6, 2017 · 12 comments
Closed

Comments

@fobaz
Copy link

fobaz commented Jul 6, 2017

Latest Visual Studio (2017 version 15.2 (26430.14)),
Windows 10 x64
Server CentOS 7.3 x64
Netcore 1.1.2

Developing the app on Windows, it runs fine on Windows. When trying to run the published release build on Linux, it throws this error: Failed to initialize CoreCLR, HRESULT: 0x80004005.

Creation of a new app on Linux and running it works, but I want to build on Windows and host on Linux server.

Any ideas?

@Petermarcu
Copy link
Member

How are you running the app and what commands are you using to build it? Are you using dotnet publish?

@fobaz
Copy link
Author

fobaz commented Jul 6, 2017

Was using Visual Studio publish, now tried dotnet publish with no difference.
Running with dotnet /var/www/api/bin/appname.dll
Tried adding --fx-version 1.1.2 but didn't make a difference.

@Petermarcu
Copy link
Member

That error usually means one of the dependencies isn't there on linux. Did you yum install all the dependency packages? Sounds like you probably did because you said you were able to run the SDK on that Linux machine?

@fobaz
Copy link
Author

fobaz commented Jul 6, 2017

Yes, I have installed all the dependencies. There is also another app (runtime version 1.1.0) running fine on the server. Just tried right now downgrading this app to 1.1.0, but it did not make a difference. Maybe there is some way to debug to find out what is causing the error?

@Petermarcu
Copy link
Member

@gkhanna79 @steveharter isn't there a switch to enable verbose output that will help figure out what it's looking for?

@Petermarcu
Copy link
Member

Do you have 1.1.2 installed on the linux machine or use 1.1.0?

@fobaz
Copy link
Author

fobaz commented Jul 6, 2017

There is /opt/dotnet/shared/Microsoft.NETCore.App/1.1.2 directory, so I guess it's installed. Otherwise, I think, it would throw an error when ran with --fx-version 1.1.2

@steveharter
Copy link
Member

To capture verbose output:
export COREHOST_TRACE=1

@fobaz
Copy link
Author

fobaz commented Jul 6, 2017

There are some skips like this:

Processing TPA for deps entry [microsoft.aspnetcore.mvc.dataannotations, 1.1.3, lib/netstandard1.6/Microsoft.AspNetCore.Mvc.DataAnnotations.dll]
Considering entry [microsoft.aspnetcore.mvc.dataannotations/1.1.3/lib/netstandard1.6/Microsoft.AspNetCore.Mvc.DataAnnotations.dll] and probe dir [/opt/dotnet/shared/Microsoft.NETCore.App/1.1.2]
Skipping... probe in deps json failed
Local path query exists /var/www/ourapp/bin/Microsoft.AspNetCore.Mvc.DataAnnotations.dll
Adding tpa entry: /var/www/ourapp/bin/Microsoft.AspNetCore.Mvc.DataAnnotations.dll
Processing TPA for deps entry [microsoft.aspnetcore.mvc.formatters.json, 1.1.3, lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Formatters.Json.dll]
Considering entry [microsoft.aspnetcore.mvc.formatters.json/1.1.3/lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Formatters.Json.dll] and probe dir [/opt/dotnet/shared/Microsoft.NETCore.App/1.1.2]
Skipping... probe in deps json failed
Local path query exists /var/www/ourapp/bin/Microsoft.AspNetCore.Mvc.Formatters.Json.dll
Adding tpa entry: /var/www/ourapp/bin/Microsoft.AspNetCore.Mvc.Formatters.Json.dll
Processing TPA for deps entry [microsoft.aspnetcore.mvc.localization, 1.1.3, lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Localization.dll]
Considering entry [microsoft.aspnetcore.mvc.localization/1.1.3/lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Localization.dll] and probe dir [/opt/dotnet/shared/Microsoft.NETCore.App/1.1.2]
Skipping... probe in deps json failed
Local path query exists /var/www/ourapp/bin/Microsoft.AspNetCore.Mvc.Localization.dll
Adding tpa entry: /var/www/ourapp/bin/Microsoft.AspNetCore.Mvc.Localization.dll
Processing TPA for deps entry [microsoft.aspnetcore.mvc.razor.host, 1.1.3, lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Razor.Host.dll]
Considering entry [microsoft.aspnetcore.mvc.razor.host/1.1.3/lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Razor.Host.dll] and probe dir [/opt/dotnet/shared/Microsoft.NETCore.App/1.1.2]
Skipping... probe in deps json failed

I think, they're normal, considering that similar output is in the working app.

The ending of the output:

Property NATIVE_DLL_SEARCH_DIRECTORIES = /opt/dotnet/shared/Microsoft.NETCore.App/1.1.2:
Property PLATFORM_RESOURCE_ROOTS =
Property AppDomainCompatSwitch = UseLatestBehaviorWhenTFMNotSpecified
Property APP_CONTEXT_BASE_DIRECTORY = /var/www/ourapp/bin
Property APP_CONTEXT_DEPS_FILES = /var/www/ourapp/bin/OPMtrAPI.deps.json;/opt/dotnet/shared/Microsoft.NETCore.App/1.1.2/Microsoft.NETCore.App.deps.json
Property FX_DEPS_FILE = /opt/dotnet/shared/Microsoft.NETCore.App/1.1.2/Microsoft.NETCore.App.deps.json
Property JIT_PATH = /opt/dotnet/shared/Microsoft.NETCore.App/1.1.2/libclrjit.so
Property System.GC.Server = true
Failed to initialize CoreCLR, HRESULT: 0x80004005

On the working app, instead of the failure there is a line like this:

Launch host: /opt/dotnet/dotnet, app: ....

I can't see anything wrong... The installed packages in app:

  • Pomelo.EntityFrameworkCore.MySql {1.1.2}
  • Microsoft.AspNetCore {1.1.2}
  • Microsoft.EntityFrameworkCore {1.1.2}
  • Microsoft.Extensions.Logging.Debug {1.1.2}
  • Microsoft.AspNetCore.Cors {1.1.2}
  • Microsoft.NETCore.App {1.1.2}
  • Microsoft.AspNetCore.Mvc {1.1.3}

@steveharter
Copy link
Member

From the output, it looks like it is finding the 1.1.2 directory.

Have you tried Centos 7.1? I'm asking as this is what we're testing on.

Did you try a simple "Hello World" assembly (no extra dependencies)? If this still fails, we can try debugging using gdb or I can try a local repro.

@fobaz
Copy link
Author

fobaz commented Jul 6, 2017

Simple Console app which only prints out "Hello world", created and compiled using VS works fine, however, new WebAPI project fails with the same error. Tried creating new WebAPI project on the server, using dotnet new webapi, but got a few errors when tried to run it:

.assets.json' not found. Run a NuGet package restore to generate this file.
Startup.cs(35,16): error CS0518: Predefined type 'System.Void' is not defined or imported
and etc.

Maybe upgrading the project to netcore 2 preview would help, as it supports RHEL 7.3? After all, will have to do that sooner or later.

Can't downgrade to Centos 7.1, as it's a production server for other projects.

@fobaz
Copy link
Author

fobaz commented Jul 7, 2017

After upgradint to netcore 2.0 preview 2, it works, so I guess netcore 1.1.2 doesn't support Centos 7.3 and netcore 2.0 does.

Thanks for the help.

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

3 participants