question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kubernetes was unable to start: TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"

See original GitHub issue

When installing Rancher Desktop behind a proxy, the following error occurs when k3s starts.

Kubernetes was unable to start: TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"

I am behind a proxy and have the HTTP_PROXY and HTTPS_PROXY variables set. The proxy used by my company is available over β€œhttp” only so both variables are set to something like β€œhttp://my-proxy-url”. I also have values set in the NO_PROXY variable for some internal domains. Does there need to be an additional entry in NO_PROXY for Kubernetes?

Screenshots image

Setup (please complete the following information):

  • OS: Windows 10 Enterprise 10.0.19042 Build 19042
  • Rancher Desktop version 0.6.0-186-g0c32457
  • Kubernetes version: 1.21.5

Snippet from the background.log

Kubernetes was unable to start: TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
    at new ClientRequest (_http_client.js:155:11)
    at TunnelingAgent.request (http.js:50:10)
    at TunnelingAgent.createSocket (C:\Users\myuser\AppData\Local\Programs\Rancher Desktop\resources\app.asar\node_modules\tunnel-agent\index.js:135:25)
    at TunnelingAgent.createSecureSocket [as createSocket] (C:\Users\myuser\AppData\Local\Programs\Rancher Desktop\resources\app.asar\node_modules\tunnel-agent\index.js:200:41)
    at TunnelingAgent.createConnection (C:\Users\myuser\AppData\Local\Programs\Rancher Desktop\resources\app.asar\node_modules\tunnel-agent\index.js:98:8)
    at TunnelingAgent.addRequest (C:\Users\myuser\AppData\Local\Programs\Rancher Desktop\resources\app.asar\node_modules\tunnel-agent\index.js:92:8)
    at new ClientRequest (_http_client.js:306:16)
    at Object.request (https.js:313:10)
    at Request.start (C:\Users\myuser\AppData\Local\Programs\Rancher Desktop\resources\app.asar\node_modules\request\request.js:751:32)
    at Request.end (C:\Users\myuser\AppData\Local\Programs\Rancher Desktop\resources\app.asar\node_modules\request\request.js:1505:10) {
  code: 'ERR_INVALID_PROTOCOL'
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:20 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ripuncommented, Oct 11, 2022

Is there any update on this issue , how to make k3s/k8s work in RD behind http_proxy ?

1reaction
Nino-Kcommented, Aug 15, 2022

The core of the problem is the underlying process (electron app) is mismanaging the HTTP(s)_PROXY environment variable by making HTTP calls to the proxy where upstream requires HTTPS and vice versa. We will try to set up an environment to reproduce this. Once it is reproduced we will have a better idea of tackling it.

Below are the scenarios to consider when tackling this issue:

Electron App β€”----- http β€”----- proxy β€”----- http β€”----- upstream
Electron App β€”----- https β€”----- proxy β€”----- https β€”----- upstream
Electron App β€”----- https β€”----- proxy β€”----- http β€”----- upstream
Electron App β€”----- http β€”----- proxy β€”----- https β€”----- upstream
Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js TypeError [ERR_INVALID_PROTOCOL]: Protocol "http ...
The problem with the code is that you are making https request and in your url you are using "http" instead of "https"...
Read more >
Protocol "http:" not supported. Expected "https:"
In my application when I try to login with Auth0, I get the following error and the login fails. Protocol "http:" not supported....
Read more >
Troubleshooting kubeadm | Kubernetes
Troubleshooting kubeadm. As with any program, you might run into an error installing or running kubeadm. This page lists some common failure ......
Read more >
Jobs | Kubernetes
Keep in mind that the restartPolicy applies to the Pod, and not to the Job itself: there is no automatic Job restart once...
Read more >
ReplicationController - Kubernetes
If you do not specify .spec.replicas , then it defaults to 1. Working with ReplicationControllers. Deleting a ReplicationController and its Pods.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found