Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Alpine image send error 42 at update #13

Closed
shiipou opened this issue Apr 18, 2020 · 6 comments · Fixed by #14
Closed

[BUG] Alpine image send error 42 at update #13

shiipou opened this issue Apr 18, 2020 · 6 comments · Fixed by #14
Assignees
Labels
bug Something isn't working

Comments

@shiipou
Copy link

shiipou commented Apr 18, 2020

When I use the steamcmd +quit command,
I got the error 42

WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/Steam/logs/stderr.txt'
Could not find steamerrorreporter binary. Any minidumps will be uploaded in-process[  0%] Checking for available updates...
[----] Verifying installation...
[  0%] Downloading update...
[  0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
The command '/bin/sh -c steamcmd +quit' returned a non-zero code: 42

My Dockerfile was just :

FROM steamcmd/steamcmd:alpine

WORKDIR /steam

RUN steamcmd +quit

But if I remove the RUN steamcmd +quit and use the bash command after build : docker run -it --rm --entrypoint /bin/sh local-image then steamcmd +quit
That work.

@shiipou
Copy link
Author

shiipou commented Apr 18, 2020

I havn't that issue on the ubuntu image.

@jonakoudijs jonakoudijs added the bug Something isn't working label Apr 19, 2020
@jonakoudijs
Copy link
Member

jonakoudijs commented Apr 19, 2020

For some reason this is indeed the case with the alpine and busybox images. Perhaps the problem lies in using the builder method.

The moment steamcmd updates/rebuilds itself, it finishes with an exit code of 42. The second time steamcmd is run (and is already updated) it finishes with an exit code of 0. For example with Alpine:

/ # steamcmd +quit
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/Steam/logs/stderr.txt'
Could not find steamerrorreporter binary. Any minidumps will be uploaded in-process[  0%] Checking for available updates...
[----] Verifying installation...
[  0%] Downloading update...
[  0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
CWorkThreadPool::~CWorkThreadPool: work processing queue not empty: 3 items discarded.
/ # echo $?
42
/ # steamcmd +quit
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/Steam/logs/stderr.txt'
Could not find steamerrorreporter binary. Any minidumps will be uploaded in-process[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...Failed to init SDL priority manager: SDL not found
Failed to set thread priority: per-thread setup failed
Failed to set thread priority: per-thread setup failed
OK.
/ # echo $?
0

It's not pretty but that's why the Alpine Dockerfile pipes to true to avoid the build failing.

I will play around with it some more today. In the meantime you could add the pipe to true to your Dockerfile as well. Like this:

FROM steamcmd/steamcmd:alpine

WORKDIR /steam

RUN steamcmd +quit | true

RUN steamcmd +quit

@jonakoudijs
Copy link
Member

I am not a big fan of wrapper scripts in general, so originally left them out in the alpine and busybox images by not using the steamcmd.sh script but directly executing thesteamcmd binary.

Taking a closer look from the steamcmd.sh script shows that the exit code of 42 is by design:

MAGIC_RESTART_EXITCODE=42

if [ "$DEBUGGER" == "gdb" ] || [ "$DEBUGGER" == "cgdb" ]; then
  ARGSFILE=$(mktemp $USER.steam.gdb.XXXX)

  # Set the LD_PRELOAD varname in the debugger, and unset the global version.
  if [ "$LD_PRELOAD" ]; then
    echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE"
    echo show env LD_PRELOAD >> "$ARGSFILE"
    unset LD_PRELOAD
  fi

  $DEBUGGER -x "$ARGSFILE" "$STEAMEXE" "$@"
  rm "$ARGSFILE"
else
  $DEBUGGER "$STEAMEXE" "$@"
fi

STATUS=$?

if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ]; then
    exec "$0" "$@"
fi

@jonakoudijs jonakoudijs self-assigned this Apr 19, 2020
@jonakoudijs jonakoudijs linked a pull request Apr 19, 2020 that will close this issue
@jonakoudijs
Copy link
Member

jonakoudijs commented Apr 19, 2020

@shiipou I reworked the Alpine build and the updated image has been pushed. I tested it with your example Dockerfile and it seems to work as expected now:

$ cat Dockerfile
FROM steamcmd/steamcmd:alpine

WORKDIR /steam

RUN steamcmd +quit
$ docker build -t steamcmd-shiipou .
Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM steamcmd/steamcmd:alpine
 ---> 07913c1d6ffa
Step 2/3 : WORKDIR /steam
 ---> Running in 77093d01d76b
Removing intermediate container 77093d01d76b
 ---> 748e43e9d4b6
Step 3/3 : RUN steamcmd +quit
 ---> Running in 4f4f065999c8
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/.steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
[  0%] Downloading update...
[  0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/root/.steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...Failed to init SDL priority manager: SDL not found
Failed to set thread priority: per-thread setup failed
Failed to set thread priority: per-thread setup failed
OK.
Removing intermediate container 4f4f065999c8
 ---> 7c51a00eddd3
Successfully built 7c51a00eddd3
Successfully tagged steamcmd-shiipou:latest

Don't forget to pull the latest version of the alpine tag when you test it locally:

docker pull steamcmd/steamcmd:alpine

Let me know if it works for you :)

@jonakoudijs jonakoudijs reopened this Apr 19, 2020
@shiipou
Copy link
Author

shiipou commented Apr 20, 2020

Ok thanks,
That work like a charm.

@jonakoudijs
Copy link
Member

Great! Thanks for letting me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants