Mesos - Zookeeper error; Connection Refused - python

I've set up Apache Mesos 0.21.2 on a virtual machine. The installation was performed by downloading the sources, compiling it and applying make install.
On another virtual machine I've copied the build directory in order to use it as a slave system.
I wanted to start with a small 'hello world' framework as showed in http://jamesporter.me/2014/11/15/hello-mesos.html
however, when I'm executing the python framework with
python hello_mesos.py
I get the following log:
I1227 19:16:02.790803 1678 sched.cpp:137] Version: 0.21.1
2015-12-27 19:16:02,790:1678(0x7f6b1e3de700):ZOO_INFO#log_env#712: Client
environment:zookeeper.version=zookeeper C client 3.4.5
...
2015-12-27
19:17:09,526:1678(0x7f6b1bf7e700):ZOO_ERROR#handle_socket_error_msg#1697:
Socket [127.0.0.1:2181] zk retcode=-4, errno=111(Connection refused): server
refused to accept the client
What can be the source that triggers this error? Is there any other way to get more information?
Thank you in advance for any hints and
with best regards

I'd recommend that you use a recent Mesos version, 0.21.2 is quite old as 0.26.0 is out. There are also precompiled packages available.
Concerning your actual problem, it appears that either
ZooKeeper is not started on the host you're trying to execute your framework on
If you're trying to reach ZK from another host, you need to set the actual IP

Related

Python script on EC2 returns wrong signature type error

I'm coding a discord bot in python. Whenever I try to connect to a specific site, on my EC2 instance running Amazon Linux 2, the script returns the following error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientConnectorSSLError: Cannot connect to host secure.site.here:443 ssl:None [[SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:1076)]
(actual url snipped.)
The bot itself is dockerized, running python:3.7.4-slim-buster. The error is not present when built with image python:3.7.4-slim-stretch.
I've also tested the same script built with base image -buster on MacOS and also a GCP Compute Engine instance, both are error free.
What am I missing? Any tips welcome.
First of all I checked the current tls version used by connection to the site. It was 1.2.
I got same error with wget so I understand that problem not in python itself, but somewhere in openssl and system settings.
On Ubuntu 20.04.1 LTS I upgrade openssl from 1.1.1f to 1.1.1g - it solves the issue for me. I followed this manual.

Docker python requests results in DH KEY TOO SMALL error

I'm trying to setup a python script that uses the requests library to get data from a website. The script works without issues running in a virtual environment on my windows 10 pc or on a azure vm.
However, when I try to create a docker container using the python:3.6-slim image I get DH_KEY_TOO_SMALL errors. Testing the website on ssllabs.com revealed that it supports weak DH key exchange parameters. What could be causing this error and how can I fix it?
I've managed to fix the issue. The problem was caused by openssl versions. Both my windows 10 pc and ubuntu 18.04 vm run an older version that had no problem connecting to the website. The python docker images contain a newer version of openssl that refused to connect.

kazoo restarted zookeeper, the watch threw an exception

My configuration:
zookeeper: 3.4.10
os: ubuntu 16.04
python: 2.7
kazoo: 2.3.1
The code I run in IPython:
When I restarted zookeeper, with bin/zkServer.sh restart, the shell shows the exception as below:
If I delete the watch and replace with a listener, the listener works well.
I don't know why, and I read the info from google and github/kazoo, but I found no explanation of how to solve the problem.
P.S.: Someone said because the session of the client connection expired and was lost, the session_id is not the same with the retry connection when the zookeeper restarts
I believe this is related to a bug that was introduced in 2.3.1 from the following PR:
https://github.com/python-zk/kazoo/pull/305
This is being looked into, and may be rolled back. In the meantime, try using a pre 2.3 version of kazoo.

Accessing SPNEGO authenticated web service from Python on Windows

I am trying to access a REST service that uses Kerberos authentication (company internal) from a Python app on Windows. However, it seems that the service is configured to expect a SPNEGO only as when I try to use requests-kerberos to connect as in:
requests.get('servicename', auth=HTTPKerberosAuth())
it produces a 500 Error from the server with:
javax.servlet.ServletException: GSSException: No credential found for: 1.2.840.113554.1.2.2
My guess is that server is configured to expect SPNEGO only and Python client supports only Kerberos.
I have tried installing PyKerberos but that fails as it expects krb5 on the system and I am doing this under Windows. Are there any libraries available that could help me do a SPNEGO call from Python in Windows?
In case anyone else would be having a similar problem - resolved by using pycurl with pycurl.HTTPAUTH_GSSNEGOTIATE attribute set.

Python Exchange ActiveSync Library

Is anyone familiar with an Exchange ActiveSync library or open source client for python? I've done preliminary searching with little to no success. I've seen some examples for C#, but I figured I'd ask around here before my attempt to port anything over.
In case you're curious. This would be an extension of an already existing linux based IMAP / POP3 client. Moving to Windows / C# this late in the game isn't really an option.
On Debian 9:
apt-get install mercurial python-twisted
hg clone https://bitbucket.org/drspringfield/py-eas-client
cd py-eas-client
python setup.py install
python imap_to_eas_proxy.py --domain example.org --server mail.example.org --device_id myID.example.net
then connect via insecure IMAP to localhost:3143 and log in as normal. (For the Exchange server I was trying to connect to, this just threw Activesync error Connection lost, but it might work on other Exchange servers and/or when py-eas-client is improved.)

Categories