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

emsdk install failing #6275

Closed
Krelborn opened this issue Feb 24, 2018 · 53 comments
Closed

emsdk install failing #6275

Krelborn opened this issue Feb 24, 2018 · 53 comments

Comments

@Krelborn
Copy link

I am trying to update my emsdk installation and getting the following error after running ./emsdk install latest.

Installing tool 'emscripten-1.37.34'..
Error downloading URL 'https://github.com/kripken/emscripten/archive/1.37.34.tar.gz': <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)>
Installation failed!

I'm seeing this whether I try to upgrade an existing installation or install from a clean copy of the SDK. Platform is macOS. I tried to install 1.37.33 as well and that failed with the same error. Is anyone else seeing this problem?

@frittblas
Copy link

Yes I have the same problem but with emscripten-1.37.35
Error downloading..
I'm on windows.

@jjyyxx
Copy link

jjyyxx commented Feb 25, 2018

Similar problem.
Platform: windows
Error downloading URL 'https://github.com/kripken/emscripten/archive/1.37.35.zip': <urlopen error [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version>

However, i was able to download the archive manually from the browser. Is there a way to bypass the download stage(maybe put the archive to a specific directory manually) and install directly?

@LMLB
Copy link

LMLB commented Feb 25, 2018

@jjyyxx Put the zip in the zips folder and make sure it has the same file name as in the URL (i.e. 1.37.35.zip, not emscripten-1.37.35.zip). Then run the install command again and it will detect that the zip file is already downloaded.

@Krelborn
Copy link
Author

That's a good workaround, thanks!

@jjyyxx
Copy link

jjyyxx commented Feb 25, 2018

Thanks. It works perfectly

@LMLB
Copy link

LMLB commented Feb 25, 2018

This seems to have been caused by https://github.com/blog/2507-weak-cryptographic-standards-removed. The version of Python included in the Windows build is too old.

Edit: It's because of the included version of OpenSSL is too old (i.e. less than 1.0.1).

@kripken
Copy link
Member

kripken commented Feb 25, 2018

Sounds like we need to update the Python in the windows emsdk, but is this windows-only? The initial report here was on Mac.

@Krelborn
Copy link
Author

Yep I’m seeing this on macOS 10.12 and 10.13.

@kripken
Copy link
Member

kripken commented Feb 25, 2018

Is the core issue the same, do those MacOS versions ship with too-old versions of python?

@Krelborn
Copy link
Author

Python version is 2.7.10 on both macOS versions I've tried, I guess that must be too old if that's the issue.

@mapsam
Copy link

mapsam commented Feb 25, 2018

Just updated to MacOS 10.13.3 and the install latest command worked!

Adding some things I saw, which may or may not be helpful. tlsv1 alert protocol version error searches reveal mostly python and openssl issues. I noticed before the MacOS upgrade I was running openssl 0.9.8 but now I'm running LibreSSL 2.2.7.

@frittblas
Copy link

kripken - yes it's an issue on windows too. I also got this error when trying to compile a project that worked fine in 1.35.00

urllib2.URLError: <urlopen error [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version>

@LMLB
Copy link

LMLB commented Feb 25, 2018

Sorry, I missed that it was originally reported on macOS, as I had the same issue on Windows.

It's actually the version of OpenSSL that's too old (version 1.0.1 or higher is needed for TLS 1.2). Python 2.7.5 for Windows includes OpenSSL 0.9.8y, and macOS 10.13.3 includes OpenSSL 0.9.8zh.

@Krelborn
Copy link
Author

Yep, I've retried on macOS 10.13 and it does seem to work so it's just 10.12 where I have the problem (Which is my main development machine). I'll use the workaround that was posted until I get round to upgrading. Thanks for the responses!

@juj
Copy link
Collaborator

juj commented Feb 26, 2018

I'm able to reproduce this on Windows.

Thanks for troubleshooting versions in the above, very useful. Emsdk bundles the Portable Python package on Windows, and on other OSes depends on python being installed by default on the system.

Unfortunately latest version of Portable Python seems to be 2.7.6.1, which by @Krelborn 's comment above seems to be too old, as 2.7.10 was detected to be too old. It looks like we need to source an up to date portable python installation.

@juj
Copy link
Collaborator

juj commented Feb 26, 2018

https://winpython.github.io/ looks promising, I'll see if we could migrate to using that.

Although https://stackoverflow.com/questions/29472289/is-there-portable-python-2-7-windows-distribution-without-any-libraries-included suggests "I have to unpack 1.5GB first and uninstall unused packages." so not sure if this might cause a download size impact.

@LMLB
Copy link

LMLB commented Feb 26, 2018

FYI: According to the release notes on python.org, Python 2.7.7 on Windows includes OpenSSL 1.0.1g.

Note that the version of Python shouldn't matter on macOS, as it is only on Windows that Python has its own copy of OpenSSL baked in. On other operating systems Python relies on the OpenSSL version that is installed in the system.

@juj
Copy link
Collaborator

juj commented Feb 26, 2018

A fix is now in emscripten-core/emsdk@4c8ea1b

It would be great if someone can help trying this out:

git clone https://github.com/juj/emsdk.git
cd emsdk
emsdk install latest
emsdk activate latest

should obtain Python 2.7.13.1 64-bit and Emscripten 1.37.35 precompiled.

@juj juj added the macOS label Feb 26, 2018
@juj
Copy link
Collaborator

juj commented Feb 26, 2018

On macOS side, I'm thinking that we have no other easy option rather to call macOS 10.12 unsupported, and ask users to update to macOS 10.13? Or I wonder if manually downloading and replacing macOS bundled python with a newer python via homebrew or similar would work?

@mischnic
Copy link

Installing binaryen (#6276) works with Python 2 and 3 from Homebrew:

$ python2 --version
Python 2.7.14
$ python3 --version
Python 3.6.4
$ python2 /usr/local/bin/emcc -s WASM=1 main.c #works
$ python3 /usr/local/bin/emcc -s WASM=1 main.c #works

More permanent solution (bash):

alias emcc="python2 /usr/local/bin/emcc" # or python3

giuliolunati added a commit to metaeducation/ren-c that referenced this issue Feb 28, 2018
Now Emscripten build requires OSX 10.13 (Xcode9.3beta)

See emscripten-core/emscripten#6275
giuliolunati added a commit to metaeducation/ren-c that referenced this issue Feb 28, 2018
Now Emscripten build requires OSX 10.13 (Xcode9.3beta)

See emscripten-core/emscripten#6275
@ypoissant
Copy link

I am trying to add SIMD support to our application and I get the following error:
error: Linking globals named 'emscripten_float64x2_add': symbol multiply defined!
This error is reviewed in bug #5867 so I tried to follow the instructions, that is installing the latest but the installation fails with the error:
Error downloading URL 'https://github.com/kripken/emscripten/archive/1.37.35.zip': <urlopen error [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version>
I also tried to install the 1.37.23 (as per instruction in #5867) but got the same error.
I know this is due to an old Python version in the sdk distribution but I'm not experienced enough with the sdk to do a manual install. I'm stuck with 1.37.22.
Is there a fix in the pipeline for this?

@kripken
Copy link
Member

kripken commented Mar 1, 2018

Has anyone had a chance to try @juj's steps a few comments back? #6275 (comment) I think we're waiting on that to move forward here.

@zsavicreative
Copy link

I can confirm that on windows 10 pro the python included in the emsdk-portable download was failing for me, after removing the python contents, I just replaced it with my own python 2.7 root and left the folder name as is, managed to download/install without issues.

@juj
Copy link
Collaborator

juj commented Apr 4, 2018

Emsdk updated to using Python 2.7.13.1 on Windows since this bug was originally reported, so it should be fixing the issue on Windows, although the problem is that if user has old Python on emsdk on Windows, they cannot use emsdk update + emsdk install latest to update to the newest version, since the updater relies on being able to download with Python, so in such scenario, manually bootstrapping to the latest version should be done by redownloading the portable installer (which has the updated Python 2.7.13.1 in it).

It's good to know that on macOS manually updating Python e.g. via brew will help. Unlike Windows, on macOS we don't bundle Python in emsdk because macOS comes with Python shipped, and we've been assuming that it would be a functional one.

I'll close this bug as fixed - unfortunately a manual update of Python or redownload of emsdk may be needed for users, but once one has the latest version, the issue should not be present.

@juj juj closed this as completed Apr 4, 2018
@kripken
Copy link
Member

kripken commented Apr 4, 2018

manually bootstrapping to the latest version should be done by redownloading the portable installer (which has the updated Python 2.7.13.1 in it).

Note that we currently do not link to an installer for windows, instead we recommend people get the emsdk and let it do the rest, like on other platforms. (Because I don't know how to build or test the installer...)

@marswong
Copy link

installing 1.37.36 on macOS 10.13.4 with python 2.7.14 still failed.

@damu
Copy link

damu commented Apr 24, 2018

Seems like emsdk is still using Python 2.7.5.3 and that it still has this issue. I just tried it today and installed Python 3.6.5 before because emsdk wouldn't even start otherwise. See emscripten-core/emsdk#140
@juj

@juj
Copy link
Collaborator

juj commented Apr 27, 2018

Note that we currently do not link to an installer for windows

The NSIS installer .exes on Windows were deprecated at some point, since it was not much gain to support an extra deployment workflow, and the Windows emsdk portable zip based package does much of the same thing with less hassle. The only thing that's different in the Windows emsdk portable zip package compared to macOS and Linux is that in the Windows package, we bundle portable Python 2.7.13.1 into the zip package.

@juj
Copy link
Collaborator

juj commented Apr 27, 2018

Oh hmm, I now see that the Downloads page at http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html# no longer mentions a link to the downloadable zip packages. That is, to these zip files:

and indeed, in the above, emsdk-portable.zip still has old Python. I think we need to make the S3 bots roll out a new emsdk-portable zip and tar.gz packages. @kripken : that is done in the Buildbot dashboard by manually launching the emsdk-win-updater, emsdk-osx-updater and emsdk-linux-updater build tasks. Those tasks run deploy_emsdk.py to zip up and upload a emsdk-portables for download.

I was not able to find the link to the Buildbot dashboard in my email inbox, could you link to that here?

@kripken
Copy link
Member

kripken commented Apr 27, 2018

@juj do you mean this link? http://ec2-54-213-252-128.us-west-2.compute.amazonaws.com:8112/#/

I opened a PR on the emsdk repo to update the links there (to point to the website downloads docs), emscripten-core/emsdk#141

@mattdesl
Copy link

Just to add: I updated from Python 2.7.10 to 2.7.14 on macOS Sierra, and suddenly it fixed this issue. I updated with Macports:

# install latest
sudo port install python27

# alias to 'python' command
sudo port select --set python python27

Quit and re-open terminal, then run python --version to ensure it's been updated.

@k2snowman69
Copy link

Just curious: It's been a while since the documentation was changed requiring windows users to install python separately from emsdk (#6298). Is this now the official norm or still just a work around until bundling python into emsdk gets resolved? We haven't changed our CI yet to install python and don't want to put in the time if in a few weeks/months it's not going to matter.

@kripken
Copy link
Member

kripken commented Sep 11, 2018

There are no current plans to improve the windows SDK install and bundle things like python - I'd love for us to, but unless someone volunteers, for now the best we can do is an experience similar to the other platforms.

@mason276752
Copy link

In MacOS
$ /Applications/Python\ 2.7/Install\ Certificates.command
This is work

ref:https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error

@zhyonc
Copy link

zhyonc commented Nov 29, 2018

Firstly,I typed "emsdk install latest" in git cmd,but it said "bash:git:command not found"
and then I got the issue code look like #6723 when i typed "./emsdk install latest" on Windows10.
Finally,I set the system path point to emsdk dir and typed "emsdk install latest" again.
It worked!!Silly me. By the way,my python version is 2.7.15.

@WhiteHexagon
Copy link

macos 10.12.4 following your getting_started for 1.38.28. ./emsdk install latest gave me the same tlsv1 error. Following your instructions "Otherwise you can manually install and use Python 2.7.12 or newer" I did a brew install python3 however to get this working I actually needed brew install python2 which now shows 2.7.15.

@gaopinghuang0
Copy link

gaopinghuang0 commented Jul 4, 2019

python ./emsdk install latest works for me. I installed the newer python 2.7.16, but without typing python at the beginning, it doesn't work.

MacOS 10.14.5. Installed python from python.org.

@F1r3Hydr4nt
Copy link

@UZIhuhuhu
Copy link

python ./emsdk install latest works for me. I installed the newer python 2.7.16, but without typing python at the beginning, it doesn't work.

MacOS 10.14.5. Installed python from python.org.

it works for me (OSX)

@navidmo
Copy link

navidmo commented Sep 27, 2019

Here is a bandage (not secure as you bypass cert checks) to fix it:

edit emsdk.py

change
u = urlopen(url)
to
ncontext = ssl.SSLContext()
u = urlopen(url, context=ncontext)

Make sure to add:
import ssl

@rualark
Copy link

rualark commented Jan 24, 2020

Here is a bandage (not secure as you bypass cert checks) to fix it:

edit emsdk.py

change
u = urlopen(url)
to
ncontext = ssl.SSLContext()
u = urlopen(url, context=ncontext)

Make sure to add:
import ssl

This results in:

N:\Web\site\harmony-dev\wasm\emsdk>emsdk install latest
Traceback (most recent call last):
  File "N:\Web\site\harmony-dev\wasm\emsdk\emsdk.py", line 25, in <module>
    import ssl
  File "C:\Users\Rualark\Anaconda3\lib\ssl.py", line 98, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified module could not be found.

Tried to install ssl:
image

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