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 login fails while docker-compose is installed on Ubuntu 18.04 #6023

Closed
jessehallam opened this issue Jun 17, 2018 · 41 comments
Labels

Comments

@jessehallam
Copy link

@jessehallam jessehallam commented Jun 17, 2018

Description of the issue

docker login
error getting credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY

This error appears on a fresh Ubuntu Server 18.04 install. It has virtually nothing installed except docker and docker-compose. This error only occurs when docker-compose is installed.

Typing sudo apt remove docker-compose clears the error. Login now occurs using the normal docker prompt.

Context information (for bug reports)

Output of "docker-compose version"

docker-compose version 1.17.1, build unknown
docker-py version: 2.5.1
CPython version: 2.7.15rc1
OpenSSL version: OpenSSL 1.1.0g 2 Nov 2017

Output of "docker version"

Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.10.1
Git commit: 7390fc6
Built: Wed Apr 18 01:23:11 2018
OS/Arch: linux/amd64

Server:
Engine:
Version: 17.12.1-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.10.1
Git commit: 7390fc6
Built: Wed Feb 28 17:46:05 2018
OS/Arch: linux/amd64
Experimental: false

Output of "docker-compose config"

ubuntu@:~$ docker-compose config
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?

    Supported filenames: docker-compose.yml, docker-compose.yaml

Steps to reproduce the issue

  1. sudo apt install docker
  2. sudo apt install docker-compose
  3. docker login

Observed result

error getting credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY

Expected result

The normal docker login prompt.

Stacktrace / full error message

(if applicable)

Additional information

OS version / distribution, docker-compose install method, etc.

Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-1010-aws x86_64)

This machine was built using Amazon AWS's Canonical Ubuntu 18.04 AMI. It has virtually nothing installed on it, except for docker, docker-compose and sshd.

@shin-

This comment has been minimized.

Copy link
Contributor

@shin- shin- commented Jun 18, 2018

Looks like a bug with the Ubuntu package, which is not owned by us. Additionally, the version the package installs (1.17.1) is no longer supported.

Please follow the official install instructions instead: https://docs.docker.com/compose/install/

@shin- shin- added the kind/question label Jun 18, 2018
@tuddman

This comment has been minimized.

Copy link

@tuddman tuddman commented Jun 24, 2018

adding that: following the official install instructions does not work when working on ARM platform (RPi)

uname -m
> aarch64

which can't find anything when it's apart of the cURL command to download the latest :/

any word on if/when ARM boards might be supported directly?

@lucafallabrino

This comment has been minimized.

Copy link

@lucafallabrino lucafallabrino commented Jun 28, 2018

I'm having the same issue woth Ubuntu18.04 server. I have tried with

  • docker-compose not present
  • docker-compose installed using the link provided by @shin-

but I keep getting
Cannot autolaunch D-Bus without X11 $DISPLAY

Installed packages version:

$ docker --version
Docker version 18.03.1-ce, build 9ee9f40
$ docker-compose --version
docker-compose version 1.21.2, build a133471

@shin-

This comment has been minimized.

Copy link
Contributor

@shin- shin- commented Jun 28, 2018

@tuddman We don't provide a build for arm architectures, but you can install the latest version using pip.

@lucafallabrino That's a completely unrelated issue. You're trying to use the secretservice credential helper on a server without X11, which isn't going to work. Use docker-credentials-pass on servers instead.

@kiliankoe

This comment has been minimized.

Copy link

@kiliankoe kiliankoe commented Jul 3, 2018

I'm having the same (or a similar) issue, running docker login failing with the error message Cannot autolaunch D-Bus without X11 $DISPLAY. Having stumbled across docker/docker-credential-helpers#60 it seems as if golang-docker-credential-helpers causes the issue here. Temporarily uninstalling docker-compose including the package above allowed me to run docker login to authenticate with my docker registry.

@shin- shin- closed this Jul 3, 2018
@kinkerl

This comment has been minimized.

Copy link

@kinkerl kinkerl commented Jul 24, 2018

hi, why is the issue closed? the workaround from @kiliankoe works but it is still a problem on a new ubuntu 18.04 installation.

@shin-

This comment has been minimized.

Copy link
Contributor

@shin- shin- commented Jul 24, 2018

Closed because not a Compose issue: #6023 (comment)

@mullenba

This comment has been minimized.

Copy link

@mullenba mullenba commented Aug 26, 2018

It's very much an issue. Fresh install of 18.04, installed docker-compose through pip. Exact same issue.

@prg3

This comment has been minimized.

Copy link

@prg3 prg3 commented Aug 29, 2018

I found that if you remove the golang-docker-credential-helpers package after switching to docker-ce and not the bundled docker package in ubuntu 18.04, this problem is resolved.

@chriswue

This comment has been minimized.

Copy link

@chriswue chriswue commented Sep 10, 2018

Since this is a bug in the Ubuntu packaging for server it needs to be fixed there but in the meantime a work-around without having to uninstall docker-compose temporarily or having to switch to the docker repos instead you can make it use pass instead. This is what I did:

sudo apt install gnupg2 pass 
gpg2 --full-generate-key

This generates a you a gpg2 key, After that's done you can list it with

gpg2 -k

Copy the key id (from the line labelled [uid]) and do

pass init "whatever key id you have"

After that docker login worked fine since it defaults to use pass and only tries to fallback to secretservice if it can't find it. secretservice seems to have an X11 dependency which isn't present on a basic server install.

Side effect is that you get a somewhat more secure credentials store or on your server instead of a base64 encoded json file.

@spaszek

This comment has been minimized.

Copy link

@spaszek spaszek commented Sep 10, 2018

This happened to me on freshly installed Docker version 18.06.1-ce, build e68fc7a on Ubuntu 18.04 provided by Azure VM.

@prg3 solution (which is running apt-get purge docker-credential-pass) solved the issue - I can now az acr login --name <registry> successfully.

@fredbcode

This comment has been minimized.

@CalvinHartwell

This comment has been minimized.

Copy link

@CalvinHartwell CalvinHartwell commented Sep 25, 2018

@jessehallam can you please try this package instead?

sudo apt-get install install docker.io
calvin@calvinh-ws:~$ sudo docker --version
Docker version 17.12.1-ce, build 7390fc6

This is version we ship and support with Canonical Kubernetes and I've never had any issue logging into registries with this agent (From the kubernetes 1.11 release notes):

The validated docker versions are the same as for v1.10: 1.11.2 to 1.13.1 and 17.03.x (ref)

Also, @tuddman we do ship and support Docker on ARM as we actually support Kubernetes on ARM today. There are big differences in ARM architectures, but you might also want to try the package above. If it is missing, I might be able to help with that:

adding that: following the official install instructions does not work when working on ARM platform (RPi)

uname -m

aarch64

which can't find anything when it's apart of the cURL command to download the latest :/

any word on if/when ARM boards might be supported directly?

@caiges

This comment has been minimized.

Copy link

@caiges caiges commented Sep 25, 2018

@CalvinHartwell We've run into this with both the official Ubuntu docker.io package as well as the upstream Docker repo. In one case we installed docker-ce, ran into this issue, uninstalled it, installed docker.io and are still encountering this particular problem. It should be noted we do not have compose installed at all.

@fredbcode

This comment has been minimized.

Copy link

@fredbcode fredbcode commented Sep 25, 2018

Seems related with user profile :
sudo docker login ko
sudo su and docker login ko
But sudo su - and docker login ok

@fredbcode

This comment has been minimized.

Copy link

@fredbcode fredbcode commented Sep 26, 2018

Hi, @CalvinHartwell same issue with docker.io

@afalko

This comment has been minimized.

Copy link

@afalko afalko commented Sep 27, 2018

I confirm that I'm hitting the same freshly provisioned systems where in installed docker.io and docker-compose in one shot:
Linux 4.15.0-1021-aws #21-Ubuntu SMP

Does anyone have a workaround? I didn't have the package installed for the apt-get purge docker-credential-pass workaround.

@fredbcode

This comment has been minimized.

Copy link

@fredbcode fredbcode commented Sep 27, 2018

@afalko you can use sudo su - and docker login right after

@fredbcode

This comment has been minimized.

Copy link

@fredbcode fredbcode commented Sep 27, 2018

Of course this is just a workaround, use a full root access is not a good idea
But for now ...

@afalko

This comment has been minimized.

Copy link

@afalko afalko commented Sep 27, 2018

Thanks @fredbcode !

I wound up automating this with the following workaround:

cat >gpg2.tmp <<EOF
     %echo Generating a basic OpenPGP key
     Key-Type: default
     Subkey-Type: default
     Name-Real: asdf asdf
     Name-Comment: asdf
     Name-Email: adsf@asdf.adsf
     Expire-Date: 0
     Passphrase: asdfasdf
     # Do a commit here, so that we can later print "done" :-)
     %commit
     %echo done
EOF
gpg2 --batch --generate-key gpg2.tmp
HOME=/home/docker-user pass init `gpg2 --list-secret-keys | grep uid -B 1 | head -n 1`
@trebonius0

This comment has been minimized.

Copy link

@trebonius0 trebonius0 commented Sep 28, 2018

I have the issue as well
Even with full root access, the workaround does not work for me

@artempronevskiy

This comment has been minimized.

Copy link

@artempronevskiy artempronevskiy commented Sep 29, 2018

Deleting docker-compose (apt-get autoremove) is the workaround

@fredbcode

This comment has been minimized.

Copy link

@fredbcode fredbcode commented Oct 2, 2018

@trebonius0 you made exactly sudo su - ,not just sudo su ?
Weird, works well here

@trebonius0

This comment has been minimized.

Copy link

@trebonius0 trebonius0 commented Oct 2, 2018

yes

@nyetwurk

This comment has been minimized.

@fatdrag0n

This comment has been minimized.

Copy link

@fatdrag0n fatdrag0n commented Oct 7, 2018

removing golang will remove bunch of python stuff and docker-compose.
I do use docker-compose. Do i have to do the gpg workaround?

@dadwin

This comment has been minimized.

Copy link

@dadwin dadwin commented Oct 8, 2018

Follow @shin-'s advice:

Please follow the official install instructions instead: https://docs.docker.com/compose/install/

don't do apt install docker-compose and if you did, remove it and its dependencies: apt remove docker-compose -y && apt autoremove.
With the official installation the problem's gone.

@fatdrag0n

This comment has been minimized.

Copy link

@fatdrag0n fatdrag0n commented Oct 8, 2018

I think I followed chriswue's advice and did gpg2 generating the key and then used the pass to set the credentials and was able to docker login

@claudeleveille

This comment has been minimized.

Copy link

@claudeleveille claudeleveille commented Oct 9, 2018

If all else fails (@shin-'s advice didn't help me), you can always generate a ~/.docker/config.json with the creds baked in.

@claudeleveille

This comment has been minimized.

Copy link

@claudeleveille claudeleveille commented Oct 9, 2018

Another tip for those who use Ansible in their CI, the docker_login module helped me out too.

@FabienPaitry

This comment has been minimized.

Copy link

@FabienPaitry FabienPaitry commented Oct 10, 2018

@PabTorre

This comment has been minimized.

Copy link

@PabTorre PabTorre commented Oct 10, 2018

At the very least, a better error message from docker login would be useful... just wasted half an hour on a goose chase around X11 Display... where a better message could've pointed straight towards using gnupg2 pass

@fredbcode

This comment has been minimized.

Copy link

@fredbcode fredbcode commented Oct 10, 2018

I disagree, not a better message, when x11 is not installed we should use docker login without any error.

@nyetwurk

This comment has been minimized.

Copy link

@nyetwurk nyetwurk commented Oct 10, 2018

Exactly this. This behavior makes zero sense.

@nyetwurk

This comment has been minimized.

Copy link

@nyetwurk nyetwurk commented Oct 11, 2018

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910822
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910823
@shin- Please work with the debian/ubuntu maintainers, or consider building your own debian packager or providing debian control files.

@wedi

This comment has been minimized.

Copy link

@wedi wedi commented Oct 24, 2018

golang-docker-credential-helpers does also get installed alongside python-docker. 😑
I decided to go with this solution.

@nyetwurk

This comment has been minimized.

Copy link

@nyetwurk nyetwurk commented Oct 24, 2018

Again, this is a very poor solution. It is a workaround at best, and not a good one. I wish there was more involvement by maintainers.

@nyetwurk

This comment has been minimized.

Copy link

@nyetwurk nyetwurk commented Oct 24, 2018

Please, for those of you participating in this thread, go vote for https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/1796119 and mark it as affecting you, or it will never get fixed.

@richstokes

This comment has been minimized.

Copy link

@richstokes richstokes commented Oct 27, 2018

I'm seeing this issue even when following the official instructions to install docker-compose (https://docs.docker.com/compose/install/#install-compose)

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"

docker-compose --version
docker-compose version 1.23.0-rc3, build ea3d406e

docker --version
Docker version 17.12.1-ce, build 7390fc6

docker login -u abc -p 123
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
error getting credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY

Same problem is I move to:

docker --version
Docker version 18.06.1-ce, build e68fc7a

As a side note, this issue is compounded by the fact the Ubuntu packages and the "official" docker packages are disjointed. You have the docker.io packages on Ubuntu vs. the docker-ce packages from the official download. Seems to make things that more confusing as it's not obvious which combination of packages one needs, especially when running into issues such as the above.

@nyetwurk

This comment has been minimized.

Copy link

@nyetwurk nyetwurk commented Oct 27, 2018

Honestly, I have no idea what docker devs are thinking. I think at this point closing this bug was a huge mistake; docker, docker-compose, and the various distro devs need to actually work together and not just point fingers at each other.

@shin-

This comment has been minimized.

Copy link
Contributor

@shin- shin- commented Oct 29, 2018

Bug reports have been filed on the Ubuntu and Debian trackers. As explained throughout the thread, this issue is unrelated to Compose. You can uninstall the problematic package (golang-docker-credential-helpers) manually, or avoid installing Compose through apt in the first place and use the official instructions instead.

@docker docker locked and limited conversation to collaborators Oct 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.