Failed to Compile: compiler version couldn't be started

Title. I've been struggling with this problem for an entire day now, spending hours trying to fix it then waking up the next day and trying to fix it.

02:21 [Error] Exception while starting compiler version : (Exception: Magic number is wrong: 542)
at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& position) [0x00028] in <fb001e01371b4adca20013e0ac763896>:0
at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <fb001e01371b4adca20013e0ac763896>:0
at System.TermInfoDriver..ctor (System.String term) [0x00055] in <fb001e01371b4adca20013e0ac763896>:0
at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <fb001e01371b4adca20013e0ac763896>:0
at System.ConsoleDriver..cctor () [0x0004d] in <fb001e01371b4adca20013e0ac763896>:0
02:21 [Warning] Compiler may not be set as executable; chmod +x or 0744/0755 required

I've tried TERM=xterm, chmod +x, chmod 755, and chmod 744 and nothing has fixed it.

4D73Zd5xvQSA9EY.png Wulf

Per existing threads, see c# - Mono Bug : Magic number is wrong: 542 - Stack Overflow

This is the only fix for this issue and the solution for it. If you aren't sure where to put the change, please paste your startup script here for us to take a look.

Sorry I'm still very new to using linux and such, this is my first time running a server. By startup script do you mean the

Yes, if that's what you use to start the server.

Here, I wasn't sure if I should paste it all here so I copied it into a txt and put it on google drive.

Startup script

And where did you add the "export TERM=xterm" at? I'm sure that file is intended to be edited, though I'm unsure of an alternative.

Oh! I have to put it in the startup script itself? I thought it was a command I had to run in the terminal. Where would I put it in the script?

After the first line would likely be fine.

j2W83yqJZPUHLGj.png Wulf

After the first line would likely be fine.

I've done this, I'm still getting the same error. Plugins failed to compile: compiler version couldn't be started


Edit: exact same error in log too

Edit 2: Trying something different, realised there's another place I can put the term. I'll report back

Merged post

Nevermind, still didn't work.

I recently discovered something new about this error. Debian 11 does not behave the same as Debian 10, it requires the following to prevent this error. Just run this command in system terminal (Not Rcon), then restart rustserver.

echo 'set -g default-terminal "xterm"' >~/.tmux.conf​

Merged post

The reason TERM=xterm didn't work for you is because it sets the env for the current user, but rustserver runs within tmux which does not recognise it - I think Debian 11 has introduced stricter sandboxing or something like that.