I'm trying to deploy an ASP MVC project developed on Mono/OSX on my Linux server using mono 2.10.8.1 w/ fastcgi-mono-server4
The webapp always starts fine, but then I start getting random CS0006 compilation errors for various URIs, and once they break, they remain broken until I restart the server application.
An example error:
Server Error in '/' Application
Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Compiler Error Message: CS0006: Metadata file `/tmp/root-temp-aspnet-0/ed68754/App_global.asax_40e709ea.dll' could not be found
~/Views/Order/Download.aspx
There is a related thread from January, but both the question and the answer seem to be mod_mono specific and rather hand-wavy. Anyone have any advice on what to try to debug/solve/work around this issue? It's getting very frustrating. In particular, is there any "unsupported" workaround where I can copy something from my Windows Server machines to use an MS implementation instead of the buggy mono one?
(I've filed a bug report too.)
Since the errors appear to be issue with the Mono JIT attempting to compile temporary files that don't exist, I spent a few days trying different methods of working around this issue (vs solving it). One solution that worked was using aspnet_compiler on Windows to create a binary version that could be copied and run as-is on Linux/Mono (as the latest versions of Mono now support precompiled ASP.NET applications).
However, I was looking for a native Linux solution, and I don't want to have to compile and sync binaries (vs syncing a GIT repo of code) to the server, so I was looking for another solution when I came across Mono ahead of time compilation, which is pretty much the equivalent of ngen.exe on Windows.
While it doesn't precompile everything, it seems to have done the trick. For me, this deployment script does the job without any runtime build failures:
xbuild SystemDiscs.sln
mono --aot -O=all SystemDiscs/bin/SystemDiscs*.dll
killall -9 mono
nohup fastcgi-mono-server4 /socket=tcp:127.0.0.1:8000 /applications=/:/var/asp/S
ystemDiscs/SystemDiscs/ > /var/log/systemdiscs.log &
Where SystemDiscs*.dll is the output of the solution compiled with xbuild in the first step. I don't think this precompiles the ASP pages (and --aot=full isn't supported on x86, as far as I can tell), but somehow it did the job. I was waiting to see whether or not that was just a fluke, but it's been going fine with maybe a dozen commits/deploys since I asked this ten days ago, so I reckon its safe to say it works.
I had a similiar problem:
Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Compiler Error Message: CS0006: Metadata file `/tmp/<DOMAIN/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll' could not be found
/Default.aspx
But it didn't have anything to do with precompiling but with a backslash in my username. I use likewise-open to login to a windows domain, so my username is <DOMAIN/>\<username/> while my home-directory is without a backslash: /home/likewise-open/<DOMAIN/>/<username/>. This difference or just the backslash itself caused mono not finding the compiled global.asax in the temp directory. If you look closely to the detailed output you see that the backslash \ in the out parameter is changed to a forward slash /:
dmcs /target:library /lib:"/home/likewise-open/<DOMAIN/>/<username/>/Documents/test9999/test9999/bin" /debug+ /optimize- /warn:4 /out:"/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd.dll" /r:"/usr/lib/mono/4.0/mscorlib.dll" /r:"/usr/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll" /r:"/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll" /r:"/usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll" /r:"/usr/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll" /r:"/usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll" /r:"/usr/lib/mono/gac/System.Web.Services/4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll" /r:"/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll" /r:"/usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll" /r:"/usr/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll" /r:"/usr/lib/mono/gac/System.IdentityModel/4.0.0.0__b77a5c561934e089/System.IdentityModel.dll" /r:"/usr/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll" /r:"/usr/lib/mono/gac/System.Xaml/4.0.0.0__b77a5c561934e089/System.Xaml.dll" /r:"/usr/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll" /r:"/usr/lib/mono/gac/System.ServiceModel.Web/4.0.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll" /r:"/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll" /r:"/usr/lib/mono/gac/System.Web.Extensions/4.0.0.0__31bf3856ad364e35/System.Web.Extensions.dll" /r:"/usr/lib/mono/gac/System.Data.DataSetExtensions/4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll" /r:"/usr/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll" /r:"/usr/lib/mono/gac/System.ComponentModel.DataAnnotations/4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll" /r:"/usr/lib/mono/gac/System.Web.DynamicData/4.0.0.0__31bf3856ad364e35/System.Web.DynamicData.dll" /r:"/usr/lib/mono/gac/System.Data.Linq/4.0.0.0__b77a5c561934e089/System.Data.Linq.dll" /r:"/usr/lib/mono/gac/System.Web.ApplicationServices/4.0.0.0__31bf3856ad364e35/System.Web.ApplicationServices.dll" /r:"/home/likewise-open/<DOMAIN/>/<username/>/Documents/test9999/test9999/bin/test9999.dll" /r:"/tmp/<domain/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll" /nowarn:0169 /d:DEBUG -- "/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd_0.cs"
So:
/out:"/tmp/<DOMAIN/>\<username/>-temp-aspnet-0/5ed74d00/App_Web_17ca7bdd.dll
becomes
/tmp/<DOMAIN/>/<username/>-temp-aspnet-0/5ed74d00/App_global.asax_34cccb99.dll
If I copy the directory 5ed74d00 to /tmp/<DOMAIN/>/<username/>-temp-aspnet-0/ the application works as expected.
It took me almost 2 days to see this, so hopefully I can help others with this answer.
Related
I am working with a Windows 10 device and after some work with Isabelle I get the following error:
The following plugin could not be loaded:
C:\Users\PC\Desktop\Isabelle2018\src\Tools\jEdit\dist\jars\Isabelle-jEdit.jar:
Cannot start:
*** [line 1 of "preferences"] error: bad input
I note this problem appears in this version and in a previous Windows 8 version when not switching off properly the machine.
In the Isabelle list I got an answer to this problem:
The error indicates that the $ISABELLE_HOME_USER/etc/preferences file is in a bad state: the file is written each time Isabelle/jEdit shuts down, and switching off the computer in the middle might have corrupted it.
You can try to repair or delete that file. The location of $ISABELLE_HOME_USER on Windows is usually something like C:\Users\my_name.isabelle\Isabelle2018.
I think this problem may be encountered by other people in the community and this answer may save some time to them.
I am doing the Pintos project on the side to learn more about operating systems. I had tons of devops trouble at first with it not running well on an 18.04 Ubuntu droplet. I am now running it on the VirtualBox image that UCCS tells students to download for pintos.
I finished project 1 and started to map out my solution to project 2. Following the instructions to create a file I ran
pintos-mkdisk filesys.dsk --filesys-size=2
pintos -- -f -q
but am getting error
Kernel PANIC at ../../threads/vaddr.h:87 in vtop(): assertion
`is_kernel_vaddr (vaddr)' failed.
I then tried running make check (all the tests). They are all failing for the same reason.
Am I missing something? Is there something I need to implement to fix this? I reread the instructions and didnt see anything?
Would appreciate help!
Thanks
I had a similar problem. My code for Project 1 ran fine, but I could not format the filesystem for Project 2.
The failure for me came from the following call chain:
thread_init() -> ... -> thread_schedule_tail() -> process_activate() -> pagedir_activate() -> vtop()
The problem is that init_page_dir is still NULL when pagedir_activate() is called. init_page_dir should have been initialized in paging_init() but this is called after thread_init().
The root cause was that my scheduler was being called too early, i.e. before the call to thread_start(). The reason for my problem was that I had built in a call to thread_yield() upon completion of every call to lock_release() which makes sense from a priority donation standpoint. Unfortunately, locks are used prior to the scheduler being ready! To fix this, I installed a flag called threading_started that bails in the first line of my thread_block() and thread_yield() functions if thread_start() has not yet been called.
Good luck!
I am trying to build PhantomJS 2.0 on Windows from the c:\fastio\phantomjs\phantomjs directory. For some reason, the build process fails after a while, with 2 errors (see error message below):
1) It tries to access "C:fastiophantomjsphantomjssrcqtqtbasebinmoc.exe". Obviously, the backslash characters between directory names are somehow getting stripped away deep in the build process - possibly a mismatch between Windows-style "\" and Linux-style "/" (but this is only a guess).
2) There's another error, "Failed to read names from file: C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/mathml/mathtags.in".
If I remove sh.exe from the PATH, the build still gets to this point, and only error #2 appears, leading me to think that error #2 is the real problem here.
Here is the full error message (as far as I can tell this is happening while building WebKit):
sh: C:fastiophantomjsphantomjssrcqtqtbasebinmoc.exe: command not found
Failed to read names from file: C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/mathml/mathtags.in at C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/dom/make_names.pl line 315.
NMAKE : fatal error U1077: 'C:\Users\Eugene\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin\perl.EXE' : return code '0x7f'
Stop.
(By the way, I saw this question but I'm already past the issues described there, my error is happening later in the build process.)
How can I make this work?
Full logs below:
Console output:
http://pastebin.com/btMeNPz4
QT build log file build_qt_4-285-20-0859.log:
http://pastebin.com/LUEJz7E0
WebKit build log file build_webkit_4-285-20_0859.log:
http://pastebin.com/494TivXF
PhantomJS build log file build_phantomjs_4-285-20_0859.log:
Empty
Looks like I found the solution myself, here were my steps:
Remove as much as possible from the PATH leaving only the entries critical to the build process
Most importantly, remove all GitHub's git directories from the PATH
Install GIT separately (not from GitHub but from git-scm.com), add its cmd directory only (not its bin directory) to the PATH
Install ActivePerl separately, add it to the PATH
It's moving past the error I asked about with the steps above (still not sure if it will finish the build successfully, it's taking a while).
When I try to debug or run a PHP script on my test Windows server using Aptana and PHP 5.4.24 (or the latest 5.4.x, 5.4.40), I am told "Malformed \uxxxx encoding" has occurred.
Given most material online about this error (with any Java code) refers to paths, I've tried installing this PHP version in two locations (and with an additionally different path), with no change. None of the paths contain the string "\u".
If I use PHP 5.5.12 instead, there's no error.
My production server uses 5.4.24, and I would prefer to leave it the way it is for the time being. I would like to debug using the same version of PHP.
A certain Igor appears to have had the same problem as me in July 2014: http://php.tutorialhorizon.com/how-to-debug-php-in-aptana-studio/#comment-2225
The offered solution "check your paths" hasn't helped me.
Log:
ENTRY org.eclipse.core.jobs 4 2 2015-04-21 13:44:19.026
!MESSAGE An internal error occurred during: "Launching website".
!STACK 0
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Unknown Source)
at java.util.Properties.load0(Unknown Source)
at java.util.Properties.load(Unknown Source)
at org2.eclipse.php.internal.debug.core.launching.XDebugExeLaunchConfigurationDelegate.isXDebugFunctional(XDebugExeLaunchConfigurationDelegate.java:310)
at org2.eclipse.php.internal.debug.core.launching.XDebugExeLaunchConfigurationDelegate.launch(XDebugExeLaunchConfigurationDelegate.java:86)
at org2.eclipse.php.internal.debug.core.launching.PHPLaunchDelegateProxy.launch(PHPLaunchDelegateProxy.java:71)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Look at the property file or the file displayed in the error message and change the backslash to forwardslash:
...\user_projects... to .../user_projects...
Or
...\uxxxx... to .../uxxxx...
\u is a reserved keyword and throws the system off.
Note: "..." and "xxxx" are depicting anything in this case. Usually the error displays a line number one line below the actual line with the issue or so-called ...\u...
Reference: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6555979
It is really disappointing that so many of these issues with java plague many of us and so many articles send people on a wild goose chase. Hope this helps someone.
Are there paths with /usr in them somewhere? The windows version of PHP can do odd things with slashes and backslashes. Without seeing your config it is hard to say.
I have set up Git and CruiseControl, and just finished getting phpUnderControl working (a nightmare in itself as it is missing packages and all sorts).
So I have all the plugins in it like phpunit and php-documentor.
When I run 'ant' on my project it builds fine (just to check my build.xml is good)
When running the build from PHPUnderControl it hangs on the graph generation
[cc]Sep-08 01:10:22 ecutePublisher- executing command: /root/phpUnderControl/bin/phpuc.php graph logs/BIOSYNERGY artifacts/BIOSYNERGY
And it sits here for hours, in 'publishing' status on cruisecontrol, but clicking in to says build complete, and I see maybe 4 out of an expected 9 graphs if I am lucky.
If I run it manually, it takes about 2 seconds and gives me all 9 graphs (but the building it still stuck on 'publishing' until I stop cruisecontrol.
Also, the Coverage atrifacts seem to work, but no index.html file is generated, so the tab for coverage shows an error.
Documentation sometimes works, sometimes doesn't but no errors about it.
Code browser never seems to display any code?
Is there something missing that the Artifacts Publisher needs?
<artifactspublisher subdirectory="api" dest="artifacts/${project.name}" dir="projects/${project.name}/build/api"/>
<artifactspublisher subdirectory="coverage" dest="artifacts/${project.name}" dir="projects/${project.name}/build/coverage"/>
<execute command="phpcb --log projects/${project.name}/build/log --output projects/${project.name}/build/phpcb"/>
<artifactspublisher dir="projects/${project.name}/build/phpcb" dest="artifacts/${project.name}" subdirectory="php-code-browser"/>
<execute command="/root/phpUnderControl/bin/phpuc.php graph logs/${project.name} artifacts/${project.name}"/>
Thanks for any help!
CC is installed at: http://pixelhero.co.uk:8080
If you're not tied to phpUnderControl, I recommend switching to Jenkins as it is actively developed and has a working project template by the main author of PHPUnit.