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

Spyder 5.0.4 crashes with proxy error to kite.com #15876

Closed
5 tasks
gvizkelethy opened this issue Jun 15, 2021 · 9 comments
Closed
5 tasks

Spyder 5.0.4 crashes with proxy error to kite.com #15876

gvizkelethy opened this issue Jun 15, 2021 · 9 comments

Comments

@gvizkelethy
Copy link

Issue Report Checklist

  • [ x] Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • [ x] Restarted Spyder
    • [ x] Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • [x ] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Spyder 5.0.4 crashes with proxy error to kite.com and "internal console not found.

What steps reproduce the problem?

  1. Upgrade Spyder from 5.0.3 to 5.0.4.
  2. Start Spyder, it crashes.
  3. Downgrade to 5.0.3, everything works.

What is the expected output? What do you see instead?

Paste Traceback/Error Below (if applicable)

Traceback (most recent call last):
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/urllib3/connectionpool.py", line 696, in urlopen
    self._prepare_proxy(conn)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/urllib3/connectionpool.py", line 964, in _prepare_proxy
    conn.connect()
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/urllib3/connection.py", line 359, in connect
    conn = self._connect_tls_proxy(hostname, conn)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/urllib3/connection.py", line 500, in _connect_tls_proxy
    return ssl_wrap_socket(
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 428, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 472, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 54] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='release.kite.com', port=443): Max retries exceeded with url: /dls/mac/current (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(54, 'Connection reset by peer')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 2132, in create_window
    main.setup()
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 903, in setup
    plugin_instance = plugin_class(self, configuration=CONF)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/plugins/completion/plugin.py", line 236, in __init__
    raise e
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/plugins/completion/plugin.py", line 232, in __init__
    self._instantiate_and_register_provider(Provider)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/plugins/completion/plugin.py", line 754, in _instantiate_and_register_provider
    provider_instance = Provider(self, provider_config['values'])
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/plugins/completion/providers/kite/provider.py", line 83, in __init__
    self.setup_menus()
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/plugins/completion/providers/kite/provider.py", line 235, in setup_menus
    installers_available = check_kite_installers_availability()
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/plugins/completion/providers/kite/utils/status.py", line 117, in check_kite_installers_availability
    req = requests.head(url)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/requests/api.py", line 104, in head
    return request('head', url, **kwargs)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/requests/adapters.py", line 510, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='release.kite.com', port=443): Max retries exceeded with url: /dls/mac/current (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(54, 'Connection reset by peer')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/gvizkel/python38/bin/spyder", line 8, in <module>
    sys.exit(main())
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/app/start.py", line 226, in main
    mainwindow.main(options, args)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 2282, in main
    mainwindow = create_window(app, splash, options, args)
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 2134, in create_window
    if main.console is not None:
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 1156, in __getattr__
    return self.get_plugin(self._INTERNAL_PLUGINS_MAPPING[attr])
  File "/Users/gvizkel/python38/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 169, in get_plugin
    raise SpyderAPIError(
spyder.api.exceptions.SpyderAPIError: Plugin "internal_console" not found!

Versions

  • Spyder version: 5.0.4
  • Python version: 3.8.9
  • Qt version:
  • PyQt version: 5.12.3
  • Operating System name/version: MacOS 10.15.7

Dependencies

PASTE DEPENDENCIES HERE
@steff456
Copy link
Member

Hi @gvizkelethy,

This error is happening at the startup or did you ran something? Also, how are you upgrading Spyder?

@gvizkelethy
Copy link
Author

This happens when I start Spyder from a terminal window. It does not matter if I start in the foreground or the background. I upgraded Spyder with pip, I do not have the anaconda environment.

@ba05
Copy link

ba05 commented Jun 16, 2021

I get a similar error with 5.0.4 where it fails to launch if I am not connected to the internet. Connected it works.

@gvizkelethy
Copy link
Author

I am connected to the internet but through a firewall. The proxy settings work for everything, even for pip except for Spyder. It looks like it is trying to connect to the wrong proxy. Is there a way to check what proxy it is trying to connect? And why does Spyder need an internet connection? Can I turn it off?

@ccordoba12
Copy link
Member

@gvizkelethy, how did you set your proxy settings so that pip can use them? Are you using environment variables for that?

@ccordoba12 ccordoba12 added this to the v5.0.5 milestone Jun 16, 2021
@gvizkelethy
Copy link
Author

Yes, I am using environment variables:
PIP_PROXY=https://proxy.sandia.gov:80
http_proxy=http://proxy.sandia.gov:80
https_proxy=https://proxy.sandia.gov:80

@ccordoba12
Copy link
Member

Ok, thanks for the confirmation @gvizkelethy.

We'll fix this problem and release 5.0.5 right away.

@ccordoba12 ccordoba12 assigned andfoy and unassigned steff456 Jun 16, 2021
@andfoy
Copy link
Member

andfoy commented Jun 16, 2021

According to the requests documentation, the variables set by @gvizkelethy should work as expected, as requests is already picking them. In this case, the error is related to the proxy communication and not with Spyder, we should introduce a Try/Except block to prevent these kind of errors.

@mrclary
Copy link
Contributor

mrclary commented Jun 21, 2021

I can verify that this also occurs when self-signed certificates are used...

2021-06-21 12:52:35,915 [WARNING] [spyder.plugins.completion.plugin] -> Failed to load completion provider from entry point kite = spyder.plugins.completion.providers.kite.provider:KiteProvider
Traceback (most recent call last):
  File "urllib3/connectionpool.pyc", line 699, in urlopen
  File "urllib3/connectionpool.pyc", line 382, in _make_request
  File "urllib3/connectionpool.pyc", line 1010, in _validate_conn
  File "urllib3/connection.pyc", line 411, in connect
  File "urllib3/util/ssl_.pyc", line 449, in ssl_wrap_socket
  File "urllib3/util/ssl_.pyc", line 493, in _ssl_wrap_socket_impl
  File "ssl.pyc", line 500, in wrap_socket
  File "ssl.pyc", line 1040, in _create
  File "ssl.pyc", line 1309, in do_handshake
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)

The self-signed certificate issue is not technically a Spyder problem (we have these issues constantly at my company), but I agree with @andfoy that a try/except block should be used.

ccordoba12 added a commit that referenced this issue Jun 23, 2021
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

6 participants