Forum: IronRuby Crontab Issues

5f0ca314f85e433454e19e1822cc8713?d=identicon&s=25 Rob Brit (robbrit)
on 2011-12-05 16:28
(Received via mailing list)
I'm not entirely sure if this is an IronRuby or a Mono issue, but here
goes! I have a test suite that we're running on my Ubuntu server that
works
fine when I SSH in and run it manually, but when it tries to run from a
cron job I get the following exceptions:

**************************
WARNING: The runtime version supported by this application is
unavailable.
Using default runtime: v1.1.4322

** (/home/rob/code/ironlangs/bin/
Release/ir.exe:4798): WARNING **: Missing method .ctor in assembly
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: The
class System.Diagnostics.CodeAnalysis.SuppressMessageAttribute could not
be
loaded, used in Microsoft.Scripting

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: Can't
find custom attr constructor image:
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:
0x0a00008c

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **:
Missing
method .ctor in assembly
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: Can't
find custom attr constructor image:
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:
0x0a00008c

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **:
Missing
method .ctor in assembly
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: Can't
find custom attr constructor image:
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:
0x0a00008c

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: The
class System.OperatingSystem could not be loaded, used in mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: The
class System.OperatingSystem could not be loaded, used in mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: The
class System.OperatingSystem could not be loaded, used in mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Unhandled Exception: System.TypeInitializationException: An exception
was
thrown by the type initializer for
Microsoft.Scripting.PlatformAdaptationLayer --->
System.TypeLoadException:
Could not load type 'System.OperatingSystem' from assembly 'mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
 at Microsoft.Scripting.PlatformAdaptationLayer..cctor () [0x00000] in
<filename unknown>:0
 --- End of inner exception stack trace ---
 at IronRuby.Hosting.RubyConsoleHost..ctor () [0x00000] in <filename
unknown>:0
 at Host..ctor () [0x00000] in <filename unknown>:0
 at Host.Main (System.String[] args) [0x00000] in <filename unknown>:0
**************************************************

Does anybody know why this might happen?

Thanks,
Rob
D7aaf307f96bbdf5ff39be313fe581be?d=identicon&s=25 Orion Edwards (Guest)
on 2011-12-05 23:15
(Received via mailing list)
The error looks to be with running Mono under cron

WARNING: The runtime version supported by this application is
unavailable.
Using default runtime: v1.1.4322

That's indicating mono is loading it's version of the .NET 1.1 framework
(which dates to 2003), instead of the .NET 4.0 framework (2010), which
is
what is supported.

As to why mono under cron isn't supporting .NET 4, I'm unsure. I'd
suspect
something to do with your PATH or other environment variables that
differ
when run under your local user account vs cron.



From:   Rob Britton <rob.s.brit@gmail.com>
To:     ironruby-core@rubyforge.org
Date:   06/12/2011 04:28 a.m.
Subject:        [Ironruby-core] Crontab Issues
Sent by:        ironruby-core-bounces@rubyforge.org



I'm not entirely sure if this is an IronRuby or a Mono issue, but here
goes! I have a test suite that we're running on my Ubuntu server that
works fine when I SSH in and run it manually, but when it tries to run
from a cron job I get the following exceptions:

**************************
WARNING: The runtime version supported by this application is
unavailable.
Using default runtime: v1.1.4322

** (/home/rob/code/ironlangs/bin/
Release/ir.exe:4798): WARNING **: Missing method .ctor in assembly
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: The
class System.Diagnostics.CodeAnalysis.SuppressMessageAttribute could not
be loaded, used in Microsoft.Scripting

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: Can't
find custom attr constructor image:
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:
0x0a00008c

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **:
Missing
method .ctor in assembly
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: Can't
find custom attr constructor image:
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:
0x0a00008c

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **:
Missing
method .ctor in assembly
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: Can't
find custom attr constructor image:
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:
0x0a00008c

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: The
class System.OperatingSystem could not be loaded, used in mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: The
class System.OperatingSystem could not be loaded, used in mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

** (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING **: The
class System.OperatingSystem could not be loaded, used in mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Unhandled Exception: System.TypeInitializationException: An exception
was
thrown by the type initializer for
Microsoft.Scripting.PlatformAdaptationLayer --->
System.TypeLoadException:
Could not load type 'System.OperatingSystem' from assembly 'mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
 at Microsoft.Scripting.PlatformAdaptationLayer..cctor () [0x00000] in
<filename unknown>:0
 --- End of inner exception stack trace ---
 at IronRuby.Hosting.RubyConsoleHost..ctor () [0x00000] in <filename
unknown>:0
 at Host..ctor () [0x00000] in <filename unknown>:0
 at Host.Main (System.String[] args) [0x00000] in <filename unknown>:0
**************************************************

Does anybody know why this might happen?

Thanks,
Rob
5f0ca314f85e433454e19e1822cc8713?d=identicon&s=25 Rob Brit (robbrit)
on 2011-12-06 17:17
(Received via mailing list)
Yep, it was a PATH issue. Seems like cron has an extremely pared down
PATH
compared to regular users! Thanks!
This topic is locked and can not be replied to.