Why do I get "malformed URL" error when performing remote actions using GitKraken in a corporate environment?
Asked Answered
I

4

7

When using GitKraken and attempting to perform remote actions (push/pull/fetch and possibly clone) in my corporate environment I get an error that looks like this:

GitKraken Error

Fetch failed for 'origin'
malformed URL
[Proxy information]

My repository is only accessible internally and the error message above isn't the proper remote. I've verified the proper remote on the local repository via git remote -v. I've also verified this is not a git issue since I can perform all the necessary actions with git via the command line.

My organization's Proxy Auto Configuration (PAC) file is set up properly and returns DIRECT (meaning no proxy) for my remote.

Questions:

  1. Why is GitKraken using a proxy when I haven't configured one?
  2. Why is GitKraken using an external proxy for internal addresses?
  3. How can I resolve this and be able to interact with my remotes?
Inessa answered 13/3, 2017 at 18:22 Comment(1)
I had this problem and I solved it by removing and re-adding the remote repository through the GitKraken UI. I can still interact with the remote with the command line, and I didn't need to change any proxy settings. Using Ubuntu 18.04Wellheeled
I
2

Why is GitKraken using a proxy when I haven't configured one?

GitKraken is automatically pulling proxy configuration from your system's proxy settings (Internet Options > Connections > LAN Settings). In your case it looks like you have configured a PAC file in the "Automatic configuration" section. GitKraken (or one of the libraries it uses) is reading this file and determining how to contact external systems.

Why is GitKraken using an external proxy for internal addresses?

GitKraken (or one of the libraries it uses) appears to be incorrectly assuming proxy settings. When GitKraken starts it connects to its update servers. Before it connects it determines how to connect to it via the PAC file. In this case, you likely use a proxy for external internet access to this connection occurs via your proxy. When you attempt to perform an action on a remote this lookup does not happen again. It incorrectly re-uses the proxy configuration from the update check for internal repositories.

How can I resolve this and be able to interact with my remotes?

You have a few options:

  1. Temporarily disable your proxy configuration when you open GitKraken. You can turn off all proxies via Internet Options > Connections > LAN Settings. Open GitKraken, wait for it to fully start. Turn your proxy settings back on. You should be able to perform actions as normal.
  2. Modify your Proxy Auto Configuration (PAC) file to return DIRECT (no proxy) for the GitKraken update servers. This will "trick" GitKraken into thinking a proxy is not necessary and will not attempt to use it for local traffic. I suggest configuring your PAC file to return DIRECT for the following wildcard: *://*.gitkraken.com/*

For example in the FindProxyForURL function: if (shExpMatch(url, "*://*.gitkraken.com/*")) { return "DIRECT"; }

Note: If your organization has firewalls that prevent direct internet access you may need to take additional care here as this could affect your ability to access public repos such as those at GitHub. You may need to leave proxies on for external repositories and do the #1 option for internal repositories.

Inessa answered 13/3, 2017 at 18:22 Comment(3)
I have the same problem, and sadly neither solution works for me. The environment it is running in does not allow changing the LAN settings, nor modifying the PAC. I suspect that most corporate environments would be similar. So for now I have to use TortioiseGIT for all push/pull operations until GitKraken fixes this issue. Assuming that they do ever fix it...Cisco
Looks like this issue is fixed in version 2.2.1Cisco
GitKraken 6.5.3, same problem, #1 does not work. I don't think I'm able to try #2.Conventual
T
2

To answer your question "why is GitKraken using a proxy when I haven't configured one?" GitKraken on mac uses the global network configurations(Network preferences > Select the network interface > Click Advanced... > and select proxy tab. If you have configured "Automatic Proxy Configuration" or "HTTP" or "HTTPS" proxy settings then that's what gets used.

If you have selected "Auto proxy Discovery" or "Automatic Proxy Configuration" then the "Bypass proxy settings for these hosts & Domains" usually does not work.

How can I make this work? I tried multiple solutions but the one that has worked for me was the following -

I am on GitKraken version 6.5.3. I am working behind proxies as well. GitKraken uses the global ~./gitconfig file and if you have configured the proxies there then it would use that in the absence of other configuration. I had specific settings -

[http]
    sslVerify = true
    proxy = "http://myproxy.com"
[https]
    sslVerify = false
    proxy = "https://myproxy.com"
[http "https://internalurls.com/"]
   sslVerify = false
    proxy = ""

This configuration works for the git command line, and the internal urls are resolved properly, but GitKraken only is using the http and https configurations and not the specific urls configuration. So every time I configure/try to connect to the internal urls I comment out the lines for the general http and https proxies and that has worked for me.

I hope GitKraken in the future gives the users the option to select the proxies or read the entire gitconfig section to search for all the proxies.

I hope this answer helps you.

Tallyman answered 5/3, 2020 at 14:46 Comment(0)
N
0

I guess you use Gitkraken, I had fix this error by enter image description here

go to your local project and using command

git remote add origin [email protected]:your/repo.git

git push -u origin master

Nickienicklaus answered 26/6, 2020 at 5:4 Comment(1)
replace [email protected]:your/repo.git by your repoProud
F
0

I had exactly the same problem and I used these two commands and then restart my system.

git config --global --unset http.proxy

git config --global --unset https.proxy

Festoon answered 6/1, 2022 at 7:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.