Author Archives: Robins

_ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

problem

In python 2.7.6 through the requests library, if you request an https address, an error will be reported:[Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

Error reminder: sslv3 handshake error

Solution

  • Method 1: Upgrade python to 2.7.10 to solve the problem
  • Method 2:pip install requests[security]

the reason

But these three libraries are missing: pyOpenSSL, ndg-httpsclient, pyasn1

reference

[Solved] Pip install icu failed: Command “python setup.py egg_info” failed with error code 1 in

problem

Failed to install icu via pip under Mac.

Solution and reason

The cause of the problem is that a certain line of code in the icu library cannot find a file and cannot get ICU_VERSIONthe value.

# Install icu
brew install icu4c

# check newest version
ls /usr/local/Cellar/icu4c/

# Edit pyicu installer to work
git clone https://github.com/ovalhub/pyicu.git

# edit setup.py not to query for the version, i.e. change
# ICU_VERSION = subprocess.check_output(('icu-config', '--version')).strip()
# to whatever your version is, e.g.
# ICU_VERSION = '57'

# Install pyicu
env LDFLAGS=-L/usr/local/opt/icu4c/lib CPPFLAGS=-I/usr/local/opt/icu4c/include DYLD_LIBRARY_PATH=-L/usr/local/opt/icu4c/lib python setup.py build
env LDFLAGS=-L/usr/local/opt/icu4c/lib CPPFLAGS=-I/usr/local/opt/icu4c/include DYLD_LIBRARY_PATH=-L/usr/local/opt/icu4c/lib sudo python setup.py install

# Change DYLD_LIBRARY_PATH (not sure if req'd)
DYLD_LIBRARY_PATH=/usr/local/Cellar/icu4c/57.1/:$DYLD_LIBRARY_PATH
echo $DYLD_LIBRARY_PATH

# Icu works now from python, and you can proceed with polyglot
$ python
>>> import icu
$ pip install polyglot
$ python
>>> import polyglot

reference

[How to Solve] Too many authentication failures for xxxx_username

Explanation

This error is usually caused by multiple ssh key verifications. Too many keys cause the server to refuse to accept the authentication request.

By -vparameters, output detailed process. You will find the authentication key you provided, the server refused the link, and prompted an exception: “Too many authentication failures for [user]”.

Solution

ssh-add -D

explain in detail

This is usually caused by inadvertently offering multiple ssh keys to the server. The server will reject any key after too many keys have been offered.

You can see this for yourself by adding the -v flag to your ssh command to get verbose output. You will see that a bunch of keys are offered, until the server rejects the connection saying: “Too many authentication failures for [user]”. Without verbose mode, you will only see the ambiguous message “Connection reset by peer”.

To prevent irrelevant keys from being offered, you have to explicitly specify this in every host entry in the ~/.ssh/config file by adding IdentitiesOnly like so:

Host www.somehost.com
  IdentityFile ~/.ssh/key_for_somehost_rsa
  IdentitiesOnly yes
  Port 22

If you use the ssh-agent, it helps to run ssh-add -D to clear the identities.

If you are not using any ssh hosts configuration, you have to explicitly specify the correct key in the ssh command like so:

ssh -i some_id_rsa -o 'IdentitiesOnly yes' them@there:/path/
Note: the ‘IdentitiesOnly yes’ parameter needed to be between quotes.

or

ssh -i some_id_rsa -o IdentitiesOnly=yes them@there:/path/

reference

[Solved] Python2 Flask startup error: [Errno 10053]

First of all, this is not an exception of the Flask library. This error often appears in Python2.

The problem is: the problem with the SocketServer module in Python2.

Solution:

  1. Do not use the built-in Server, start the service through gunicoon or uwsgi
  2. runAdd in the method, threadedparameters:
app.run(threaded=True)
  1. Upgrade to Python3

How to Solve Python ImportError: cannot import name UnrewindableBodyError

Error message:

File "/usr/lib/python2.7/site-packages/urllib3/util/__init__.py", line 4, in <module>
    from .request import make_headers
  File "/usr/lib/python2.7/site-packages/urllib3/util/request.py", line 5, in <module>
    from ..exceptions import UnrewindableBodyError
ImportError: cannot import name UnrewindableBodyError

Solution, reloading urllib3library:

pip uninstall urllib3
pip install urllib3

How to Solve ERROR: Java 1.7 or later is required to run Apache Drill

problem

Apache’s drill executes the startup command drill-embedded

Error: ERROR: Java 1.7 or later is required to run Apache Drill.

By java -versioncommand to view the version information is as follows:

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Solution

Open the bin directory of drill drill-config.shmodify the behavior of 396:

"$JAVA" -version 2>&1 | grep "version" | egrep -e "1/.4|1/.5|1/.6" > /dev/null

?the reason

Dril problem lies in the drill-config.shscript is a positive match jdk version, no decimal ‘.’ Escape.

reference

ERROR: Java 1.7 or later is required to run Apache Drill.

There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)-skipping

The root cause of this problem first is that the requested target website no longer supports TLS versions 1.0 and 1.1.

  1. Pip install appear in the library when the solution: upgrade pip, command: curl https://bootstrap.pypa.io/get-pip.py | python. Note that because of the issue of the certificate authentication protocol version, it cannot be upgraded through the pip upgrade command. (The Python.org website has stopped supporting TLS versions 1.0 and 1.1)
  2. It occurs when an HTTPS request requests the library site, the solution: upgrade pyopenssl library, command: pip install -U pyopenssl.
  3. When creating a virtual environment, the pip version is still old, the solution:sudo pip install --upgrade pip virtualenv virtualenvwrapper

Python calls the MySQLdb library, and an error “Library not loaded: libmysqlclient.18.dylib” is reported

Error message:

“…Library not loaded: libmysqlclient.18.dylib

Referenced from: …ython2.7/site-packages/_mysql.so
  Reason: image not found”

the reason:

After upgrading MySQL, libmysqlclient.18.dylib becomes libmysqlclient.20.dylib.

Solution:

Find mysql lib under the installation path of libmysqlclient.20.dylibestablishing a soft connection.

sudo ln -s /usr/local/mysql/lib/libmysqlclient.20.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib