PyCharm cannot use interpreter in local docker-machine - docker

I am using windows 10 professional and I have installed docker using DockerToolBox, so I have a docker-machine running in VirtualBox. When trying to configure an interpreter in PyCharm using my docker-machine, I get the following error:
"Cannot connect: java.lang.NullPointerException: uri was not specified"
docker-machine error
When I choose 'TCP socket', I get the following error which is different from above:
"Cannot connect: java.io.IOException: Channel disconnected before any data was received"
TCP socket error
I am sure my docker-machine is running because I can connect to it using terminal tools like MobaXterm or XShell, and I can also connect to MySQL running in my docker-machine.

Replacing tcp:// by https:// in the api url works for me in Webstorm (Windows 8.1).
https://github.com/kubernetes/minikube/issues/580

I have tried thousands of methods, and finally resolved this problem. The solution is running pycharm as administrator. WTF

I have same issue.
You must check Pycharm logs. There is detailed information about error.
In my case Pycharm shows same error "Channel disconnected before any data was received".
But in logs i found that error is caused by:
"ERROR - HttpResponseStreamHandlerFixed - exceptionCaught before first read or disconnect, we may be hanging
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: No name matching "my_server_hostname" found"
In my case, the problem was that domain name that i connecting to is in not the same as hostname in SSL self signed cert installed in dockerd.
Domain name that you are connecting to must match domain name in SSL cert that dockerd uses.
I have to make hosts record (C:\Windows\System32\drivers\etc\hosts on Windows, and /etc/hosts on Linux) and connect to it.
And "https://" protocol is required :)
PS. You can check SSL cert hostname by opening Chrome browser to the docker API endpoint with https and opening certificate details.

Related

When connecting to owncloud i get 'You are accessing the server from an untrusted domain'

Just installed owncloud using the instructions in https://doc.owncloud.com/server/next/admin_manual/installation/docker/ and when I try to connect to the server from my machine I get the following error message...
You are accessing the server from an untrusted domain.
Please contact your administrator. If you are an administrator of this instance, configure the "trusted_domains" setting in config/config.php. An example configuration is provided in config/config.sample.php or at the documentation.
IK what the error message means and how I would normally fix it in a standard apache setup, but how do I change these in the docker images?
I tried changing the line OWNCLOUD_TRUSTED_DOMAINS in the .env file to a wildcard (originally it said localhost) and that did not help.

VSCode remote-containers.attachTorunningContainerFromViewlet error

I'm using Remote-SSH to connect to a remote, and then Attach Visual Studio Code on the remote host gives me an error.
[2022-01-12 16:59:07.497] [exthost] [error] Shell server terminated (code: 255, signal: null)
enter code here
ssh: Could not resolve hostname local-88-centos0-frp: No such host is known.
remote-containers.attachToRunningContainerFromViewlet {"value":"ms-vscode-remote.remote-containers","_lower":"ms-vscode-remote.remote-containers"}
I also met this problem on my computer when I tried to connect our lab server:
But others' computers didn't pop up this error when they tried to connect to remote-containers.
Shell server terminated (code: 255, signal: null)
ssh: connect to host xxx.xxx.xxx.xx port 22: Connection refused
OK finally I find the solution, it maybe a bug on vscode Remote - SSH extension.
click extension
click Remote-SSH and right click setting
find Remote.SSH: Config File (The absolute file path to a custom SSH config file.)
please leave this setting empty and it is the default at .ssh/config, please modify at there but no input here.
Then I found my problem solved.... Hope it's can help people who met same problem as I did.

Connection Error in Guacamole: The remote desktop server is currently unavailable. If the problem persists, please notify your system administrator

I am trying to setup up guacamole in a Digital Ocean Droplet (Ubuntu 18.04). I followed the steps provided in https://computingforgeeks.com/install-and-use-guacamole-on-ubuntu/ to setup guacamole and used Postgresql to authenticate guacamole by following the instructions provided in https://guacamole.apache.org/doc/gug/jdbc-auth.html#idm46227496294336.
The installation got over and I am able to access the webpage at http://droplet-ip:8080/guacamole, but when I try to connect to a remote machine over RDP I get a connection error stating 'The remote desktop server is currently unavailable. If the problem persists, please notify your system administrator, or check your system logs.'
I have checked the login credentials of the remote device, it's hostip and RDP port number, everything is correct. I am able to login to the machine through Remote Desktop Connection in Windows. I can also login to the same remote machine with same credentials in a perfectly working guacamole setup in another digitalocean droplet.
I have also tried this by installing guacamole using docker by following instructions provided in https://wiki.networksecuritytoolkit.org/index.php/HowTo_Setup_Guacamole, but still face the same problem. What am I doing wrong? I would be happy if someone could help me solve this problem
I was finally able to figure out why I was not able to connect to a remote device in Guacamole.
My Digital Ocean Linux droplets had freeRDP already installed. But Guacamole Server 1.3.0 works on freeRDP2. I had to make Guacamole send requests through freeRDP2.
I have enabled SFTP in the connection settings. But somehow the OpenSSH was corrupted in the remote machine resulting in connection error. So, I disabled SFTP. I think guacamole tries to establish RDP and SFTP connection in the very beginning, so even if one of the protocols fail, connection cannot be established. I am not proficient with guacamole so not sure with this point.
After resolving these problems, guacamole was able to send connection request to the remote machine. I checked the status using netstat and the status was SYN_SENT, but there was no response from the remote server. The problem was Firewall.
I allowed the ports for RDP in windows firewall, but the remote machine was in a network which had external firewall. I added the Guacamole Server IP in allowed list for NAT forwarding in the firewall device and finally I was able to establish a connection with the remote machine.

ECONNREFUSED 127.0.0.1:80 when connecting to remote Docker with Visual Studio Code

I want to develop code inside a container on a remote Docker host with VS Code, but I cannot connect to Docker on the remote machine via SSH (ECONNREFUSED 127.0.0.1:80).
Following the VS Code instructions to use a SSH tunnel (https://code.visualstudio.com/docs/remote/containers-advanced#_option-2-connect-using-an-ssh-tunnel) I got this error:
"Unable to connect to Docker. Please make sure you have installed
Docker and that it is running. Details: connect ECONNREFUSED
127.0.0.1:80"
I started VS Code (Windows 10), updated the docker.host (File->Preferences) property to:
{
"docker.host":"tcp://localhost:23750"
}
and ran:
ssh -NL localhost:23750:/var/run/docker.sock user#hostname
It looked like established the tunnel successfully. I run Docker on a virtual machine (centOS).
When I opened the Docker view and expanded the Containers node in the explorer I got the above mentioned error. To me it looks like VS Code tries to connect to port 80 but I specified port 23750 in the settings. How can I successfully connect to the remote host?
I found a fix here: https://github.com/microsoft/vscode-docker/issues/580
Remove the prefix tcp:// from the docker.host settings, e.g.:
"docker.host": "localhost:23750"
I know that this question is old but for anyone still looking for options I solved a similar issue on my computer using IPv6.
So in your case:
{
"docker.host":"tcp://[::1]:23750"
}
I configured the host on the environment variable DOCKER_HOST.

Docker Kitematic connect ETIMEDOUT error

Starting Kitematic on Windows 10 gives me this error
Error: connect ETIMEDOUT 198.105.254.24:2375
I'm already running 'default' vm in VirtualBox. The only way to start Kitematic is to hit the 'USE VIRTUALBOX' button.
Why won't Kitematic start unless I click 'USE VIRTUALBOX' button? I've already got VirtualBox running the 'default' vm successfully...
I commented on the docker / kitematic Github issues page and one of the participants told me to simply click USE VIRTUALBOX button to use VirtualBox on Windows since they are in favor of Docker for Windows.
https://github.com/docker/kitematic/issues/1029#issuecomment-226974739
You can turn off Hyper-V in your system, then reboot and click run VirtualBox next time.
I faced the same error. Below solution worked for me:
Deleted the folder C:\Users\{Account_name}\.docker
Clicked on the "Retry setup" button on Kitematic. It re-created C:\Users\{Account_name}\.docker with a new default machine. Error : connect ETIMEDOUT 192.168.xxx.xxx:2376 disappeared but faced new error: C:\Users\{Account_name}\.docker\machine\machines\default\ca.pem does not exist
Copied all certificate files from C:\Users\{Account_name}\.docker\machine\certs to C:\Users\{Account_name}\.docker\machine\machines\default. Then I got error
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.xxx.xxx:2376"
Regenerated certificates for default machine by running below command on Command Prompt.
docker-machine regenerate-certs default
It showed below output:
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
After this, I was able to access default machine through Kitematic GUI. I figured that issue was due to TLS connection and these steps fixed it.

Resources