Minecraft-Console-Client icon indicating copy to clipboard operation
Minecraft-Console-Client copied to clipboard

[BUG] Docker is broken since 20220816-25, because it does not ship a MinecraftClient.exe anymore

Open mmodrow opened this issue 3 years ago • 10 comments

Prerequisites

  • [X] I made sure I am running the latest development build
  • [X] I tried to look for similar issues before opening a new one
  • [X] I have set debugmessages=true in config to diagnose my issue
  • [X] I have redacted session tokens and passwords before attaching screenshots

Minecraft Version

n/a

Console Client Version

20220816-25+

Expected Behavior

Running the docker container minecraft-console-client:latest (manually or via the docker-compose file within the repo) should start up the latest linux-release of the MCC in a docker container.

Actual Behavior

I get the following output:

sudo docker compose build; sudo docker compose up
[+] Running 2/2
 ⠿ Network docker_default            Created                                                                    0.1s
 ⠿ Container MinecraftConsoleClient  Created                                                                    0.1s
Attaching to MinecraftConsoleClient
MinecraftConsoleClient  |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
MinecraftConsoleClient  |                                  Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0     38      0 --:--:-- --:--:-- --:--:--    38
MinecraftConsoleClient  | Cannot open assembly 'MinecraftClient.exe': File does not contain a valid CIL image.
MinecraftConsoleClient exited with code 2

Steps to Reproduce the bug

  1. Checkout current Release
  2. navigate to "./Docker"
  3. run sudo docker compose build; sudo docker compose up

Attach screenshot here (If applicable)

No response

Anythings that could help diagnosing the bug

I assume, that's because the `start-latest.sh` still expects a mono-able `MinecraftClient.exe` to be present as a build-artifact, but now it's a shell-native `MinecraftClient`-file within the artifact `MinecraftClient-linux.zip`.

Device

Other

Operating System

Linux

Server Address (If applicable)

No response

mmodrow avatar Aug 18 '22 11:08 mmodrow

Mono is no longer used, the docker image should be updated to use the dotnet and new builds. For now you could run it manually with screen, take a look at the documentation on: https://mccteam.github.io/docs/guide/usage.html#linux-macos I'll take a look at updating it when I can.

milutinke avatar Aug 18 '22 11:08 milutinke

@ORelio Accidentally forked the repo (Minecraft-Console-Client-1.19) in the organization instead on to my profile, can you delete it? Sorry for the trouble 😅

milutinke avatar Aug 18 '22 11:08 milutinke

@milutinke Deleted. I think you could do it yourself, too.

ReinforceZwei avatar Aug 18 '22 12:08 ReinforceZwei

@milutinke Deleted. I think you could do it yourself, too.

Nope, I don't have a permission. Thanks.

milutinke avatar Aug 18 '22 12:08 milutinke

Fixed the image to use .NET, but I have a problem with Console Interactive

Unhandled exception. System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')
Actual value was -1.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at ConsoleInteractive.InternalContext.SetLeftCursorPosition(Int32 leftPos)
   at ConsoleInteractive.ConsoleBuffer.ClearCurrentLine()
   at ConsoleInteractive.InternalWriter.Write(String value)
   at ConsoleInteractive.InternalWriter.WriteLine(String value)
   at ConsoleInteractive.ConsoleWriter.WriteLine(String value)
   at MinecraftClient.ConsoleIO.WriteLine(String line)
   at MinecraftClient.Program.Main(String[] args)
Aborted

@breadbyte Could you take a look into this?

Dockerfile:

# Using the .NET official image for .NET 6.0
FROM mcr.microsoft.com/dotnet/sdk:6.0

# Copy over the script and give it execution permissions
COPY --chmod=0755 start-latest.sh /opt/start-latest.sh

RUN apt-get update && \ 
    apt-get install -y jq && \
    apt-get install -y unzip && \
    mkdir /opt/data

ENTRYPOINT ["/bin/sh", "-c", "/opt/start-latest.sh"]

start-latest.sh

#!/bin/sh

cd /opt/data || exit 1

# Get latest release tag
RELEASE_TAG=$(curl -s -v https://github.com/MCCTeam/Minecraft-Console-Client/releases/latest 2>&1 | grep -i location: | tr -d '\r' | cut -d/ -f8)

# Download latest version
curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient-linux.zip --output MinecraftClient-linux.zip

# Unzip it
unzip MinecraftClient-linux.zip

# Remove the ZIP
rm MinecraftClient-linux.zip

# Start the Client
./MinecraftClient

PS: Also tried an image that builds from the source code, got the same result. The base image for .NET image is a Debian 11. Tried making a whole new image from Arch and Alpine, just to determine if it was not a problem with this image, got the same results.

milutinke avatar Aug 18 '22 16:08 milutinke

Question: when you touch the dockerfile&script anyway, wouldn't it be nice to be able to pin the mcc version with some .env variable?

mmodrow avatar Aug 18 '22 16:08 mmodrow

Question: when you touch the dockerfile&script anyway, wouldn't it be nice to be able to pin the mcc version with some .env variable?

That would be easy to add. In the Dockerfile:

ENV MCC_VERSION=custom version here

Example: MCC_VERSION=20220817-29

And then in the start-latest.sh:

RELEASE_TAG=${MCC_VERSION:-$(curl -s -v https://github.com/MCCTeam/Minecraft-Console-Client/releases/latest 2>&1 | grep -i location: | tr -d '\r' | cut -d/ -f8)}

milutinke avatar Aug 18 '22 18:08 milutinke

@mmodrow Got it working, check out the #2112

milutinke avatar Aug 19 '22 19:08 milutinke

@breadbyte Could you take a look into this?

Will take a look at it when I get the chance. Currently have my hands full at the moment.

Glad to know you've gotten it to work though.

breadbyte avatar Aug 19 '22 21:08 breadbyte

@breadbyte Could you take a look into this?

Will take a look at it when I get the chance. Currently have my hands full at the moment.

Glad to know you've gotten it to work though.

It randomly started working for me on Windows, but seems that other people still experience it.

milutinke avatar Aug 19 '22 21:08 milutinke

Since we have merged and added warnings to the documentation, I'll be closing this issue. There is a separate issue on the ConsoleInteractive bug in that repo. Thanks for the help with testing.

milutinke avatar Sep 17 '22 19:09 milutinke