Ombi: 500 Internal Server error on first run - Ubuntu 14.04

Created on 20 Mar 2016  Â·  38Comments  Â·  Source: tidusjar/Ombi

I am trying to run this on a Ubuntu 14.04 machine via Mono.

I simply unzipped the files and then ran it via mono PlexRequests.exe as the readme suggests. I get a 500 internal server error when going to the page http://localhost:3579/

Here is the large stacktrace it gives:

Error Details

Nancy.RequestExecutionException: Oh noes! ---> System.SystemException: Error running mcs: Cannot find the specified file
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[]) <0x004c3>
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[]) <0x00023>
at Mono.CSharp.CSharpCodeCompiler.CompileFromDomBatch (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x0036f>
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromDomBatch (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x00023>
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromDom (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x00034>
at Nancy.ViewEngines.Razor.RazorViewEngine.GenerateRazorViewFactory (Nancy.ViewEngines.Razor.IRazorViewRenderer,System.Web.Razor.GeneratorResults,System.Reflection.Assembly,System.Type,Nancy.ViewEngines.ViewLocationResult) <0x004f3>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetCompiledViewFactory (string,System.IO.TextReader,System.Reflection.Assembly,System.Type,Nancy.ViewEngines.ViewLocationResult) <0x00143>
at Nancy.ViewEngines.Razor.RazorViewEngine/<>c__DisplayClass5c.b__5b (Nancy.ViewEngines.ViewLocationResult) <0x00063>
at Nancy.ViewEngines.DefaultViewCache/<>c__DisplayClass1`1>.b__0 (Nancy.ViewEngines.ViewLocationResult) <0x00018>
at System.Collections.Concurrent.ConcurrentDictionary`2/c__AnonStorey3.<>m__0 () <0x00025>
at (wrapper delegate-invoke) System.Func`1>.invoke_TResult () <0x00046>
at System.Collections.Concurrent.SplitOrderedList`2>.ListInsert (System.Collections.Concurrent.SplitOrderedList`2/Node>,System.Collections.Concurrent.SplitOrderedList`2/Node>,System.Collections.Concurrent.SplitOrderedList`2/Node>&,System.Func`1>) <0x000f2>
at System.Collections.Concurrent.SplitOrderedList`2>.InsertInternal (uint,Nancy.ViewEngines.ViewLocationResult,System.Collections.Generic.KeyValuePair`2,System.Func`1>,System.Collections.Concurrent.SplitOrderedList`2/Node>&) <0x000af>
at System.Collections.Concurrent.SplitOrderedList`2>.InsertOrGet (uint,Nancy.ViewEngines.ViewLocationResult,System.Collections.Generic.KeyValuePair`2,System.Func`1>) <0x00037>
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd (Nancy.ViewEngines.ViewLocationResult,System.Func`2) <0x001eb>
at Nancy.ViewEngines.DefaultViewCache.GetOrAdd> (Nancy.ViewEngines.ViewLocationResult,System.Func`2>) <0x0014f>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetOrCompileView (Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,System.Type) <0x00166>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0018f>
at System.Dynamic.UpdateDelegates.UpdateAndExecute5 (System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x004d5>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetViewInstance (Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0038c>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0015b>
at System.Dynamic.UpdateDelegates.UpdateAndExecute5 (System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x004d5>
at Nancy.ViewEngines.Razor.RazorViewEngine/<>c__DisplayClass2b.b__2a (System.IO.Stream) <0x001e7>
at Nancy.Responses.MaterialisingResponse.PreExecute (Nancy.NancyContext) <0x00060>

  --- End of inner exception stack trace ---
  at Nancy.NancyEngine.InvokeOnErrorHook (Nancy.NancyContext context, Nancy.ErrorPipeline pipeline, System.Exception ex) [0x00000] in :0

Most helpful comment

Yeah it looks like it is running fine now :)

All 38 comments

This seems to the be the same Issue as #48

Casing issue with view names?

@grumpydev the views are CamelCased and when I return the views I use the same casing.

Any other logs you need from me just let me know

Any updates on this? Would really love to use this software.

Nothing yet. I'm hoping the Nancy team could assist on this one.

Would you mind if I created you a custom build to try and see if it resolves it?

The change would be to change the casing to all lowercase for the views.

@tidusjar I would not mind trying that to see if it works.

I also added some specific Unix code when the application starts up so it is able to handle shutdown/stop of the process correctly when running as a deamon.

Here's the build: https://ci.appveyor.com/project/tidusjar/requestplex/build/1.4.44/artifacts

Let me know how you get on.

Did not work. Here is the error when I go to the webpage:

Nancy.RequestExecutionException: Oh noes! ---> System.SystemException: Error running mcs: Cannot find the specified file
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[]) <0x004c3>
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[]) <0x00023>
at Mono.CSharp.CSharpCodeCompiler.CompileFromDomBatch (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x0036f>
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromDomBatch (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x00023>
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromDom (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x00034>
at Nancy.ViewEngines.Razor.RazorViewEngine.GenerateRazorViewFactory (Nancy.ViewEngines.Razor.IRazorViewRenderer,System.Web.Razor.GeneratorResults,System.Reflection.Assembly,System.Type,Nancy.ViewEngines.ViewLocationResult) <0x004f3>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetCompiledViewFactory (string,System.IO.TextReader,System.Reflection.Assembly,System.Type,Nancy.ViewEngines.ViewLocationResult) <0x00143>
at Nancy.ViewEngines.Razor.RazorViewEngine/<>c__DisplayClass5c.b__5b (Nancy.ViewEngines.ViewLocationResult) <0x00063>
at Nancy.ViewEngines.DefaultViewCache/<>c__DisplayClass1`1>.b__0 (Nancy.ViewEngines.ViewLocationResult) <0x00018>
at System.Collections.Concurrent.ConcurrentDictionary`2/c__AnonStorey3.<>m__0 () <0x00025>
at (wrapper delegate-invoke) System.Func`1>.invoke_TResult () <0x00046>
at System.Collections.Concurrent.SplitOrderedList`2>.ListInsert (System.Collections.Concurrent.SplitOrderedList`2/Node>,System.Collections.Concurrent.SplitOrderedList`2/Node>,System.Collections.Concurrent.SplitOrderedList`2/Node>&,System.Func`1>) <0x000f2>
at System.Collections.Concurrent.SplitOrderedList`2>.InsertInternal (uint,Nancy.ViewEngines.ViewLocationResult,System.Collections.Generic.KeyValuePair`2,System.Func`1>,System.Collections.Concurrent.SplitOrderedList`2/Node>&) <0x000af>
at System.Collections.Concurrent.SplitOrderedList`2>.InsertOrGet (uint,Nancy.ViewEngines.ViewLocationResult,System.Collections.Generic.KeyValuePair`2,System.Func`1>) <0x00037>
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd (Nancy.ViewEngines.ViewLocationResult,System.Func`2) <0x001eb>
at Nancy.ViewEngines.DefaultViewCache.GetOrAdd> (Nancy.ViewEngines.ViewLocationResult,System.Func`2>) <0x0014f>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetOrCompileView (Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,System.Type) <0x00166>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0018f>
at System.Dynamic.UpdateDelegates.UpdateAndExecute5 (System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x004d5>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetViewInstance (Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0038c>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0015b>
at System.Dynamic.UpdateDelegates.UpdateAndExecute5 (System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x004d5>
at Nancy.ViewEngines.Razor.RazorViewEngine/<>c__DisplayClass2b.b__2a (System.IO.Stream) <0x001e7>
at Nancy.Responses.MaterialisingResponse.PreExecute (Nancy.NancyContext) <0x00060>

  --- End of inner exception stack trace ---
  at Nancy.NancyEngine.InvokeOnErrorHook (Nancy.NancyContext context, Nancy.ErrorPipeline pipeline, System.Exception ex) [0x00000] in :0 

Here is the exact process I went through to get this build going:

% cd /opt/PlexRequest

% rm -rf *

% wget https://ci.appveyor.com/api/buildjobs/6dge2jlrc0v358ep/artifacts/PlexRequests.zip
2016-03-23 14:47:24 (2.94 MB/s) - ‘PlexRequests.zip’ saved [5989363/5989363]

% unzip PlexRequests.zip

% 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

% cd Release

% sudo mono PlexRequests.exe
Version: 1.4.1
Request Plex is running on the following: http://+:3579/

Damn... I'm stabbing in the dark here not knowing much about Linux... Does this make any sense to you? http://stackoverflow.com/questions/26202778/how-to-set-path-to-mono-so-supervisor-knows-about-it

It's funny, I came across the same stack overview page when I Was trying to find a solution, but I'm not sure where the "supervisor configuration file" is located, since I've never tried to use mono with Nancy before. Do you have any thoughts where that is located?

It's not using supervisor. But from what the post is saying is that Nancy (PlexRequests) cannot see Mono maybe... I'm going to spin up a Ubuntu VM and see what I can do.

https://github.com/NancyFx/Nancy/wiki/Hosting-Nancy-with-Nginx-on-Ubuntu#install-supervisor

The supervisor according to that Nancy page is actually a whole separate program.

Yes I seen that, I'm not sure if you require it as i'm not self hosting, i'm using the OWIN middleware.

Yeah, I found this here: http://supervisord.org/configuration.html but doing a find on my entire root partition I'm not able to located a "supervisord.conf" file anywhere

@maxsmart I know this is a big as, but are you able to follow https://github.com/NancyFx/Nancy/wiki/Hosting-Nancy-with-Nginx-on-Ubuntu#install-supervisor and try running it with supervisor?

@tidusjar I'm not sure what is happening now lol:

# sudo supervisorctl
supervisor> update
plexrequest: added process group
supervisor> start plexrequest
plexrequest: ERROR (already started)

# cat /etc/supervisor/conf.d/test.conf
[program:plexrequest]
command=mono PlexRequests.exe
stderr_logfile = /opt/PlexRequest/log/stderr.log
stdout_logfile = /opt/PlexRequest/log/stdout.log

directory=/opt/PlexRequest/Release/

Getting 500 error still:

Nancy.RequestExecutionException: Oh noes! ---> System.SystemException: Error running mcs: Cannot find the specified file
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[]) <0x004c3>
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[]) <0x00023>
at Mono.CSharp.CSharpCodeCompiler.CompileFromDomBatch (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x0036f>
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromDomBatch (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x00023>
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromDom (System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUnit[]) <0x00034>
at Nancy.ViewEngines.Razor.RazorViewEngine.GenerateRazorViewFactory (Nancy.ViewEngines.Razor.IRazorViewRenderer,System.Web.Razor.GeneratorResults,System.Reflection.Assembly,System.Type,Nancy.ViewEngines.ViewLocationResult) <0x004f3>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetCompiledViewFactory (string,System.IO.TextReader,System.Reflection.Assembly,System.Type,Nancy.ViewEngines.ViewLocationResult) <0x00143>
at Nancy.ViewEngines.Razor.RazorViewEngine/<>c__DisplayClass5c.b__5b (Nancy.ViewEngines.ViewLocationResult) <0x00063>
at Nancy.ViewEngines.DefaultViewCache/<>c__DisplayClass1`1>.b__0 (Nancy.ViewEngines.ViewLocationResult) <0x00018>
at System.Collections.Concurrent.ConcurrentDictionary`2/c__AnonStorey3.<>m__0 () <0x00025>
at (wrapper delegate-invoke) System.Func`1>.invoke_TResult () <0x00046>
at System.Collections.Concurrent.SplitOrderedList`2>.ListInsert (System.Collections.Concurrent.SplitOrderedList`2/Node>,System.Collections.Concurrent.SplitOrderedList`2/Node>,System.Collections.Concurrent.SplitOrderedList`2/Node>&,System.Func`1>) <0x000f2>
at System.Collections.Concurrent.SplitOrderedList`2>.InsertInternal (uint,Nancy.ViewEngines.ViewLocationResult,System.Collections.Generic.KeyValuePair`2,System.Func`1>,System.Collections.Concurrent.SplitOrderedList`2/Node>&) <0x000af>
at System.Collections.Concurrent.SplitOrderedList`2>.InsertOrGet (uint,Nancy.ViewEngines.ViewLocationResult,System.Collections.Generic.KeyValuePair`2,System.Func`1>) <0x00037>
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd (Nancy.ViewEngines.ViewLocationResult,System.Func`2) <0x001eb>
at Nancy.ViewEngines.DefaultViewCache.GetOrAdd> (Nancy.ViewEngines.ViewLocationResult,System.Func`2>) <0x0014f>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetOrCompileView (Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,System.Type) <0x00166>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0018f>
at System.Dynamic.UpdateDelegates.UpdateAndExecute5 (System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x004d5>
at Nancy.ViewEngines.Razor.RazorViewEngine.GetViewInstance (Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0038c>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x0015b>
at System.Dynamic.UpdateDelegates.UpdateAndExecute5 (System.Runtime.CompilerServices.CallSite,Nancy.ViewEngines.Razor.RazorViewEngine,Nancy.ViewEngines.ViewLocationResult,Nancy.ViewEngines.IRenderContext,System.Reflection.Assembly,object) <0x004d5>
at Nancy.ViewEngines.Razor.RazorViewEngine/<>c__DisplayClass2b.b__2a (System.IO.Stream) <0x001e7>
at Nancy.Responses.MaterialisingResponse.PreExecute (Nancy.NancyContext) <0x00060>

  --- End of inner exception stack trace ---
  at Nancy.NancyEngine.InvokeOnErrorHook (Nancy.NancyContext context, Nancy.ErrorPipeline pipeline, System.Exception ex) [0x00000] in :0 

stdout.log:

Version: 1.4.1
Request Plex is running on the following: http://+:3579/

Hmmm ok. Thanks for trying

Have you pinged the Mono guys? This seems to me like a Mono bug, since it's deep in the CodeDom APIs. It would be weird if we, from a Nancy POV, are passing the same arguments to the CodeDom APIs on two different platforms, but get different results. I would suggest either asking in their gitter channel or filing an issue there.

Also, FYI; we've released a 2.0-alpha where we've switched out all the CodeDom APIs for view compilation with Roslyn. Might be worth testing that out :smile:

Thanks for the assistance @khellang . I'll speak with the mono guys now.

@Fogest Just installed Ubuntu 14.04, installed mono via sudo apt-get install mono-complete and I was able to run PlexRequests and set it up with no error :disappointed:

@tidusjar if you look at the version of mono I had it was a 3.* version. The mono in the package is a 4.* version.

I decided to upgrade to the latest mono in the package and it looks like it does work now.

Oh really? So it's all working!? :confounded:

Yeah it looks like it is running fine now :)

That should have really been my first point of call... Well i'm glad it's working!

@maxsmart can you try and upgrade mono please?

Yes, upgrading mono seems to have fixed it, I was wary because Sonarr requires mono and had placed a restriction on updating it, but after upgrading to 4.2.1 Sonarr seems to still work and now so does PlexRequests.Net

Now if a .exe could be compiled in the main git so that way I could just clone the directory and do a "git pull" to grab the latest version, it would be awesome :)

@maxsmart I don't think it is usually the best practice to version control a compiled file.

Hmmm, well that's how sonarr does it and they are the only other mono-required git application I have.

I'm pretty sure on yeah release the sonarr guys Push to their own private repository and they use apt-get update

Might be better sticking it in a public dropbox folder and dropping in an "update.sh" / "update.ps1" while you are still updating regularly?

Glad it's sorted though :+1:

@grumpydev That's a good idea, just need to make sure that the main process is terminated so there are no .dll's in use. Thanks for the assistance again :+1:

As a side note, to background this process effectively on Linux with how it is setup, it does look like using that supervisor thing is a good idea anyway.

So , I am on 4.2.3 of mono and I am still getting this.
I am leary to try sudo apt-get install mono-complete cause I don't want to break sonarr

It won't break it. It is just a package.
On Apr 28, 2016 1:15 PM, "Derek" [email protected] wrote:

So , I am on 4.2.3 of mono and I am still getting this.
I am leary to try sudo apt-get install mono-complete cause I don't want
to break sonarr

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/50#issuecomment-215498987

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tidusjar picture tidusjar  Â·  5Comments

ThePaulMichaels picture ThePaulMichaels  Â·  4Comments

Handl3vogn picture Handl3vogn  Â·  4Comments

EricHupp picture EricHupp  Â·  4Comments

PotatoQuality picture PotatoQuality  Â·  3Comments