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

Fails to communicate with api.linode.com on Ubuntu 19.04 #23

Open
Dorthu opened this issue Jul 17, 2019 · 1 comment
Open

Fails to communicate with api.linode.com on Ubuntu 19.04 #23

Dorthu opened this issue Jul 17, 2019 · 1 comment

Comments

@Dorthu
Copy link

Dorthu commented Jul 17, 2019

When installing this package on Ubuntu 19.04, the following error occurs:

Welcome to the Linode CLI.  This will walk you through some
initial setup.

First, we need a Personal Access Token.  To get one, please visit
https://cloud.linode.com/profile/tokens and click
"Add a Personal Access Token".  The CLI needs access to everything
on your account to work correctly.
Personal Access Token: test
Traceback (most recent call last):
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/util/connection.py", line 57, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/snap/linode-cli/24/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/connectionpool.py", line 344, in _make_request
    self._validate_conn(conn)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn
    conn.connect()
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/connection.py", line 316, in connect
    conn = self._new_conn()
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fdbe7203390>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/snap/linode-cli/24/lib/python3.5/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/connectionpool.py", line 641, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/snap/linode-cli/24/lib/python3.5/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.linode.com', port=443): Max retries exceeded with url: /v4/profile (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fdbe7203390>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/snap/linode-cli/24/bin/linode-cli", line 11, in <module>
    load_entry_point('linode-cli==2.6.0', 'console_scripts', 'linode-cli')()
  File "/snap/linode-cli/24/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/snap/linode-cli/24/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/snap/linode-cli/24/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/linodecli/__init__.py", line 29, in <module>
    cli = CLI(VERSION, BASE_URL, skip_config='--skip-config' in argv)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/linodecli/cli.py", line 39, in __init__
    self.config = CLIConfig(self.base_url, skip_config=skip_config)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/linodecli/configuration.py", line 49, in __init__
    self.configure()
  File "/snap/linode-cli/24/lib/python3.5/site-packages/linodecli/configuration.py", line 262, in configure
    u = self._do_get_request('/profile', token=config['token'], exit_on_error=False)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/linodecli/configuration.py", line 380, in _do_get_request
    result = get(self.base_url+url, headers=headers)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/snap/linode-cli/24/lib/python3.5/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.linode.com', port=443): Max retries exceeded with url: /v4/profile (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fdbe7203390>: Failed to establish a new connection: [Errno -2] Name or service not known',))

When installing from the python package, it works on the same machine.

This looks like it can't talk to api.linode.com when installed through snap, which is perplexing.

@FelicianoTech
Copy link
Owner

Can you please provide the output of: snap info linode-cli and snap --version?

I did a fresh install of this on Ubuntu 19.04 and I can't reproduce the issue.

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

No branches or pull requests

2 participants