Deadline error in terminal but not in xterm or menu shortcuts

Hi,

I have a strange error that I can’t fix:

  • run deadline monitor from menu shortcuts : no problem
  • run /opt/Thinkbox/Deadline9/bin/deadlinemonitor from a terminal : error
  • run the same executable from xterm : no problem

What could cause the terminal not to work like this ? (I also tried with Konsole, same result) The error is pasted below:

[chris@mymachine ~]$ /opt/Thinkbox/Deadline9/bin/deadlinemonitor
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for ‘System.Console’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘System.ConsoleDriver’ threw an exception. —> System.Exception: Magic number is wrong: 542
at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& position) [0x0002b] in :0
at System.TermInfoReader…ctor (System.String term, System.String filename) [0x00065] in :0
at System.TermInfoDriver…ctor (System.String term) [0x00058] in :0
at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in :0
at System.ConsoleDriver…cctor () [0x00062] in :0
— End of inner exception stack trace —
at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x0000a] in :0
at System.Console…cctor () [0x000a8] in :0
— End of inner exception stack trace —
at FranticX.Diagnostics.Tracing.TraceBase.WriteLinePreformatted (FranticX.Diagnostics.Tracing.TraceRouting routing, System.String formattedText) [0x00015] in <87e762b9edbc4c68ac959fc09a86d628>:0
at FranticX.Diagnostics.Tracing.TraceBase.WriteLine (FranticX.Diagnostics.Tracing.TraceRouting routing, System.String text) [0x00008] in <87e762b9edbc4c68ac959fc09a86d628>:0
at FranticX.Diagnostics.Trace2.WriteLine (FranticX.Diagnostics.Tracing.TraceRouting routing, System.String s) [0x00001] in <87e762b9edbc4c68ac959fc09a86d628>:0
at FranticX.Diagnostics.Trace2.WriteLine (System.String s) [0x00001] in <87e762b9edbc4c68ac959fc09a86d628>:0
at a.a (System.Object A_0, System.UnhandledExceptionEventArgs A_1) [0x0002a] in :0

Well, that’s a new one!

Doing some Googling for “System.Exception: Magic number is wrong: 542”, it seems like you can work around it by setting your TERM variable to ‘xterm’. Are you using the version of Mono that’s bundled with Deadline, or have you changed the mono symlink in the bin directory?

Hi and thanks for your answer.

This is using Deadline default, so no change on mono in theory.

Something strange to me is that I get this error if I run :
/opt/Thinkbox/Deadline9/bin/deadlinemonitor

But if I run the command with a pipe command it actually opens deadline monitor without any problem :
/opt/Thinkbox/Deadline9/bin/deadlinemonitor | echo hello

That’s amazing to me… I’ll see if I can dig into the Mono source code for the correct version and find out what’s up. The exact code for the version Mono we’re using is failing on is here. Unwinding the stack a little bit, it looks like it tries to open the terminal device to find its capabilities and is failing on that. I’m going to spend a little time digging in, but I think this is a rare issue and I expect maybe TERMINFO or another environment issue.

Temporary fix: Add something like | cat to the call in “/opt/Thinkbox/Deadline10/bin/deadlinemonitor” if that’ll work around it.

Longer fix: Compare the output of env within both your default terminal and xterm and see what’s different there. I’m not quite sure at the moment to be honest.

For fun, I’m trying to rip bytes out of “/dev/pts/2” to see if I can pull the header just for my own education.