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

Object reference not set to an instance of an object when k kestrel on mono 3.8.1 on CentOS 6.5 #29

Closed
gzpbx opened this Issue Sep 2, 2014 · 12 comments

Comments

Projects
None yet
@gzpbx

gzpbx commented Sep 2, 2014

I check the Home project, it says kestrel should support on mono, do I need install something on CentOS first ?

/home/fxUser/.kre/packages/KRE-mono45-x86.1.0.0-alpha3/bin/klr.host.dll Information : 0 : [NuGetAssemblyLoader]: Loaded name=Microsoft.AspNet.Server.Kestrel in 0ms
System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNet.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0 

[fxUser@fat15-linux01 HelloMvc]$ mono -V
Mono JIT compiler version 3.8.1 (master/2332ba9a Wed Aug 27 17:35:50 CST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen
@davidfowl

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl Sep 2, 2014

Member

Only works on osx not on linux

Member

davidfowl commented Sep 2, 2014

Only works on osx not on linux

@gzpbx gzpbx closed this Sep 2, 2014

@Tragetaschen

This comment has been minimized.

Show comment
Hide comment
@Tragetaschen

Tragetaschen Sep 2, 2014

Contributor

Actually, it works on Linux when you replace the libuv.dylib OSX-Binary with a link to a recent libuv-11 binary.
ln -sf /usr/lib/libuv.so.11 native/darwin/universal/libuv.dylib
I've done so successfully with mono-3.8.1 in a Yocto qemu ARM image.

It could work if mono would distinguish between Linux and OSX. Then Kestrel could load a different native library.

Contributor

Tragetaschen commented Sep 2, 2014

Actually, it works on Linux when you replace the libuv.dylib OSX-Binary with a link to a recent libuv-11 binary.
ln -sf /usr/lib/libuv.so.11 native/darwin/universal/libuv.dylib
I've done so successfully with mono-3.8.1 in a Yocto qemu ARM image.

It could work if mono would distinguish between Linux and OSX. Then Kestrel could load a different native library.

@DavidKarlas

This comment has been minimized.

Show comment
Hide comment
@carolynvs

This comment has been minimized.

Show comment
Hide comment
@carolynvs

carolynvs Sep 12, 2014

Was this closed because Kestrel does not intend to support Linux? Or some other reason?

Just wondering if it is a reasonable expectation that one can run asp.net vnext applications on linux using Kestrel. If not, any idea what the recommendation is to use?

carolynvs commented Sep 12, 2014

Was this closed because Kestrel does not intend to support Linux? Or some other reason?

Just wondering if it is a reasonable expectation that one can run asp.net vnext applications on linux using Kestrel. If not, any idea what the recommendation is to use?

@juzzbott

This comment has been minimized.

Show comment
Hide comment
@juzzbott

juzzbott Oct 10, 2014

When I try and use the 'ln -sf /usr/lib/libuv.so.11 native/darwin/universal/libuv.dylib' fix, I get the following error: ln: failed to create symbolic link ‘native/darwin/universal/libuv.dylib’: No such file or directory

This is trying to run the command from the HelloMvc directory using Ubuntu 14.04 and Mono 3.8.0. Where do I need to run this command from to get to work?

juzzbott commented Oct 10, 2014

When I try and use the 'ln -sf /usr/lib/libuv.so.11 native/darwin/universal/libuv.dylib' fix, I get the following error: ln: failed to create symbolic link ‘native/darwin/universal/libuv.dylib’: No such file or directory

This is trying to run the command from the HelloMvc directory using Ubuntu 14.04 and Mono 3.8.0. Where do I need to run this command from to get to work?

@suhasj

This comment has been minimized.

Show comment
Hide comment
@suhasj

suhasj Oct 10, 2014

Contributor

@juzzbott I found this article to be helpful. http://carolynvanslyck.com/blog/2014/09/dotnet-vnext-impressions/ Basically we need to recompile the libuv and drop it in the native/darwin/universal folder in .kpm/Kestrel package folder

Contributor

suhasj commented Oct 10, 2014

@juzzbott I found this article to be helpful. http://carolynvanslyck.com/blog/2014/09/dotnet-vnext-impressions/ Basically we need to recompile the libuv and drop it in the native/darwin/universal folder in .kpm/Kestrel package folder

@ezhaka

This comment has been minimized.

Show comment
Hide comment
@ezhaka

ezhaka Nov 19, 2014

@suhasj I tried to replace libuv.dylib in packages by libuv.dylib provided in the article, but it didn't help, still NullReferenceException. I have mono 3.10.0 installed

ezhaka commented Nov 19, 2014

@suhasj I tried to replace libuv.dylib in packages by libuv.dylib provided in the article, but it didn't help, still NullReferenceException. I have mono 3.10.0 installed

@ezhaka

This comment has been minimized.

Show comment
Hide comment
@ezhaka

ezhaka Nov 19, 2014

#37 helped me, I had installed wrong version of libuv

ezhaka commented Nov 19, 2014

#37 helped me, I had installed wrong version of libuv

@nchinan

This comment has been minimized.

Show comment
Hide comment
@nchinan

nchinan Nov 20, 2014

@MCgee try running ldconfig after you compile and install libuv 0.11.29 . That's what got it working for me

nchinan commented Nov 20, 2014

@MCgee try running ldconfig after you compile and install libuv 0.11.29 . That's what got it working for me

@selimserdengecti

This comment has been minimized.

Show comment
Hide comment
@selimserdengecti

selimserdengecti Dec 7, 2014

It works on Ubuntu 14.04 with libuv 1.x or later. Kestrel might miss some configuration/files which libuv has. As @MCgee mentioned refresh cache with ldconfig after install and hit localhost:5004.

selimserdengecti commented Dec 7, 2014

It works on Ubuntu 14.04 with libuv 1.x or later. Kestrel might miss some configuration/files which libuv has. As @MCgee mentioned refresh cache with ldconfig after install and hit localhost:5004.

@carolynvs

This comment has been minimized.

Show comment
Hide comment
@carolynvs

carolynvs Dec 7, 2014

I just used this blog post to rebuild and update libuv and am able to use kestrel with mono 3.10.0 on ubuntu.

carolynvs commented Dec 7, 2014

I just used this blog post to rebuild and update libuv and am able to use kestrel with mono 3.10.0 on ubuntu.

@stage88

This comment has been minimized.

Show comment
Hide comment
@stage88

stage88 Dec 23, 2014

Here are the instruction to install libuv manually on Ubuntu/linux. You'll need gyp for bellow to work.

wget http://dist.libuv.org/dist/v1.0.0-rc2/libuv-v1.0.0-rc2.tar.gz
tar -xvf libuv-v1.0.0-rc2.tar.gz
cd libuv-v1.0.0-rc2/
./gyp_uv.py -f make -Duv_library=shared_library
make -C out
sudo cp out/Debug/lib.target/libuv.so /usr/lib/libuv.so.1.0.0-rc2
sudo ln -s libuv.so.1.0.0-rc2 /usr/lib/libuv.so.1

Thank to Carolyn: http://carolynvanslyck.com/blog/2014/09/dotnet-vnext-impressions/

Also here is my mono version:

Mono JIT compiler version 3.10.0 (tarball Wed Nov  5 13:32:50 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen

I've used yo aspnet then created an MVC site. I cd into the directory where the project.json is and do kpm restore then kpm build, then k kestrel and viola, I know have an aspnet50 MVC site on my Ubuntu. Yes painful but satisfying.

stage88 commented Dec 23, 2014

Here are the instruction to install libuv manually on Ubuntu/linux. You'll need gyp for bellow to work.

wget http://dist.libuv.org/dist/v1.0.0-rc2/libuv-v1.0.0-rc2.tar.gz
tar -xvf libuv-v1.0.0-rc2.tar.gz
cd libuv-v1.0.0-rc2/
./gyp_uv.py -f make -Duv_library=shared_library
make -C out
sudo cp out/Debug/lib.target/libuv.so /usr/lib/libuv.so.1.0.0-rc2
sudo ln -s libuv.so.1.0.0-rc2 /usr/lib/libuv.so.1

Thank to Carolyn: http://carolynvanslyck.com/blog/2014/09/dotnet-vnext-impressions/

Also here is my mono version:

Mono JIT compiler version 3.10.0 (tarball Wed Nov  5 13:32:50 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen

I've used yo aspnet then created an MVC site. I cd into the directory where the project.json is and do kpm restore then kpm build, then k kestrel and viola, I know have an aspnet50 MVC site on my Ubuntu. Yes painful but satisfying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment