Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Get Errors when running lxdock up #158

Open
ppabcd opened this issue Nov 18, 2018 · 10 comments
Open

Get Errors when running lxdock up #158

ppabcd opened this issue Nov 18, 2018 · 10 comments

Comments

@ppabcd
Copy link

ppabcd commented Nov 18, 2018

i have trouble when running lxdock up and get this errors.
gambar
I'm using ubuntu:16.04 docker image for creating gitlab ci. I have try in local machine and nothing get erros. But when running in gitlab ci i get this erros. How to fix this errors.
Full Errors:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/usr/local/lib/python3.5/dist-packages/requests_unixsocket/adapters.py", line 32, in connect
    sock.connect(socket_path)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/packages/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/usr/local/lib/python3.5/dist-packages/requests_unixsocket/adapters.py", line 32, in connect
    sock.connect(socket_path)
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/pylxd/client.py", line 290, in __init__
    response = self.api.get()
  File "/usr/local/lib/python3.5/dist-packages/pylxd/client.py", line 145, in get
    response = self.session.get(self._api_endpoint, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/lxdock", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/lxdock/cli/main.py", line 259, in main
    LXDock(argv=argv)
  File "/usr/local/lib/python3.5/dist-packages/lxdock/cli/main.py", line 132, in __init__
    getattr(self, args.action)(args)
  File "/usr/local/lib/python3.5/dist-packages/lxdock/cli/main.py", line 225, in up
    self.project.up(container_names=args.name, provisioning_mode=args.provisioning_mode)
  File "/usr/local/lib/python3.5/dist-packages/lxdock/cli/main.py", line 236, in project
    self._project = get_project()
  File "/usr/local/lib/python3.5/dist-packages/lxdock/cli/project.py", line 16, in get_project
    client = get_client()
  File "/usr/local/lib/python3.5/dist-packages/lxdock/client.py", line 6, in get_client
    return pylxd.Client()
  File "/usr/local/lib/python3.5/dist-packages/pylxd/client.py", line 297, in __init__
    raise exceptions.ClientConnectionFailed()
pylxd.exceptions.ClientConnectionFailed
@robvdl
Copy link
Member

robvdl commented Nov 18, 2018

Did you add yourself to the lxd group? it appears to be having issues connecting to lxd

@ppabcd
Copy link
Author

ppabcd commented Nov 18, 2018

like this? sudo usermod --append --groups lxd root @robvdl

@robvdl
Copy link
Member

robvdl commented Nov 20, 2018

Yeah but I also see your original question, you are trying to run lxd inside a docker container if I am understanding correctly? I have never tried this.

@robvdl
Copy link
Member

robvdl commented Nov 20, 2018

You wouldn't normally need to add yourself to the lxd group if this is already the root user, this is only something you would do for non-root users to use lxd.

However, running lxd inside docker is something I really haven't tried, I'm not sure how well it would work.

@robvdl
Copy link
Member

robvdl commented Feb 10, 2020

I think this can be closed

@ppabcd ppabcd closed this as completed Feb 10, 2020
@devopstales
Copy link

what was the soultion? I got a similar error on a fedora 31 with and without using root user. My simple user is a member of lxd group.

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib64/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/site-packages/requests_unixsocket/adapters.py", line 41, in connect
    sock.connect(socket_path)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/lib/python3.7/site-packages/urllib3/util/retry.py", line 400, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3.7/site-packages/urllib3/packages/six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib64/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/site-packages/requests_unixsocket/adapters.py", line 41, in connect
    sock.connect(socket_path)
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pylxd/client.py", line 308, in __init__
    response = self.api.get()
  File "/usr/local/lib/python3.7/site-packages/pylxd/client.py", line 158, in get
    response = self.session.get(self._api_endpoint, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/lxdock", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/lxdock/cli/main.py", line 259, in main
    LXDock(argv=argv)
  File "/usr/local/lib/python3.7/site-packages/lxdock/cli/main.py", line 132, in __init__
    getattr(self, args.action)(args)
  File "/usr/local/lib/python3.7/site-packages/lxdock/cli/main.py", line 225, in up
    self.project.up(container_names=args.name, provisioning_mode=args.provisioning_mode)
  File "/usr/local/lib/python3.7/site-packages/lxdock/cli/main.py", line 236, in project
    self._project = get_project()
  File "/usr/local/lib/python3.7/site-packages/lxdock/cli/project.py", line 16, in get_project
    client = get_client()
  File "/usr/local/lib/python3.7/site-packages/lxdock/client.py", line 6, in get_client
    return pylxd.Client()
  File "/usr/local/lib/python3.7/site-packages/pylxd/client.py", line 315, in __init__
    raise exceptions.ClientConnectionFailed()
pylxd.exceptions.ClientConnectionFailed

@robvdl
Copy link
Member

robvdl commented Feb 23, 2020

Could this be something to do with Gitlab CI or running in Docker? Because that is running LXD on top of Docker, I haven't actually tested that yet, not sure if anyone else has?

As I remember that was specifically why we used Travis CI because as I recall that doesn't run on Docker. Someone needs to setup an isolated test to try out LXD + lxdock inside Docker, perhaps we can get it working with some effort.

Currently I don't really have much time to chase this issue I'm afraid aswith the amount of other project work on my backlog I cant' see me looking at this for quite some time. But if you can figure it out you can send a patch.

I'll re-open the issue, but perhaps if we can prove this is just Docker related, we should change the title of this issue?

@robvdl robvdl reopened this Feb 23, 2020
@robvdl
Copy link
Member

robvdl commented Feb 23, 2020

I've added the help wanted label because I am currently too busy to look into this, perhaps someone else wants to check this out? Could be related to running lxdock inside Docker containers but needs testing as that is just a guess.

@mtausig
Copy link
Contributor

mtausig commented Mar 2, 2020

Have you tried the docker-in-docker runner of the Gitlab CI?

@devopstales
Copy link

The fedora is on my laptop not in docker.

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

No branches or pull requests

4 participants