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

dnx . kestrel crashes on OSX (1.0.0-beta4-11566) (now: 1.0.0-beta5-11682) #518

Closed
chanan opened this issue Apr 30, 2015 · 20 comments
Closed

Comments

@chanan
Copy link

chanan commented Apr 30, 2015

dnvm version: 1.0.0-beta5-10372
dnu version: 1.0.0-beta4-11566

Project unmodified WebApplication generated from scaffold.

Error when running dnx . kestrel:

Missing method .ctor in assembly /Users/ubrauch/.dnx/packages/Microsoft.AspNet.Cryptography.Internal/1.0.0-beta4/lib/dnx451/Microsoft.AspNet.Cryptography.Internal.dll, type System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute
Can't find custom attr constructor image: /Users/ubrauch/.dnx/packages/Microsoft.AspNet.Cryptography.Internal/1.0.0-beta4/lib/dnx451/Microsoft.AspNet.Cryptography.Internal.dll mtoken: 0x0a000004
* Assertion at class.c:5607, condition `!mono_loader_get_last_error ()' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at Microsoft.Framework.DependencyInjection.DataProtectionServices/<GetDefaultServices>d__0.MoveNext () <0x0021f>
  at Microsoft.Framework.DependencyInjection.ServiceCollectionExtensions.TryAdd (Microsoft.Framework.DependencyInjection.IServiceCollection,System.Collections.Generic.IEnumerable`1<Microsoft.Framework.DependencyInjection.ServiceDescriptor>) <0x00070>
  at Microsoft.Framework.DependencyInjection.DataProtectionServiceCollectionExtensions.AddDataProtection (Microsoft.Framework.DependencyInjection.IServiceCollection) <0x00027>
  at Microsoft.Framework.DependencyInjection.IdentityServiceCollectionExtensions.AddIdentity<TUser, TRole> (Microsoft.Framework.DependencyInjection.IServiceCollection,System.Action`1<Microsoft.AspNet.Identity.IdentityOptions>) <0x00023>
  at Microsoft.Framework.DependencyInjection.IdentityServiceCollectionExtensions.AddIdentity<TUser, TRole> (Microsoft.Framework.DependencyInjection.IServiceCollection) <0x0002b>
  at WebApplication.Startup.ConfigureServices (Microsoft.Framework.DependencyInjection.IServiceCollection) <0x000e7>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
* Assertion at class.c:5607, condition `!mono_loader_get_last_error ()' not met

Abort trap: 6
@miguellira
Copy link

@chanan what version of Mono are you running? I'm guessing you're still at 3.x as this is a known issue with that setup. See aspnet/DataProtection#68

Upgrading to 4.0.1 via Homebrew won't help much as you'll run into another issue. See #498

@jensg
Copy link

jensg commented May 2, 2015

@miguellira @chanan I had the same issue. Right now it seems to be fixed.
Edit:
I got the same exception: dnu build I got the same issue: #498

brew untap aspnet/dnx
brew uninstall dnvm
brew tap aspnet/dnx
brew install dnvm
dnvm upgrade -u
dnx . kestrel

Which resulted in this exception:

System.Exception: Error -48 EADDRINUSE address already in use
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Check (Int32 statusCode) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.listen (Microsoft.AspNet.Server.Kestrel.Networking.UvStreamHandle handle, Int32 backlog, Microsoft.AspNet.Server.Kestrel.Networking.uv_connection_cb cb) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.UvStreamHandle.Listen (Int32 backlog, System.Action`4 callback, System.Object state) [0x00000] in <filename unknown>:0 

Apparently something fubar was still running

lsof -i :5004

The above showed me the PID after I killed it everything was working well.

Dnvm: 1.0.0-beta5-10368
Dnu: v1.0.0-beta5-11682
Mono: Mono JIT compiler version 4.0.1 (tarball Mon Apr 27 01:00:48 PDT 2015)

Edit:
I got the same exception: dnu build I got the same issue: #498

@chanan
Copy link
Author

chanan commented May 3, 2015

After some upgrades I now have:
Mono JIT compiler version 4.0.0 ((detached/d136b79 Mon Apr 13 14:40:59 EDT 2015)
dnvm: 1.0.0-beta5-10374
dnx: 1.0.0-beta5-11682

and now running dnx . kestrel:

System.InvalidOperationException: No service for type 'Microsoft.Framework.Runtime.IApplicationEnvironment' has been registered.
  at Microsoft.Framework.DependencyInjection.ServiceProviderExtensions.GetRequiredService (IServiceProvider provider, System.Type serviceType) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.DependencyInjection.ServiceProviderExtensions.GetRequiredService[IApplicationEnvironment] (IServiceProvider provider) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.HostingEngine..ctor (IServiceProvider fallbackServices) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0 
  at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args) [0x00000] in <filename unknown>:0 

@chanan chanan changed the title dnu . kestrel crashes on OSX (1.0.0-beta4-11566) dnx . kestrel crashes on OSX (1.0.0-beta4-11566) (now: 1.0.0-beta5-11682) May 3, 2015
@davidfowl
Copy link
Member

You're missing a slew of other versions. Try reading my blog post http://davidfowl.com/diagnosing-dependency-issues-with-asp-net-5/. Don't cross the streams!

@jdasilva
Copy link

jdasilva commented May 3, 2015

I hit the same exception as @chanan. I started with the empty project which ran OK then added Mvc6. (I also tried running with the beta5 dnx and got the IApplicationEnvironment error) Is there some way through or around this? I basically was just trying to get a simple Mvc6 app running with Code and was working from their AspNet5 page.

Also, I read the post, @davidfowl , but I'm still not clear on how to get updated properly. If my DNX is beta5, how do I get on the beta5 package train? Is there another feed for that or is it just not ready yet?

@davidfowl
Copy link
Member

@jdasilva What package versions are you using?

@jdasilva
Copy link

jdasilva commented May 3, 2015

    "dependencies": {
        "Microsoft.AspNet.Mvc": "6.0.0-beta4",
        "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
        "Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
        "Kestrel": "1.0.0-beta4"
    },

@davidfowl
Copy link
Member

So you're using beta4 packages and you want to use beta5 packages. Change the version...

@davidfowl
Copy link
Member

"dependencies": {
    "Microsoft.AspNet.Mvc": "6.0.0-beta5-*",
    "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta5-*",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta5-*",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5-*",
    "Kestrel": "1.0.0-beta5-*"
}

beta5-* will keep you on the latest beta5 bits

@jdasilva
Copy link

jdasilva commented May 3, 2015

@davidfowl Thank you very much!

That helped because then I realized I needed to configure dnu properly (https://github.com/aspnet/Home/wiki/Configuring-the-feed-used-by-dnu-to-restore-packages). I did also need to brew upgrade mono again which I wasn't sure I absolutely needed. So with that I do seem to be running successfully with:

  • The beta5-* packages above
  • dnx 1.0.0-beta5-11682
  • 1.0.0-beta5-10374
  • mono 4.0.1

Thanks again!

@jensg
Copy link

jensg commented May 3, 2015

I had run this:

brew unlink mono
brew install https://raw.githubusercontent.com/Homebrew/homebrew/68a18ac660515e313cd175c550e3065320dfadec/Library/Formula/mono.rb

I couldn't upgrade mono

brew upgrade mono

resulted in

Error: mono 4.0.1 already installed

Had to run:

brew uninstall mono

to remove mono 3.12.1 and afterwards another command to remove mono 4.0.1

brew uninstall --force mono

after that I was able to install the 4.0.1 version of mono correctly again

brew install mono

I changed the project.json file to match it like this:

"dependencies": {
    "Microsoft.AspNet.Mvc": "6.0.0-beta5-*",
    "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta5-*",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta5-*",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5-*",
    "Kestrel": "1.0.0-beta5-*"
}

Afterwards I ran this:

dnvm upgrade -u

to have it running on 1.0.0-beta5-11682

at last I had to run another:

dnu restore

and then finally:

dnx . kestrel

AAAAAAND

dnu build

does not work

@chanan
Copy link
Author

chanan commented May 3, 2015

@davidfowl I haven't been as successful as some of the others on this thread. I changed the project.json (by the way, tried to recreate from yo aspnet but it is still set to beta4), upgrade mono to 4.0.1 and tried both on the stable and unstable feeds but in either case dnu restore does not find the packages:

Unable to locate Microsoft.AspNet.Mvc >= 6.0.0-beta5-*
...
Unable to locate Kestrel >= 1.0.0-beta5-*

@davidfowl
Copy link
Member

Likely because you don't have the right set of feeds configured

@chanan
Copy link
Author

chanan commented May 3, 2015

These are the feeds in dnvm:

Default Stable: https://www.nuget.org/api/v2
Default Unstable: https://www.myget.org/F/aspnetvnext/api/v2

Looks correct, I think.

@BrennanConroy
Copy link
Member

dnvm is used exclusively for dnx versions. dnu restore uses your Nuget feed configurations

@chanan
Copy link
Author

chanan commented May 3, 2015

@BrennanConroy I am not sure what you mean. The issue is when I do dnu restore it does not find the beta-5 packages as detailed above.

@BrennanConroy
Copy link
Member

You listed your dnvm feeds, those are use by dnvm. dnu doesn't care what dnvm feeds you have, it uses whatever you configured Nuget to use. So go look at your NuGet.config and see if it points to aspnetvnext.
Also mentioned above: https://github.com/aspnet/Home/wiki/Configuring-the-feed-used-by-dnu-to-restore-packages

@chanan
Copy link
Author

chanan commented May 3, 2015

@BrennanConroy Thanks made progress, now I am getting this error when running dnx . kestrel:

System.InvalidOperationException: Unable to resolve path 'config.json'; construct this IConfigurationSourceRoot with a non-null BasePath.
  at Microsoft.Framework.ConfigurationModel.Helper.ConfigurationHelper.ResolveConfigurationFilePath (IConfigurationSourceRoot configuration, System.String path) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ConfigurationModel.JsonConfigurationExtension.AddJsonFile (IConfigurationSourceRoot configuration, System.String path, Boolean optional) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ConfigurationModel.JsonConfigurationExtension.AddJsonFile (IConfigurationSourceRoot configuration, System.String path) [0x00000] in <filename unknown>:0 
  at WebApplication.Startup..ctor (IHostingEnvironment env) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.DependencyInjection.ActivatorUtilities+ConstructorMatcher.CreateInstance (IServiceProvider provider) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.DependencyInjection.ActivatorUtilities.CreateInstance (IServiceProvider provider, System.Type instanceType, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.DependencyInjection.ActivatorUtilities.GetServiceOrCreateInstance (IServiceProvider provider, System.Type type) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Startup.StartupLoader.LoadMethods (System.Type startupType, IList`1 diagnosticMessages) [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureStartup () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureApplicationServices () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start () [0x00000] in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0 
  at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args) [0x00000] in <filename unknown>:0 

@davidfowl
Copy link
Member

I want to make a semi announcement here related to using bleeding edge bits. Please don't use them if you're not willing to do some work to keep with the breaking changes that we make. We made the Announcements repository to notify people of breaking changes like this.

TL;DR if you're unwilling to look at commits and follow along closely with the team, use the stable beta4 bits. If you want to play along with our changes then you need to do the work to keep up. Follow Announcements, follow the commits.

@chanan Your specific issue comes from a design change made to Configuration that forces callers to pass in the full path to the Configuration constructor. aspnet/Configuration@7efb7b2

You have to pass it in now or alway use full paths to config files.

@miguellira
Copy link

@davidfowl Thanks for the tip. I've been watching the Announcements repo for a few days now and saw your recent commits. Using GitHub issues for this seems odd but it works and I am fine with it.

However, it sucks that if you're on OS X and you want to use the latest bits you're stuck with Mono 4.0.1 which results in an always failing dnu build (#498).

Visual Studio Code would feel more like a first rate "IDE" if I could get rid of those red squiggles. :(

Maybe a list of well known issues and/or links to your write ups on the Home repo readme would avoid some of these repeating issue entries.

natemcmaster pushed a commit that referenced this issue Nov 22, 2018
…master

[automated] Merge branch 'release/2.2' => 'master'
ryanbrandenburg pushed a commit that referenced this issue Nov 22, 2018
ryanbrandenburg pushed a commit that referenced this issue Nov 22, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants