MegaAntiCheat / client-backend

GNU General Public License v3.0
120 stars 26 forks source link

MAC "early eof" after repeated "File has shortened, the file may have been replaced. Reopening." #91

Closed ArchooD2 closed 9 months ago

ArchooD2 commented 9 months ago

After running MAC, I attempt to open TF2. After running, and autoexec running, I see "client_backend::io::filewatcher: File has shortened, the file may have been replaced. Reopening." as a 'warn'.

Then, after net_start finishes, it shows

2024-01-06T04:35:00.589471Z ERROR client_backend::io::command_manager: Failed to run command status: Failed to reconnect to RCon.

Caused by:
    0: Failed to establish connection
    1: early eof
    2: early eof

And then loops through:


2024-01-06T04:40:12.784695Z ERROR client_backend::io::command_manager: Failed to run command g15_dumpplayer: Failed to reconnect to RCon.

Caused by:
    0: Failed to establish connection
    1: An existing connection was forcibly closed by the remote host. (os error 10054)
    2: An existing connection was forcibly closed by the remote host. (os error 10054)
2024-01-06T04:40:15.783753Z ERROR client_backend::io::command_manager: Failed to run command status: Failed to reconnect to RCon.

Caused by:
    0: Failed to establish connection
    1: An existing connection was forcibly closed by the remote host. (os error 10054)
    2: An existing connection was forcibly closed by the remote host. (os error 10054)
ArchooD2 commented 9 months ago

Issue seems to stem from something using this:

    pub async fn run_command(&mut self, command: &str) -> Result<()> {
        let rcon = if let Some(rcon) = self.rcon.as_mut() {
            rcon
        } else {
            self.try_reconnect()
                .await
                .context("Failed to reconnect to RCon.")?
        };

and this:

pub async fn command_loop(&mut self) {
        loop {
            match self.request_recv.recv().await.expect("IO loop ded") {
                CommandManagerMessage::RunCommand(cmd) => {
                    let cmd = format!("{}", cmd);
                    if let Err(e) = self.run_command(&cmd).await {
                        tracing::error!("Failed to run command {}: {:?}", cmd, e);
                    }
                }

Inside of impl CommandManager

Ar4m1s commented 9 months ago

Quick tip: you can use "```rust" to get syntax highlighting. https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

Bash-09 commented 9 months ago

Closing as duplicate of #45 I plan to address a lot of the connection issues in an FAQ for setup.