question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugging pylxd.exceptions.ClientConnectionFailed?

See original GitHub issue

I’m trying to connect to an LXD cluster using the steps from this guide but I get a pylxd.exceptions.ClientConnectionFailed error:

>>> from pylxd import Client
>>> client = Client(endpoint='http://192.168.123.121:8443', cert=('lxd.crt', 'lxd.key'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pylxd/client.py", line 290, in __init__
    raise exceptions.ClientConnectionFailed()
pylxd.exceptions.ClientConnectionFailed

The hosts are on the same subnet (.120 is my host, .121 is the LXD cluster member), ping works, port 8443 is open, the cert files are in place, I can get an answer back with wget:

host_120:~$ ping -q -c 5 192.168.123.121
PING 192.168.123.121 (192.168.123.121) 56(84) bytes of data.

--- 192.168.123.121 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4081ms
rtt min/avg/max/mdev = 0.435/0.691/0.881/0.179 ms
host_121:~$ netstat -an | egrep "8443.*LISTEN"
tcp        0      0 192.168.123.121:8443    0.0.0.0:*               LISTEN     
host_120:~$ ls lxd.*
lxd.crt  lxd.csr  lxd.key
host_120:~$ wget http://192.168.123.121:8443/1.0
--2018-07-08 06:10:27--  http://192.168.123.121:8443/
Connecting to 192.168.123.121:8443... connected.
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: '1.0'

1.0                                 [ <=>                                                                        ]       7  --.-KB/s    in 0s      

2018-07-08 06:10:27 (339 KB/s) - '1.0' saved [7]

The saved file contains “1503 0100 0202 0a” in hex. I did a capture too: pylxd.pcap.zip

Versions:

  • OS: Ubuntu 18.04 (Bionic) server
  • Python: 2.7.15rc1,
  • pylxd: 2.2.7
  • LXD: 3.0.1

Is it something with pylxd or the LXD cluster? Is there a way I could get a detailed error message, not just the exception?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:26 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
ajkavanaghcommented, Sep 14, 2018

@vanushwashere could you re-try with master branch please? There’s been a few commits in that area and it might have been fixed.

1reaction
ajkavanaghcommented, Jul 8, 2018

Ah, re: the remote error issue. Sorry, if you add , verify=False to the connection command, it will not verify the certificate and the connection should be made. You’ll get an Insecure warning though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the pylxd.exceptions.ClientConnectionFailed function in ...
To help you get started, we've selected a few pylxd.exceptions.ClientConnectionFailed examples, based on popular ways it is used in public projects.
Read more >
API documentation
An exception raised when an object is not found. class pylxd.exceptions. ClientConnectionFailed ¶. An exception raised when the Client connection fails.
Read more >
SaltStack: salt/modules/lxd.py - Fossies
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax ...
Read more >
why do some exceptions only occur in debug mode?
Why do some tools generate exceptions only while debugging? In other words, when the tool is "run" in ArcMap (10.3.1), the process completes ......
Read more >
pylxd Documentation - Read the Docs
class pylxd.exceptions.ClientConnectionFailed. An exception raised when the Client connection fails. 15.3 Certificate class pylxd.models.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found