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

Docker binary for init missing in openSUSE. #23

Closed
Greenscreener opened this issue Feb 28, 2018 · 66 comments
Closed

Docker binary for init missing in openSUSE. #23

Greenscreener opened this issue Feb 28, 2018 · 66 comments
Labels

Comments

@Greenscreener
Copy link

x11docker ERROR: Docker startup seems to have failed! 

  Last lines of docker.log:
    27  export TERM=xterm
    28  export HOME=/home/jan
    29
    30  env > /x11docker/environment
    31  sed -i "/\(PWD=\|_=\)/d" /x11docker/environment
    32
    33  cd "$HOME"
    34
    35  exec $Dbus /usr/bin/kaptain /x11docker.kaptn >>/x11docker/stdout 2>>/x11docker/stderr
    36  # Ready for docker run

  Last lines of xterm.log:
Error: No such container: x11docker_X0_284fda_x11docker_kaptain
x11docker: container not ready on 8. attempt, trying again.
Error: No such container: x11docker_X0_284fda_x11docker_kaptain
x11docker: container not ready on 9. attempt, trying again.
Error: No such container: x11docker_X0_284fda_x11docker_kaptain
x11docker: container not ready on 10. attempt, trying again.
Error response from daemon: no such image: x11docker_X0_284fda_x11docker_kaptain: invalid reference format: repository name must be lowercase
x11docker: container IP:
x11docker: container PID:
Error: No such container: x11docker_X0_284fda_x11docker_kaptain

  Docker daemon messages:
Error response from daemon: Container 97c6d821f537ff2e6822c05444409cdbd4f6eae22495e439811b521575a80125 is not running
docker: Error response from daemon: exec: "docker-init": executable file not found in $PATH.
Error response from daemon: no such image: x11docker_X0_284fda_x11docker_kaptain: invalid reference format: repository name must be lowercase
 
@mviereck
Copy link
Owner

The core error message is exec: "docker-init": executable file not found in $PATH.. Maybe you have an outdated version of docker? Please show me the output of docker --version and of docker run --help | grep init.

It seems to me you have an old docker version without option --init. I have uploaded an update of x11docker-gui that does not use this and should work for you.

For your images you will probably have to set option --no-init to avoid this error. I recommend you to update docker.

@mviereck mviereck added the bug label Feb 28, 2018
mviereck added a commit that referenced this issue Feb 28, 2018
# 01.03.2018 V3.9.3     --tini: show warning for outdated docker versions without option --init and fall back to --no-init, issue #23
# 26.02.2018            --xtest: new option to enable X extension XTEST. Default for --xdummy, --xvfb, --xpra
#                       --pulseaudio with --net: fallback to --alsa, disabling --pulseaudio
@mviereck
Copy link
Owner

I've added a check in version 3.9.3 whether docker provides option --init and disables it otherwise. It will show a warning, but should work for you now without doing anything special. Thanks for reporting! Feel free to reopen if the issue persists.

@Greenscreener
Copy link
Author

$ docker run --help | grep init
      --health-start-period duration   Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
      --init                           Run an init inside the container that forwards signals and reaps processes
$ docker --version
Docker version 17.09.1-ce, build f4ffd2511ce9

It doesn't appear older version of docker is the problem.

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

Strange; your docker version supports option --init. From the error message above I thought you have a quite older version.

It doesn't appear older version of docker is the problem.

I don't think so now.
Can you please show me the full verbose output with option -v?

And can you try to run a docker image with option --no-init, for example

 x11docker -v --no-init x11docker/lxde pcmanfm

and show me the output if it fails?

@mviereck mviereck reopened this Mar 1, 2018
@Greenscreener
Copy link
Author

Greenscreener commented Mar 1, 2018

Output of x11docker lightworks --verbose: https://pastebin.com/PjkAu3QT

@Greenscreener
Copy link
Author

I have the new version now btw.
If for instance, I run the x11docker-gui it just closes without no indication. In the cmd line it even returns just a 0 code.

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

Can you please show me the output of

x11docker --verbose --no-init x11docker/lxde pcmanfm

?

The error message from your lightworks image could also mean that it has no CMD specified or the command is just not in PATH. Failing x11docker-gui could be a different issue. The command above should not fail in any case, I could analyze the output better.

@Greenscreener
Copy link
Author

working on it, but it is downloading a lot of things (I don't have the lxde image)

@Greenscreener
Copy link
Author

Greenscreener commented Mar 1, 2018

Output of x11docker --verbose --no-init x11docker/lxde pcmanfm: https://pastebin.com/et0xxqgE

@Greenscreener
Copy link
Author

This is the Dockerfile of the lightworks image:

FROM ubuntu:latest
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install wget -y
RUN wget "https://www.lwks.com/index.php?option=com_docman&task=doc_download&gid=194" -O lightworks.deb
RUN dpkg -i lightworks.deb || true 
RUN apt-get install -f -y
RUN groupadd -r lightworks && useradd -r -g lightworks -G audio,video lightworks && mkdir -p /home/lightworks && chown -R lightworks:lightworks /home/lightworks
USER lightworks
ENTRYPOINT ["lightworks"]

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

ok, I am building the lightworks image, will take a while, too. :-)

Did pcmanfm from lxde image run well? The logfile looks sane and successfull.

@Greenscreener
Copy link
Author

What is pcmanfm?

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

pcmanfm is the file manager of lxde that you have started with x11docker --verbose --no-init x11docker/lxde pcmanfm.

@Greenscreener
Copy link
Author

oh yeah, I do not know how it is supposed to look normal, but it looked like a normal file manager to me.

@Greenscreener
Copy link
Author

Greenscreener commented Mar 1, 2018

Some OS information:

$ cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20180227"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="20180227"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20180227"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
Linux OpenSUSE-WD-Elements-1042 4.15.5-1-default #1 SMP PREEMPT Thu Feb 22 21:48:29 UTC 2018 (52ce732) x86_64 x86_64 x86_64 GNU/Linux

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

My image build is ready and lightworks runs fine :-).

Though, for option --hostdisplay (automatically chosen on your system) I need to add options --trusted and --ipc. It seems lightworks does not like untrusted cookies. (Options --gpu or --clipboard automatically switch to trusted cookies, than you would not need --trusted --ipc).

Give it a try with x11docker --verbose --clipboard lightworks

I am running debian 9. In a virtual machine I have openSUSE 42 LEAP, currently running an update over 500MB ... I will try there, too.

@Greenscreener
Copy link
Author

Greenscreener commented Mar 1, 2018

Nope, still the same error.
Output of x11docker --verbose --clipboard lightworks: https://pastebin.com/EH1qEx8L

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

Hm. Does it also fail with x11docker --verbose --clipboard --no-init lightworks ?

@Greenscreener
Copy link
Author

It works, wait, I'll try to look around.

@Greenscreener
Copy link
Author

So, I can't login. It says "Local MI read error."

@Greenscreener
Copy link
Author

I'm going to have to leave my computer in a while, but I still have a few minutes. I'll be back at 13:00 GMT.

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

You have this in your dockerfile:

RUN groupadd -r lightworks && useradd -r -g lightworks -G audio,video lightworks && mkdir -p /home/lightworks && chown -R lightworks:lightworks /home/lightworks
USER lightworks

This will not be regarded by x11docker as it runs the container as user jan. Maybe this has to be solved. You can try to run with option --user lightworks, but I'm not sure if that will work at first try.

We can have a look tomorrow again.

@Greenscreener
Copy link
Author

Also, can I have like a mounted project folder or something?

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

Yes, with option --sharedir /PATH/TO/FOLDER. A special shared folder is a virtual home folder on host with option --home.

@Greenscreener
Copy link
Author

It gives x11docker ERROR: Unknown user or invalid user number 'lightworks' for option --user., but I really have to go now.

@mviereck
Copy link
Owner

mviereck commented Mar 1, 2018

Does the command more than creating a user with additional groups audio and video and create a home folder? If not, it should be ok to just run

x11docker --verbose --clipboard --no-init --home lightworks

Than you run the container as user jan with groups audio and video and a persistant home folder in /home/jan/x11docker/lightworks .

@mviereck mviereck closed this as completed Mar 6, 2018
@Greenscreener
Copy link
Author

Can you finally test x11docker-gui whether it runs now?

Yes, tried the latest version, still acted the same. No output. Just exits after a few seconds with 0.

Did you find a possible reason why the symlink has failed the first time?

No idea. Created it manually, worked.

@mviereck
Copy link
Owner

mviereck commented Mar 6, 2018

Yes, tried the latest version, still acted the same. No output.

Odd. Runs well in my OpenSUSE VM. Could you please run with x11docker-gui --verbose and show me the output?

@Greenscreener
Copy link
Author

Greenscreener commented Mar 6, 2018

Also, is there a way of making a (sym)link to a folder in my home to lightworks' home? Like for instance ~/Videos to ~/x11docker/lightworks/Videos? It doesn't work with a normal symlink, because the namespaced filesystem can't follow it. (At least I would think it works in this way?)

@mviereck
Copy link
Owner

mviereck commented Mar 6, 2018

Like for instance ~/Videos to ~/x11docker/lightworks/Videos?

Symlinks on host are difficult, docker does not handle that well.

The better way is to use --sharedir $HOME/Videos along with --home.

@Greenscreener
Copy link
Author

Odd. Runs well in my OpenSUSE VM. Could you please run with x11docker-gui --verbose and show me the output?

Sorry didn't see your message.

Error: Parse error on line 59
Stuck __after__ the rule on line 58

@mviereck
Copy link
Owner

mviereck commented Mar 7, 2018

Odd again ...
That line is not very spectacular. It provides possible locale settings.
One way I can reproduce the error: If environment variable LANG contains quotation marks ". Can you please show me the output of:

echo "$LANG"

I have just uploaded a new version that deletes " in LANG, maybe that fixes it.

@Greenscreener
Copy link
Author

$ echo "$LANG"
cs_CZ.UTF-8

@Greenscreener
Copy link
Author

The same error appears even with LANG=C in place.

@mviereck
Copy link
Owner

mviereck commented Mar 8, 2018

cs_CZ.UTF-8 is a quite normal value for LANG, that is obviously not the cause. Thank you for testing this and also C.

I did some minor syntax changes, one of them may be the key.
Especially I changed

@combow('$Localescombo')="'"$LANG"'" "\" " | ! ""

to

@combow('$Localescombo')="'$LANG'" "\" " | ! ""

(There have been two unneccessary quotations).

Can you try again?
If it fails, please show me the output of x11docker-gui --verbose. Especially the first part showing the kaptain grammar is of interest, before the output of x11docker itself begins.

@Greenscreener
Copy link
Author

Greenscreener commented Mar 10, 2018

x11docker-gui output of kaptain code: https://pastebin.com/y3Z90k2m

Error: Parse error on line 59
Stuck __after__ the rule on line 58

That was the only output of x11docker-gui when I ran it before.

@mviereck
Copy link
Owner

mviereck commented Mar 10, 2018

Thank you for the code!

Now I have installed openSUSE Tumbleweed in a VM, too.

I still cannot reproduce the error neither on openSUSE 42 LEAP nor on Tumbleweed, neither with image x11docker/kaptain nor with rpm package kaptain. Also tested with cs_CZ.UTF-8 locale. All tested with your kaptain code you provided above.

Only one possibility: Do you run x11docker-gui with the kaptain rpm package or with image x11docker/kaptain? Maybe you have an older image; I made some changes in it recently for better utf8 locale support. You can update the kaptain image with:

docker pull x11docker/kaptain

If you are using the kaptain rpm package, you can try to deinstall it and use the image instead.

mviereck added a commit that referenced this issue Mar 10, 2018
…23)

# 10.03.2018 V3.9.6.1   --lang: replace locale-gen with more general available localedef
#                       --tini: check for docker-init in PATH, disable if missing (#23)
@mviereck
Copy link
Owner

I've included a better check for docker-init. Now x11docker will set --no-init on itself, you don't need to make that yourself.

@Greenscreener
Copy link
Author

Greenscreener commented Mar 10, 2018 via email

@mviereck
Copy link
Owner

I'm not sure if I have kaptain at all... Is that even possible?

:) If you are not sure, than you don't have it. It is not in openSUSE repository, but I provide it for manual installation: https://github.com/mviereck/kaptain

So best version is from docker?

The best one is one that works on your system - try to update the image, if that does not help, try out the rpm package.

@Greenscreener
Copy link
Author

Dne so, 10. 3. 2018 15:00 uživatel mviereck [email protected]
napsal:

Sorry, I used Gmail to reply and it automatically added this. It's the usual "sometime yesterday insert name wrote:", just in Czech as you probably have figured.

@Greenscreener
Copy link
Author

What actually is kaptain anyway?

@mviereck
Copy link
Owner

What actually is kaptain anyway?

kaptain is a tool to create a GUI with a simple script. Usually, GUIs are using GTK or QT or something else to create a GUI, but need a language like C or Python.

For bash there is nothing to create a GUI; but kaptain allows me to write a kaptain script that creates a GUI with QT. So I don't need to learn C or Python.

The code you provided me is a kaptain script, created by x11docker-gui.

@Greenscreener
Copy link
Author

Installed docker image, did nothing, tried to install rpm package, got this:

file /usr/share/man/man1/kaptain.1.gz from install of kaptain-0.73-2.x86_64 conflicts with file from package kde3-kaptain-0.72-1.40.x86_64

@mviereck
Copy link
Owner

Surprise ... it seems Tumbleweed reintroduced kaptain. It is not available on LEAP.

I am interpreting the message that you have package kde3-kaptain-0.72-1.40.x86_64 already installed. Can you check that?

@Greenscreener
Copy link
Author

Greenscreener commented Mar 10, 2018

$ zypper se kaptain
Loading repository data...
Reading installed packages...

S  | Name         | Summary                                                 | Type   
---+--------------+---------------------------------------------------------+--------
i+ | kde3-kaptain | Universal Graphical Front-End for Command-Line Programs | package

yep (The “i” should mean it's installed)

More detailed output:

$ zypper if kde3-kaptain 
Loading repository data...
Reading installed packages...


Information for package kde3-kaptain:
-------------------------------------
Repository     : @System                                                
Name           : kde3-kaptain                                           
Version        : 0.72-1.40                                              
Arch           : x86_64                                                 
Vendor         : obs://build.opensuse.org/KDE:KDE3                      
Installed Size : 943,5 KiB                                              
Installed      : Yes                                                    
Status         : up-to-date                                             
Source package : kde3-kaptain-0.72-1.40.src                             
Summary        : Universal Graphical Front-End for Command-Line Programs
Description    :                                                        
    Kaptain is a universal graphical front-end for command line programs.

@mviereck
Copy link
Owner

!?!
Do you have KDE3 desktop on your system? That package is not part of the regular openSUSE repo. Maybe that version differs somehow from my kaptain version and causes the error.

How can I enable the KDE3 repo in Tumbleweed? I could check out that kaptain version and maybe reproduce the error.

Can you remove the package without loosing dependencies you would like to keep?

@Greenscreener
Copy link
Author

Do you have KDE3 desktop on your system?

No. At least I haven't noticed yet. But really, no.

How can I enable the KDE3 repo in Tumbleweed?

I am not aware of it being enabled... I guess you could try this, but I have no actual idea how it originally got to my computer. I am kinda confused now. It isn't in the list of repos on my system either. Weird.

@mviereck
Copy link
Owner

Finally I can reproduce your error ...

The kaptain binary is in /opt/kde3/bin and I have to add that to PATH to execute kde3-kaptain. Maybe you should have a look at your /opt and your $PATH. :P

I may try to fix the issues with that kaptain version. Meanwhile, you could remove kde3-kaptain and try out kaptain image or my kaptain rpm.

@mviereck
Copy link
Owner

I've checked kde3-kaptain.
It shows version number 0.72, the actual version (since about 2006 ...) is 0.73.

I fixed the "Parse error after line xyz" bug (an array with more than 94 entries failed, now just reducing it to 1 default entry).

But the next error appears, some memory allocation error. It seems kaptain 0.72 is not able to handle my quite big x11docker-gui-script.

I won't try to fix that, too. Now x11docker-gui checks the version of kaptain and shows a warning for 0.72. Now it gives at least a message instead of failing silently.

@mviereck
Copy link
Owner

Ok, now a passable workaround: x11docker-gui checks version of kaptain. For version 0.72 from KDE:KDE3 repo it shows a warning and uses image x11docker/kaptain instead.

@Greenscreener
Copy link
Author

Good, removed kde3-kaptain and it used the docker image and everything is working. At least I hope so.

@mviereck
Copy link
Owner

mviereck commented May 5, 2018

A summarization about missing init in docker:

For unknown reasons, some docker packages are missing the init binary /usr/bin/docker-init. This is at least true for openSUSE, fedora, CentOS and deepin.
This is a bug in docker package and should be reported to the distribution package maintainers. docker run --help shows option --init, but it fails.

My installation from docker repository shows:

$ docker --version
Docker version 18.03.1-ce, build 9ee9f40
$ docker-init --version
tini version 0.13.0 - git.949e6fa
$ docker run --help | grep " --init"
    --init        Run an init inside the container that forwards signals and reaps processes

tini is available on github: https://github.com/krallin/tini
docker uses the statically linked https://github.com/krallin/tini/releases/download/v0.13.0/tini-static

Current solutions to get tini in container if docker run option --init fails:

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

No branches or pull requests

2 participants