pip ConnectTimeoutError - proxy

When trying to install something using pip I am getting a ConnectTimeoutError error !
For example, when I try:
pip install 'something'
The following error occurs:
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(, 'Connection to 'some dev server' timed out. (connect timeout=15)')': /.../.../
Is my pip behind some proxy?

To clarify, by default pip installs software from https://pypi.python.org/pypi. However, pip can be configured to use a different server.
It seems like you are not able to reach the PyPI server that your pip is trying to use. In your error message you have the string 'Connection to 'some dev server' timed out.. If I see that correctly, your pip is trying to connect to a local PyPI server instead of the public one.
This post and this one describe how to set up a custom PyPI server. Both describe different ways to tell pip which server to use.
.pip/pip.conf
In this config file you can specify an index-url which points to a custom server. Check if this file exists and has a value for index-url that does not point to https://pypi.python.org/pypi. The example given in the first post looks like this:
[global]
index-url = https://pip.curle.io/simple/
This tells pip to not use the public PyPI server, but the one at https://pip.curle.io/simple/.
.pypirc
This file that should sit in your home folder can also contain alternative paths to PyPI servers. They can look like this (taken from second link):
[distutils]
index-servers =
internal
[internal]
repository: https://pypi.myserver.com/
username: username
password: password
This one points to the local server https://pypi.myserver.com/ under the name internal. Check if this file is present and its content.
What to do?
If you find the local PyPI server, find out who runs it and if it is currently running. This error can arise if the server process stopped or the machine it usually runs on is down. Any advice more specific than that would require more information from your side on your work environment.

Related

Can't get pyperclip on Anaconda (Python 3.7)

I've tried
conda install -c conda-forge pyperclip
and get the following error:
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/noarch/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/noarch/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))
I've also try to download pyperclip-1.7.0.tar.gz, unzip it (the folder is pyperclip-1.7.0) and copy it to multiple folders (e.g. ...\Continuum\anaconda3\Scripts and ...\Continuum\anaconda3\Lib)
but when I try to import it, I get a "ModuleNotFoundError: No module named 'pyperclip'" message
pip install pyperclip
worked from the Anaconda prompt (I was using CMD)

Phusion Passenger Enterprise fails to connect to the licensing server behind a proxy

We're trying to upgrade to Phusion Passenger Enterprise edition from the open source version but we're running into an issue. Passenger fails to connect to the licensing server with the following error message:
[ W 2018-03-27 10:20:55.2565 35498/T6 age/Cor/CloudUsageTracker.h:439 ]: Could not contact the Phusion Passenger Enterprise licensing server (HTTP error: Failed to connect to www.phusionpassenger.com port 443: Connection timed out). To ensure proper access to the licensing server, please try these:
- Ensure that your network connection to https://www.phusionpassenger.com works.
- If you can only access https://www.phusionpassenger.com via a proxy, please set the config option 'PassengerCtl licensing_proxy PROXY_URL' (Apache) or 'passenger_ctl licensing_proxy PROXY_URL' (Nginx). 'PROXY_URL' takes the format of protocol://username:password#hostname:port, where 'protocol' is either 'http' or 'socks5'.
We need to use a proxy for all outgoing HTTP connections, so I have added the recommended config option:
passenger_ctl licensing_proxy http://OURPROXY:3128;
However the issue persist with the same error message.
Using curl to hit this URL through the proxy works as expected:
$ curl -x http://OURPROXY:3128 https://www.phusionpassenger.com
We are using nginx with Passenger on Ubuntu 14.04 LTS, Passenger Enterprise is installed from the official APT repository.
What could be causing this error? Any help would be much appreciated.
I have received an answer to this question from the Phusion Passenger support. They had accidentally misspelled the name of the relevant config option in the error message.
The correct way to set this option is:
passenger_ctl licensing_proxy_url http://OURPROXY:3128;
Related to this question, if you want Passenger to check for security updates behind a proxy, you will also need to set that separately:
passenger_security_update_check_proxy http://OURPROXY:3128;

Unable to login heroku

I was using GIT BASH to connect with the Heroku server, I have successfully logged into the heroku website and downloaded Heroku Toolbelt 3.2.0 for windows. When i tried to log in using the GIT Bash it throws me the error message.
Error: A socket operation was attempted to an unreachable host. - connect(2) (Errno::EHOSTUNREACH) (Excon::Errors::Socket
I tried to update the proxy setting using,
set HTTP_PROXY=:http//%username%:%password%#%SERVER%:%PORT%
and using
export HTTP_PROXY='http://user:pass#proxy:port'
After setting this proxy when i tried to log in it throws an error message saying,
Error: getaddrinfo: No such host is known. (SocketError) (Excon::Errors::SocketError)
git bash doesn't seem like a valid command. Are you trying to connect to the Heroku dyno to play around with the environment? If so, you should try: heroku run bash.
When I tried using the export command with the following parameters the issue gets resolved.
The export command were:
export HTTP_PROXY="http://SERVER:PORT"
and
export HTTPS_PROXY="https://SERVER:PORT"

Why is Brew installed postgres looking here?

Why is brew installed postgres looking for /tmp/.s.PGSQL.5432 when I specified /var/pgsql_socket (unix_socket_directory = '/var/pgsql_socket') in my postgresql.conf?
Install was successful. I can start and stop Pg successfully.
My PATH and PGHOST env vars seem to be set up correctly, but when I try psql, I cannot connect?
PATH="/usr/local/bin:$PATH"
PGHOST="/var/pgsql_socket"
Any ideas? I've read 1000 posts, and nothing seems to fit my situation and provide a fix?
Changing the unix_socket_directory in postgresql.conf only affects where the server puts the socket directory. postgresql.conf isn't readable by clients, and clients can't ask the server about settings until they can connect, so a chicken-and-egg problem prevents the client asking the server how to connect.
You need to tell psql where the socket directory is. It appears you've already done this with pghost, so my guess is that you haven't exported the environment variables:
export PGHOST="/var/pgsql_socket"
or
psql -h /var/pgsql_socket

Git ssh connection refused with the following format

Whenever I use the following
url = ssh://user#dev.example.com:imageInfo.git
in .git/config for a remote repo I get the following error
ssh: connect to host port 22: Connection refused
fatal: The remote end hung up unexpectedly
but if use the following
ssh user#dev.example.com
outside of git I connect without a problem.
Git also connects to same server with a gitosis user using
url = gitosis#dev.example.com:imageInfo.git
in .git/config and it has not problems.
so to sum things up in short my .git/config file looks like this
[remote "production"]
url = ssh://user#dev.example.com:imageInfo.git
url = gitosis#dev.example.com:imageInfo.git
any ideas?
You have the format of the SSH URL wrong - you can either use the scp-style syntax, like:
user#dev.example.com:imageInfo.git
... or the true URL form, where you need a / after the host rather than a :, and an absolute path, which I can only guess at, e.g.:
ssh://user#dev.example.com/srv/git/imageInfo.git
The documentation for git's URLs is here, but kernel.org is down at the moment, so you may want to look at the cached version here.
I got this message due to not having sshd daemon installed and running. So I did 'sudo apt-get install ssh' and the issue was solved.

Resources