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: On Ubuntu 18.04 vagrant-proxyconf 2.0.1 when docker-ce-cli is installed it tries to configure systemd even though the docker daemon service is not there. #192

Open
1 task
codylane opened this issue Apr 12, 2019 · 8 comments

Comments

@codylane
Copy link
Collaborator

codylane commented Apr 12, 2019

OS: Ubuntu 18.04 amd64
Vagrant version: 2.2.4
vagrant-proxyconf version: 2.0.1

How to reproduce:

When following this guide: https://docs.docker.com/install/linux/docker-ce/ubuntu/

And only installing docker-ce-cli on the host, and then running vagrant provision the vagrant-proxyconf plugin will attempt to configure the docker systemd service.

With the following error:

$ vagrant provision
==> default: Configuring proxy for Apt...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

sed -e 's/\[Service\]/[Service]\nEnvironmentFile=-\/etc\/default\/docker/g' /lib/systemd/system/docker.service > /tmp/docker.service

Stdout from the command:
Stderr from the command:

sed: can't read /lib/systemd/system/docker.service: No such file or directory

vagrant@devenv:~$ dpkg -l | grep -i docker
ii  docker-ce-cli                         5:18.09.5~3-0~ubuntu-bionic       amd64        Docker CLI: the open-source application container engine

Potential solution:

  • - Check to see if the systemd file exists before trying to configure it.
@codylane codylane changed the title BUG: On Ubuntu 18.04 vagrant-proxyconf 2.0.1 when docker-ce-cli is installed it tries to configured systemd even though the docker daemon service is not there. BUG: On Ubuntu 18.04 vagrant-proxyconf 2.0.1 when docker-ce-cli is installed it tries to configure systemd even though the docker daemon service is not there. Apr 12, 2019
@codylane codylane self-assigned this Jun 7, 2019
@codylane codylane added this to the 2.0.2 milestone Jun 7, 2019
@codylane
Copy link
Collaborator Author

codylane commented Jun 20, 2019

Interesting, I didn't notice this before but it looks as though this plugin attempted to support configuring the docker daemon with proxy configuration but it was done so in the cap directories.
The cap directories have a few additional flaws that need to be addressed and need to be cleaned up.

If 2.0.2, addresses the docker daemon setup, then I feel like it's also a good idea to remove whatever implementation exists in the cap implementations. The bug we are seeing above is caused by the capability file thinking systemd is working but that's not always the case especially if you are inside a docker container or the system doesn't have the full systemd integration installed.

Places where this is defined in the capabilities

@zicklag
Copy link

zicklag commented Oct 30, 2019

Looks like you may already be fixing this but, just in case it is useful, this also happened to me when I installed the Docker snap package in the vagrant machine manually and then I did a vagrant halt and a vagrant up later. Looks like it is because the snap installs Docker differently than apt and doesn't have the same systemd files created.

@codylane
Copy link
Collaborator Author

Hi @zicklag - Thank you for the report and for notifying us that this behavior also affects other types of docker installs. This does seem to be one of those edge cases that will be challenging to fix.

Due to time constraints and how this code base is currently architected I'd say we probably won't be trying to support every type of docker-ce install and will probably only support the package manager install (in this case apt) instead of snap.

I'm still attempting to solve this issue, although I see this one as a minor compared to other bugs/features that need to be addressed. I do appreciate you taking the time to help report this issue and it is validating to know that others are also experiencing this problem.

If you feel that this issue issues needs faster resolution and if others feel the same way, please help me prioritize this by thumbs upping this message. Otherwise, if you feel comfortable and have some free time and willing to help we will accept pull requests.

@zicklag
Copy link

zicklag commented Oct 31, 2019

I don't have a large need for it and I think it is reasonable that you would not be able to universally set the Docker proxy for every installation method. If you can't manage to fix it, no big deal. We would just want to log that the Docker proxy could not be set so that the user knows what is happening and can respond accordingly.

@codylane
Copy link
Collaborator Author

codylane commented Nov 6, 2019

I don't have a large need for it and I think it is reasonable that you would not be able to universally set the Docker proxy for every installation method. If you can't manage to fix it, no big deal. We would just want to log that the Docker proxy could not be set so that the user knows what is happening and can respond accordingly.

Just curious, would you be able to share a gist or paste in the errors/issues that you are seeing in code block here in this thread? I'd love to have that for my own reference just to make sure I'm seeing the same error or if it's a little different.

I agree, I want to squelch un-handled exceptions as best as I can with more helpful error messages. Hopefully, this will be an easy fix which I hope to have some free time next week.

Thanks again and looking forward to hearing from you. Also hope your week is going well.

@zicklag
Copy link

zicklag commented Nov 8, 2019

I'm pretty sure that it was exactly the same, but I'll try it again when I get the chance to make sure.

@zicklag
Copy link

zicklag commented Nov 8, 2019

Here is the error I get:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

sed -e 's/\[Service\]/[Service]\nEnvironmentFile=-\/etc\/default\/docker/g' /lib/systemd/system/docker.service > /tmp/docker.service

Stdout from the command:



Stderr from the command:

sed: can't read /lib/systemd/system/docker.service: No such file or directory

@codylane
Copy link
Collaborator Author

codylane commented Nov 8, 2019

Excellent, thank you @zicklag, this will help ensure that I update the right place(s).

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