How to configure azure-cli behind a corporate proxy on Windows - windows

I'm using Windows 10 behind a corporate proxy and az --version outputs the following:
azure-cli 2.5.1
command-modules-nspkg 2.0.3
core 2.5.1
nspkg 3.0.4
telemetry 1.0.4
...
Unable to check if your CLI is up-to-date. Check your internet connection.
Furthermore, az extension list-available throws:
Unable to get extension index.
Please ensure you have network connection. Error detail: HTTPSConnectionPool(host='aka.ms', port=443): Max retries exceeded with url: /azure-cli-extension-index-v1 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))
How to configure azure-cli for the corporate proxy?

Download local proxy configuration from http://wpad/wpad.dat
At the beginning of the wpad.dat file there is a line similar to CWSProxy="PROXY proxy.corporation.com:8082";
Enter the proxy server to environment variable HTTPS_PROXY, e.g. in bash: export HTTPS_PROXY="proxy.corporation.com:8082"
Now az extension list-available connects. However, for some reason, az --version is still giving Unable to check if your CLI is up-to-date. Check your internet connection. You can now anyway install extensions such as az extension add --name azure-devops.

From https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest&tabs=azure-cli#proxy-blocks-connection
For Windows 10, you could check the proxy settings in the Settings > Network & Internet > Proxy pane. Contact your system administrator for the required settings, or for situations where your machine may be configuration-managed or require advanced setup.

Related

How to totally fix the SSLcertverificationError when using pip?

What happens when I try to install something (pytorch for example) with pip:
'''Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pytorch/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/pytorch/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))) - skipping'''
One way to temporarily avoid this is seting the Use a Proxy Server switch to Off in the Windows Manual Proxy Setup section, but later it will be set back to On automatically.
So what's wrong with the pip or windows? or this Error is related to my vpn?
I think I found the reason!
The reason why the Use a Proxy Server switch automatically changes is my V2rayN had been closed abnormally, so its process continuously changes my settings. To fix this, I just restart V2rayN in administrator mode and quit so that it will manage proxy settings properly.
As to the SSLError, it is because the Proxy switch is on. So after I fix the switch I can use pip to install things again.

gcloud login network connection failed issue

I tried to connect gcloud with gcloud init. I got Network connection error.
I tried to fix with Network connection problems in Google Cloud SDK while I have access to google or website like google app engine in my browser
gcloud config set proxy/type socks5
gcloud config set proxy/address 127.0.0.1
gcloud config set proxy/port 1086
But it still does not work for me.
My log is:
Welcome! This command will take you through the configuration of gcloud.
Settings from your current configuration [default] are:
core:
disable_usage_reporting: 'False'
proxy:
address: 127.0.0.1
port: '1080'
type: socks5
Pick configuration to use:
[1] Re-initialize this configuration [default] with new settings
[2] Create a new configuration
[3] Switch to and re-initialize existing configuration: [cindy]
Please enter your numeric choice: 1
Your current configuration has been set to: [default]
You can skip diagnostics next time by using the following flag:
gcloud init --skip-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
ERROR: Reachability Check failed.
Cannot reach https://www.google.com (error)
Cannot reach https://accounts.google.com (error)
Cannot reach https://cloudresourcemanager.googleapis.com/v1beta1/projects (error)
Cannot reach https://www.googleapis.com/auth/cloud-platform (error)
Cannot reach https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json (error)
Network connection problems may be due to proxy or firewall settings.
Current effective Cloud SDK network proxy settings:
type = socks5
host = 127.0.0.1
port = 1080
username = None
password = None
What would you like to do?
[1] Change Cloud SDK network proxy properties
[2] Clear all gcloud proxy properties
[3] Exit
It is due to redirection from goolge account to localhost for acquiring token Try to login using firefox
Considering the error and mainly the following part of the error, it seems that you are facing issues with your proxy and firewall settings and configuration.
Network connection problems may be due to proxy or firewall settings.
Due to this error, you need to configure your SDK to be used with proxy and firewall. I would recommend you to take a look at the documentation Configuring Cloud SDK for use behind a proxy/firewall, to get more information and steps on how to achieve it and avoid the error that you are facing.
Besides that, I could find the below two posts from the Community, of users that are facing similar cases that you are facing.
ERROR: Reachability Check failed. #51
gcloud utility not working #25
Let me know if the information helped you!
For the people who still have this problem.
Try to use IPV4 first as IPV6 is still buggy for many systems.
For Linux, you can just uncomment or add the following line in /etc/gai.conf file:
precedence ::ffff:0:0/96 100
For other systems, you can google the set-up

Databricks-CLI - ValueError: Timeout value connect was Timeout

I'm setting up secret scope within azure databricks and for that I've installed and configured Databricks-CLI. I'm able to configure databricks tokens.
But, whenever I execute any of the commands on Databricks CLI, I do get following error :
Error: ValueError: Timeout value connect was Timeout(connect=None, read=None, total=None), but it must be an int or float.
Is it anything to do with firewall or network ?
Unfortunately, my terminal was not porting the proxy across. So have to export http and https proxy before connecting to CLI. This resolved the issue.
export http_proxy=http://username:password#proxyhost:port/
export https_proxy=https://username:password#proxyhost:port/
export ftp_proxy=http://username:password#proxyhost:port/
https://askubuntu.com/questions/583797/how-to-set-a-proxy-for-terminal/584183#584183

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;

Can't connect remotely to WAS 8.5 full profile installed on Ubuntu 14.04 from RAD 9.5 installed on OSX

WAS 8.5 full profile isn't officially supported on OSX by IBM so the only option to perform development from OSX is to install stub runtime and connect to WAS installed remotely. I'm trying to install such scenario but something done wrong and can't connect to my WAS.
There's my installation:
On OSX El Capitan Installed:
RAD 9.5 with WAS 8.5 stub runtime (WebSphere Application Server traditional V8.5 stub)
Installed Virtual Box with Ubuntu Desktop edition 14.04
Ubuntu's hostname: anatoly-ubuntu-vm and it's accessible from host, i.e. ping anatoly-ubuntu-vm works fine
On Ubuntu installed:
WAS 8.5 full profile at /opt/IBM/WebSphere
Created AppSrv01 profile at /opt/IBM/WebSphere/AppServer/profiles
WAS installed with root user, IBM Installation Manager required root permission when was started
My connection settings in RAD:
server name: WebSphere Application Server traditional V8.5 stub at anatoly-ubuntu-vm
hostname: anatoly-ubuntu-vm
Runtime environment: WebSphere Application Server traditional V8.5 stub
Connection type:
I've tried RMI 2809 and SOAP 8880 both options didn't work
Enable the server to start remotely is checked and Select the operating system running the remote server: checked Linux option with my username and password. I've tried my regular Ubuntu account and root, both option didn't work.
Server profile path defined as /opt/IBM/WebSphere/AppServer/profiles/AppSrv01
When I try to start server I get the following exception:
The following problems has occurred when starting the server.
CTGRI0001E The application could not establish a connection to
anatoly-ubuntu-vm .
What am I doing wrong?
UPDATE 1:
After I've written this post I've figured out that SSH server isn't installed and configured at all as described here: Requirements for using Remote Execution and Access (RXA) Now, I've installed and it seems like connecting but stuck at 23% at stage Preparing launch delegate, after a while it throw the following error:
The following problems has occurred when starting the server. The
server may not be started in the correct mode. You can restart the
server to desired mode if it is started. CTGRI0075E A file transfer to
or from the system named [anatoly-ubuntu-vm] timed out before the
transfer could complete. The current timeout interval is set to 240000
milliseconds, and might need to be increased.
UPDATE 2:
As I can see despite error message server is started and I even can connect to web console anatoly-ubuntu-vm:9060/console/ibm but it looks that not SOAP connection, neither RMI connection don't work. When I run Test Connection from Settings overview page in RAD, I get the following error:
The connection failed after trying to use all the available connection
types.
Verify the port values are correct and the server has been started. If
the security of the server is enabled, verify the "Security is enabled
on this server" check box is selected, and the user ID and password
are provided. You can specify this in the server editor or when
creating a new server.
For a Technote with details on the most common server connection
problem, see http://www.ibm.com/support/docview.wss?uid=swg21266028.
The last connection attempt failed with the following exception:
ADMC0016E: The system cannot create a SOAP connector to connect to
host anatoly-ubuntu-vm at port 8880.
UPDATE 3
As #DanielBarbarian guessed I tried to run ./wsadmin.sh -port 8880 and it worked and returned
Connected to process "server1" on node anatoly-ubuntu-vmNode01 using SOAP connector; The type of process is: UnManagedProcess`
This is settings of my ports:
UPDATE 4
When I trying to run telnet anatoly-ubuntu-vm 8880 from OSX host I get the following response (ip address changed to non real due to privacy issue):
anatoly-mac:~ anatoly$ telnet anatoly-ubuntu-vm 8880
Trying 192.168.10.10...
Connected to anatoly-ubuntu-vm
Escape character is '^]'.
HTTP/1.1 408 Request Timeout
Content-Type: text/html
Content-Length: 117
Connection: close
<HTML><TITLE>408 - Request Timeout</TITLE><BODY>
<h1>408 Connection timed out while reading request</h1></BODY>
</HTML>Connection closed by foreign host

Resources