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

MSYS2 issue: startup failure and no logfile #225

Closed
mviereck opened this issue Feb 19, 2020 · 6 comments
Closed

MSYS2 issue: startup failure and no logfile #225

mviereck opened this issue Feb 19, 2020 · 6 comments

Comments

@mviereck
Copy link
Owner

Coming from #219:

Short summary:
In MSYS2 x11docker fails to start the container.
Command:

/t/x11docker/x11docker --runx --no-auth x11docker/xfce xfce4-terminal

Error message:

C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: file does not exist.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.

Generated docker command:

 docker.exe run --tty --rm --detach \
  --name x11docker_X3178_x11docker-xfce-xfce4-terminal_11809315510 \
  --user 197609:197121 \
  --env USER=eine \
  --userns host \
  --cap-drop ALL \
  --security-opt no-new-privileges \
  --security-opt label=type:container_runtime_t \
  --init \
  --tmpfs /run --tmpfs /run/lock \
  --volume '/c/msys64//home/eine/.cache/x11docker/x11docker-xfce-xfce4-terminal-11809315510/share':'/x11docker':rw \
  --workdir '/tmp' \
  --entrypoint env \
  --env 'container=docker' \
  --env 'XAUTHORITY=/x11docker/Xauthority.client' \
  --env 'DISPLAY=10.0.75.1:3178' \
  --env 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR' \
  -- x11docker/xfce  /bin/sh - /x11docker/containerrc

Latest x11docker master does not give a logile in ~/.cache/x11docker.

@eine
Copy link
Contributor

eine commented Feb 19, 2020

I tried to copy the generated command as is, but it seems that paths need to be escaped:

C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: the working directory 'C:/msys64/tmp' is invalid, it needs to be an absolute path.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'

So, //c/msys64//home/eine/.cache/x11docker/x11docker-xfce-xfce4-terminal-11809315510/share, //x11docker, //tmp, etc.

@mviereck
Copy link
Owner Author

it seems that paths need to be escaped:

x11docker runs export MSYS2_ARG_CONV_EXCL='*' before running docker. That disables MSYS2 path conversion and // is not needed.

If we could have the log saved to some other location (say cwd/pwd), that would help us understand which commands are being passed. However, it's odd because a folder is properly created and removed in ~/.cache/x11docker/*

I've added an option --keepcache that preserves the cache folder. In its subfolder share is the logfile.

If that does not give anything useful, x11docker could be started with bash -x x11docker .... That gives a bunch of output, but maybe helps.

@eine
Copy link
Contributor

eine commented Feb 19, 2020

x11docker runs export MSYS2_ARG_CONV_EXCL='*' before running docker. That disables MSYS2 path conversion and // is not needed.

Ok. With this, I get the expected but unwanted error:

# export MSYS2_ARG_CONV_EXCL='*'

#  docker run --tty --rm --detach \
>   --name x11docker_X3178_x11docker-xfce-xfce4-terminal_11809315510 \
>   --user 197609:197121 \
>   --env USER=eine \
>   --userns host \
>   --cap-drop ALL \
>   --security-opt no-new-privileges \
>   --security-opt label=type:container_runtime_t \
>   --init \
>   --tmpfs /run --tmpfs /run/lock \
>   --volume '/c/msys64//home/eine/.cache/x11docker/x11docker-xfce-xfce4-terminal-11809315510/share':'/x11docker':rw \
>   --workdir '/tmp' \
>   --entrypoint env \
>   --env 'container=docker' \
>   --env 'XAUTHORITY=/x11docker/Xauthority.client' \
>   --env 'DISPLAY=10.0.75.1:3178' \
>   --env 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR' \
>   -- x11docker/xfce  /bin/sh - /x11docker/containerrc

C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: file does not exist.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.

Actually, replacing /c/msys64//home with /c/msys64/home seems to fix the issue.

mviereck added a commit that referenced this issue Feb 19, 2020
@mviereck
Copy link
Owner Author

Actually, replacing /c/msys64//home with /c/msys64/home seems to fix the issue.

Great news! I did a fix for this. Hopefully there will be no missing / somewhere else.

To verify: Does cygpath.exe -u "c:/" give a path with / at its end?

@eine
Copy link
Contributor

eine commented Feb 20, 2020

Great news! I did a fix for this. Hopefully there will be no missing / somewhere else.

It works! I tried both syntaxes, and both are correct now. At the same time, x11docker.log contains relevant content again!

To verify: Does cygpath.exe -u "c:/" give a path with / at its end?

It does:

# MSYS2

# cygpath.exe -u "c:/"
/c/

# Cygwin

$ cygpath.exe -u "c:/"
/cygdrive/c/

@mviereck
Copy link
Owner Author

It works!

What a relief! At first it looked like a much bigger issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants