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

"check for updates" error #2151

Closed
freder opened this issue Feb 24, 2018 · 44 comments
Closed

"check for updates" error #2151

freder opened this issue Feb 24, 2018 · 44 comments

Comments

@freder
Copy link

freder commented Feb 24, 2018

Problem statement

image
clicking the "check for updates" button causes an error.

Steps to reproduce

  1. click the "check for updates" button

Expected result

notification about newer available version

Actual result

2018-02-24 12:02:29,059 [INFO] requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): api.github.com
Traceback (most recent call last):
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 578, in urlopen
    chunked=chunked)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 351, in _make_request
    self._validate_conn(conn)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 814, in _validate_conn
    conn.connect()
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 289, in connect
    ssl_version=resolved_ssl_version)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl_.py", line 308, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 385, in wrap_socket
    _context=self)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 760, in __init__
    self.do_handshake()
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 996, in do_handshake
    self._sslobj.do_handshake()
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 641, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/adapters.py", line 403, in send
    timeout=timeout
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 604, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/freder/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_update_utils.py", line 118, in execute
    latest_sha = latest_github_sha()
  File "/Users/freder/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_update_utils.py", line 65, in latest_github_sha
    r = requests.get('https://api.github.com/repos/nortikin/sverchok/commits')
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/api.py", line 71, in get
    return request('get', url, params=params, **kwargs)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/api.py", line 57, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/Applications/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/adapters.py", line 477, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)

Sverchok version

0.5.9.6
sverchok-master.zip from github (today)

@zeffii
Copy link
Collaborator

zeffii commented Feb 24, 2018

i think you might want to update Blender it uses python 3.6 now

@freder
Copy link
Author

freder commented Feb 24, 2018

I'm using blender 2.79 which uses python 3.5.2
image

are you saying I should upgrade to 2.8?

@zeffii
Copy link
Collaborator

zeffii commented Feb 24, 2018

get 2.79a from blender.org: https://www.blender.org/download/

no b2.8 is not supported

@freder
Copy link
Author

freder commented Feb 24, 2018

ok, I have 2.79a now
image
but the console still says it's python 3.5.2. 🤔

@zeffii
Copy link
Collaborator

zeffii commented Feb 24, 2018

ok, then osx builds are not in-line with linux/windows builds.

another way to update Sverchok, manually, is to run this from console... i think...

bpy.ops.node.sverchok_update_addon()

@zeffii
Copy link
Collaborator

zeffii commented Feb 24, 2018

the error comes from the python requests module, which isn't a standard python module, but the Blender.org adds it to their Python distribution. We happen to use this module for a rather trivial data lookup. I think i'll replace this dependency, this is about the 5th time i've responded to someone running into problems with it.

@freder
Copy link
Author

freder commented Feb 24, 2018

from what I found out, the python version that comes with (my version of) blender seems to be built against an old(er) version of openssl.

>>> import ssl; print(ssl.OPENSSL_VERSION)
OpenSSL 0.9.8zh 14 Jan 2016

@zeffii
Copy link
Collaborator

zeffii commented Feb 24, 2018

not much we can fix on the Blender side. Sverchok can drop the dependency on requests (i already have replacement code ready to commit somewhere..)

@zeffii
Copy link
Collaborator

zeffii commented Feb 25, 2018

am hoping to nail the coffin with this commit. #2155

you will need to manually update using that console command i showed above (will only work if Sverchok is enabled..)

@zeffii zeffii closed this as completed Feb 25, 2018
@portnov
Copy link
Collaborator

portnov commented Feb 25, 2018

@zeffii
Probably related: https://github.com/blog/2507-weak-cryptographic-standards-removed

@freder
Changes were merged into master. Could you please test if "check for updates" works now? (you may have to update manually first, to get the fix).

@freder
Copy link
Author

freder commented Feb 25, 2018

@portnov still doesn't work. but it makes sense: the blender python's openssl version only
supports older versions of TLS – those that github dropped recently.

@zeffii
Copy link
Collaborator

zeffii commented Feb 25, 2018

then

>>> bpy.ops.node.sverchok_update_addon()

@freder
Copy link
Author

freder commented Feb 25, 2018

@zeffii I forgot to mention: that also produces an error.

>>> bpy.ops.node.sverchok_update_addon()
<urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)>
Error: Cannot get archive from Internet

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "/Applications/blender.app/Contents/Resources/2.79/scripts/modules/bpy/ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Cannot get archive from Internet

@portnov
Copy link
Collaborator

portnov commented Feb 25, 2018

As I expected :) @zeffii that calls urllib also, so it uses the same old openssl version, so it has the same problem. I see only two solutions:

  1. update openssl (not sure how to do this in macos/blender)
  2. use plain HTTP instead of HTTPS, if it is supported (not sure).

@zeffii
Copy link
Collaborator

zeffii commented Feb 25, 2018

in that case maybe you can change the base url from TextEditor..

import sverchok
from sverchok.utils import sv_prefs

# removing the https to http
sv_prefs.set_vals(dload_archive_path='http://github.com/nortikin/sverchok/archive/')  

bpy.ops.node.sverchok_update_addon()

@zeffii
Copy link
Collaborator

zeffii commented Feb 25, 2018

hmm, i don't know. @freder might be worth filing a bug report on Blender's bugtracker.. or looking if it has been mentioned there already.

beyond the scope of what i'd hoped to accomplish today :)

@freder
Copy link
Author

freder commented Feb 25, 2018

I opened a ticket in the blender bug tracker: https://developer.blender.org/T54158

@zeffii
Copy link
Collaborator

zeffii commented Feb 26, 2018

if everything worked you would be able to run this in the TextEditor (fill to_path appropriately) and it would download the file to the destination..

minimal example script:

import urllib

to_path = r"C:\Users\zeffi\Desktop\desk_blends\master_example.zip"
# to_path = "some_existing_dir_path/master.zip"
url = "https://github.com/nortikin/sverchok/archive/master.zip"
file = urllib.request.urlretrieve(url, to_path)

@zeffii
Copy link
Collaborator

zeffii commented Feb 26, 2018

@zeffii
Copy link
Collaborator

zeffii commented Feb 26, 2018

in b3d python console

>>> import ssl; print(ssl.OPENSSL_VERSION)
OpenSSL 1.0.2k  26 Jan 2017

@zeffii
Copy link
Collaborator

zeffii commented Feb 26, 2018

just adding for completeness here, i suspect you have already perused those on your own steam by now.

@zeffii
Copy link
Collaborator

zeffii commented Feb 26, 2018

@enzyme69 you have osx, are you using Blender's supplied python or a system python..

@enzyme69
Copy link
Collaborator

@zeffii I am always using Blender supplied Python with Sverchok, never had issue thankfully. Running Blender by selecting blender.app - show package content and then running from terminal app.

@zeffii
Copy link
Collaborator

zeffii commented Feb 26, 2018

@enzyme69 and what does this say when you do it in b3d python console

>>> import ssl; print(ssl.OPENSSL_VERSION)
OpenSSL 1.0.2k  26 Jan 2017

@enzyme69
Copy link
Collaborator

I am getting this:

>>> import ssl; print(ssl.OPENSSL_VERSION)
OpenSSL 0.9.8zh 14 Jan 2016

@enzyme69
Copy link
Collaborator

Ok folks I confirm I also have issue with Sverchok github update and also I can no longer load my github snippet...

I will try latest2 Blender for Mac...

@enzyme69
Copy link
Collaborator


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_update_utils.py", line 118, in execute
    latest_sha = latest_github_sha()
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_update_utils.py", line 65, in latest_github_sha
    r = requests.get('https://api.github.com/repos/nortikin/sverchok/commits')
  File "/Applications/blender-2.79-macOS-10.6/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/api.py", line 71, in get
    return request('get', url, params=params, **kwargs)
  File "/Applications/blender-2.79-macOS-10.6/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/api.py", line 57, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Applications/blender-2.79-macOS-10.6/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Applications/blender-2.79-macOS-10.6/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/Applications/blender-2.79-macOS-10.6/blender.app/Contents/Resources/2.79/python/lib/python3.5/site-packages/requests/adapters.py", line 477, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)

location: <unknown location>:-1

location: <unknown location>:-1

@enzyme69
Copy link
Collaborator

Blender 2.79a RC

import ssl; print(ssl.OPENSSL_VERSION)
OpenSSL 0.9.8zh 14 Jan 2016

@zeffii your one is higher version?

@enzyme69
Copy link
Collaborator

Confirmed:

  • Update is broken
  • cannot load and cannot upload zip anymore

@zeffii
Copy link
Collaborator

zeffii commented Feb 27, 2018

@zeffii your one is higher version?

yes @enzyme69

>>> import ssl; print(ssl.OPENSSL_VERSION)
OpenSSL 1.0.2k  26 Jan 2017

please paste the full error output from console/cmd, i'll try it on a different machine too..

@enzyme69
Copy link
Collaborator

Full console error:

Traceback (most recent call last):
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 1254, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 1261, in connect
    server_hostname=server_hostname)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 385, in wrap_socket
    _context=self)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 760, in __init__
    self.do_handshake()
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 996, in do_handshake
    self._sslobj.do_handshake()
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 641, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_update_utils.py", line 118, in execute
    latest_sha = latest_github_sha()
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_update_utils.py", line 66, in latest_github_sha
    json_obj = r.json()
  File "/Users/jimmygunawan/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master/utils/sv_requests.py", line 20, in get_json
    json_to_parse = rq.urlopen(url)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 1297, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 1256, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)>


@zeffii
Copy link
Collaborator

zeffii commented Feb 27, 2018

okok @enzyme69

now what happens if you run this in the TextEditor

import urllib

to_path = r"C:\Users\zeffi\Desktop\desk_blends\master_example.zip"   # on windows..for example
# to_path = "some_existing_dir_path/master.zip"   # <----- you make up a path
url = "https://github.com/nortikin/sverchok/archive/master.zip"
file = urllib.request.urlretrieve(url, to_path)

does it generate the file at the location you write in to_path ?

@enzyme69
Copy link
Collaborator

Traceback (most recent call last):
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 1254, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/http/client.py", line 1261, in connect
    server_hostname=server_hostname)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 385, in wrap_socket
    _context=self)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 760, in __init__
    self.do_handshake()
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 996, in do_handshake
    self._sslobj.do_handshake()
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/ssl.py", line 641, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Text", line 8, in <module>
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 188, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 1297, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/Applications/blender-2.79a-RC/blender.app/Contents/Resources/2.79/python/lib/python3.5/urllib/request.py", line 1256, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:720)>
Error: Python script fail, look in the console for now...

@enzyme69
Copy link
Collaborator

Not generating anything.

@zeffii
Copy link
Collaborator

zeffii commented Feb 27, 2018

so... same error?

@enzyme69
Copy link
Collaborator

Same error exactly. Failed here:
file = urllib.request.urlretrieve(url, to_path)

@enzyme69
Copy link
Collaborator

enzyme69 commented Feb 27, 2018

Blender it uses python 3.6? Mine seems to be 3.5. Latest Blender 2.79a RC.

PYTHON INTERACTIVE CONSOLE 3.5.3 (default, May 29 2017, 11:05:36)

@zeffii
Copy link
Collaborator

zeffii commented Feb 27, 2018

test if you can with 3.6 :)

@portnov
Copy link
Collaborator

portnov commented Feb 27, 2018

I don't think Python can do something about TLS things, it is implemented inside openssl anyway.

@enzyme69
Copy link
Collaborator

@zeffii @portnov Blender non RC non official actually works, yes Python version issue. 2.79a should have latest Python 3.6.2, but it might break some addons.

PYTHON INTERACTIVE CONSOLE 3.6.2 (default, Sep 19 2017, 23:24:00) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)]

@zeffii
Copy link
Collaborator

zeffii commented Feb 27, 2018

yes @enzyme69

>>> import ssl; print(ssl.OPENSSL_VERSION)
OpenSSL 1.0.2k  26 Jan 2017

??? what does it say in the builder.blender.org versions that use Py3.6.x?

@enzyme69
Copy link
Collaborator

import ssl; print(ssl.OPENSSL_VERSION)
OpenSSL 1.0.2n 7 Dec 2017

@freder
Copy link
Author

freder commented Feb 27, 2018

turns out there was an issue (with more information) for this already: https://developer.blender.org/T52507

@nortikin
Copy link
Owner

nortikin commented Mar 2, 2018

apple sucks

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

5 participants