Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_MANDATORY_PROXY_CONFIGURATION_FAILED #1474

Closed
Benzxx opened this Issue May 15, 2018 · 37 comments

Comments

Projects
None yet
@Benzxx
Copy link

Benzxx commented May 15, 2018

SwitchyOmega used to work well with chrome, not sure why auto switch can't work recently, always get error ERR_MANDATORY_PROXY_CONFIGURATION_FAILED. If force use the proxy for all URLs, it works well.

Google Chrome is up to date
Version 66.0.3359.170 (Official Build) (64-bit)

image

@lewixliu

This comment has been minimized.

Copy link

lewixliu commented May 17, 2018

遇到了同样的问题,
直接使用代理服务器或直接连接可以访问网页,
但自动切换或PAC模式会出现ERR_MANDATORY_PROXY_CONFIGURATION_FAILED。
最简单的PAC脚本也会出现问题:
function FindProxyForURL(url, host) {
return "DIRECT";
}

@FelisCatus

This comment has been minimized.

Copy link
Owner

FelisCatus commented Jun 10, 2018

@Benzxx @lewixliu Thanks for the report. When it happens again, could you please right-click on the SwitchyOmega icon and select "Save error log"? The log would be very helpful to debug the issue.

Also, could you please also go to the "Auto Switch" on options page, and click on "Export PAC" on the top-right? I can try to see why the PAC file fails. Please note that the PAC file can contain switching rules and the address of your proxy server though. Feel free to change a few strings (but not the structure) to protect your privacy before publishing it here.

@FelisCatus

This comment has been minimized.

Copy link
Owner

FelisCatus commented Jun 10, 2018

I can't reproduce this on Chrome 66.0.3359.181 on Linux. I'll try to update Chromium and try again, but I'd appreciate it if someone can just drop me a PAC export of their Auto Switch profile. Without it, there is no way that I can tell how the PAC script has failed.

@lewixliu

This comment has been minimized.

Copy link

lewixliu commented Jun 10, 2018

Desktop.zip

OmegaLog_1528599285100.txt

Some logs for your reference. Those are the logs from "chrome://net-internals"

The PAC is very simple.
function FindProxyForURL(url, host) {
return "PROXY secure-proxy1.test_url.com:8080";
}

@lewixliu

This comment has been minimized.

Copy link

lewixliu commented Jun 10, 2018

Chrome version: Google Chrome 已是最新版本 版本 67.0.3396.79(正式版本) (64 位)
OS version: Windows 10 1709 build 16299.431
SwitchyOmega: version 2.5.9

@FelisCatus

This comment has been minimized.

Copy link
Owner

FelisCatus commented Jun 10, 2018

@lewixliu Still can't reproduce this. One thing though, could you please try this without SwitchyOmega?

Something like chrome --proxy-pac-url="file:///home/foobar/tmp/myscript.js" (please replace the path with an actual path to a local PAC file containing the exact same thing.) Also, try with chrome --proxy-pac-url="data:..." (the same data URI as you observe on chrome://net-internals#proxy)

For me, it is showing proxy connection failed, which is the correct behavior.

@FelisCatus

This comment has been minimized.

Copy link
Owner

FelisCatus commented Jun 10, 2018

Note, without SwitchyOmega, Chrome will probably give up on the proxy script and fall back to direct connection instead. So, please use a fake proxy and make sure you see the "proxy connection failed" error message instead of a successful connection.

@lewixliu

This comment has been minimized.

Copy link

lewixliu commented Jun 10, 2018

Fall back to direct connection on the both proxy-pac-url settings no matter true or fake proxies.
Observed the same event.

t=11458 [st= 0] +HTTP_STREAM_JOB_CONTROLLER [dt=28]
--> is_preconnect = true
--> url = "https://some.url/"
t=11458 [st= 0] +PROXY_RESOLUTION_SERVICE [dt=27]
t=11458 [st= 0] SUBMITTED_TO_RESOLVER_THREAD
--> thread_number = 0
t=11485 [st=27] PROXY_RESOLUTION_SERVICE_RESOLVED_PROXY_LIST
--> net_error = -326 (ERR_PAC_STATUS_NOT_OK)
t=11485 [st=27] -PROXY_RESOLUTION_SERVICE
t=11485 [st=27] HTTP_STREAM_JOB_CONTROLLER_PROXY_SERVER_RESOLVED
--> proxy_server = "DIRECT"
t=11485 [st=27] HTTP_STREAM_REQUEST_STARTED_JOB
--> source_dependency = 1096 (HTTP_STREAM_JOB)
t=11486 [st=28] -HTTP_STREAM_JOB_CONTROLLER

@FelisCatus

This comment has been minimized.

Copy link
Owner

FelisCatus commented Jun 10, 2018

@lewixliu In that case, I'd suggest creating an issue on the Chromium issue tracker. SwitchyOmega is unrelated here, except that SwitchyOmega sets the PAC script to mandatory, preventing Chromium to fall back to direct.

@lewixliu

This comment has been minimized.

Copy link

lewixliu commented Jun 10, 2018

Thank you!

@Zprince2000

This comment has been minimized.

Copy link

Zprince2000 commented Jun 10, 2018

@lewixliu, could you let me know where do you post the issue to Chromium? I am experiencing the same problem.

@lewixliu

This comment has been minimized.

@Zprince2000

This comment has been minimized.

Copy link

Zprince2000 commented Jun 11, 2018

@lewixliu , thanks.

@lewixliu

This comment has been minimized.

Copy link

lewixliu commented Jun 13, 2018

Seems it destn't work for --proxy-pac-url setting "file:///xxx" and "data:...", but works for "http://ip/xx.pac".
So here's a workaround, which cannot update web page list automatically.

  1. export the pac script file.
  2. run a web server, and put the pac file in web server.
  3. disable the extension or switch to system setting.
  4. run with: chrome --proxy-pac-url="http://ip/xx.pac"
    I tried the workaround on one PC, it works, but didn't try more.

@FelisCatus, If "--proxy-pac-url" not support "data:..." any more, it there other way to set proxy?

@FelisCatus

This comment has been minimized.

Copy link
Owner

FelisCatus commented Jun 13, 2018

@lewixliu I don't quite get it either, but you should probably just ask on the Chromium issue. eroman is the expert there.

I guess they meant that you should remove the --winhttp-proxy-resolver flag. Do you have it enabled in the chrome://flags page? If so, try disabling that before you move forward.

@lewixliu

This comment has been minimized.

Copy link

lewixliu commented Jun 13, 2018

I don't know where the --winhttp-proxy-resolver flag come frome. I tested on a new downloaded Canary version chrome and didn't set anything except --proxy-pac-url="file:///c:/a.pac".

@ericroman920

This comment has been minimized.

Copy link

ericroman920 commented Jun 13, 2018

Hi, this is eroman@chromium.org.

The issue is that when Chrome is run with --winhttp-proxy-resolver it uses WinHTTP for proxy resolving, which supports neither data: or file://. This command line is not supported in Chrome, and exists only as a debugging tool / fallback for some historical issues.

To fix your problem, you need to remove --winhttp-proxy-resolver from the command line. Is it possible that you added this command line switch in the past and simply forgot about it? To remove it, find the shortcut that you clicked on to launch Chrome (probably on the desktop). Right click on it and choose "Properties". Then in the "Target" input you can modify the command line parameters.

@ericroman920

This comment has been minimized.

Copy link

ericroman920 commented Jun 13, 2018

Some other debugging techniques you can try are:

Launch Chrome from cmd.exe rather than the shell, by running cmd.exe and then executing a command like:

"C:\path\to\chrome.exe" --proxy-pac-url="file:///c:/a.pac"

To confirm what the command line switches are the easiest is Process Explorer. If you right click on chrome.exe and go to the "Image tab" it will show the command line.

My expectation is you simply have a shortcut with the switch, so this is an easy fix. But it is also possible you have malware that is adding the switch for some reason, when launched through the shell. Seems unlikely, but I have seen that happen before for different command line switches.

@JohnDowson

This comment has been minimized.

Copy link

JohnDowson commented Jun 18, 2018

@wangofjian

This comment has been minimized.

Copy link

wangofjian commented Jun 25, 2018

My chrome start with the para --winhttp-proxy-resolver,but the SwitchyOmega auto_switch mode cannot work ,the error message is ERR_MANDATORY_PROXY_CONFIGURATION_FAILED.maybe the pac file broken or chrome bugs.
I changed fiename C:\Program Files (x86)\Google\Chrome\Application\chrome.exe to other ,such chromemaster.exe ,then started ,SwitchyOmega auto_switch worked fine.

@mu-yu

This comment has been minimized.

Copy link

mu-yu commented Jul 10, 2018

My autoSwitch doesn't working anymore today suddenly. I doesn't do anything with chrome or SwitchyOmega before it was broken, but it just happened.
I have tried to reinstall chrome or SwitchyOmega,but it still not working.

@alswl

This comment has been minimized.

Copy link

alswl commented Jul 14, 2018

open /Applications/Google\ Chrome.app --args --proxy-pac-url="http://127.0.0.1:8000/OmegaProfile_Auto_Switch_2.pac" works well for me.
But use extension Auto Switch mode did not works.

Chrome: Version 68.0.3440.59 (Official Build) beta (64-bit)
Extension: 2.5.15
macOS: 10.13.5 (17F77)

My request to https//www.baidu.com event log:

4368: HTTP_STREAM_JOB_CONTROLLER
http://www.baidu.com/
Start Time: 2018-07-14 14:29:02.266

t=4164 [st=   0] +HTTP_STREAM_JOB_CONTROLLER  [dt=2037]
                  --> is_preconnect = false
                  --> url = "http://www.baidu.com/"
t=4164 [st=   0]    HTTP_STREAM_JOB_CONTROLLER_BOUND
                    --> source_dependency = 4366 (URL_REQUEST)
t=4164 [st=   0]   +PROXY_RESOLUTION_SERVICE  [dt=2037]
t=4167 [st=   3]      PROXY_RESOLUTION_SERVICE_WAITING_FOR_INIT_PAC  [dt=0]
t=4167 [st=   3]      SUBMITTED_TO_RESOLVER_THREAD
                      --> thread_number = 0
t=6201 [st=2037]      PROXY_RESOLUTION_SERVICE_RESOLVED_PROXY_LIST
                      --> net_error = -2 (ERR_FAILED)
t=6201 [st=2037]   -PROXY_RESOLUTION_SERVICE
t=6201 [st=2037]    HTTP_STREAM_JOB_CONTROLLER_PROXY_SERVER_RESOLVED
                    --> proxy_server = ""
t=6201 [st=2037] -HTTP_STREAM_JOB_CONTROLLER

It SHOULD NOT use any proxy_server.

Now I use --proxy-pac-url instead of SwitchyOmega.

@FelisCatus

This comment has been minimized.

Copy link
Owner

FelisCatus commented Jul 18, 2018

@alswl This is probably caused by errors thrown by the PAC script. By default, Chrome will fall back to direct connection if PAC script throws, but SwitchyOmega would disable that behavior, to prevent hiding errors or accidentally leaking requests. I'd love to help debugging this if you can upload the PAC file in question.

@alswl

This comment has been minimized.

Copy link

alswl commented Jul 19, 2018

After two days, the Auto Switch mode works again. 😂

  • Chrome: Version 68.0.3440.68 (Official Build) beta (64-bit)
  • SwitchyOmega: 2.5.15
  • macOS: 10.13.6 (17G65)

It seems the Chrome version changed, and macOS version changed.

@Benzxx

This comment has been minimized.

Copy link
Author

Benzxx commented Jul 31, 2018

OmegaLog.zip
Chrome update to Version 68.0.3440.75 (Official Build) (64-bit), the issue is still there. @FelisCatus

@FelisCatus

This comment has been minimized.

Copy link
Owner

FelisCatus commented Aug 2, 2018

@Benzxx The PAC file looks valid. Please try this without SwitchyOmega and see if it works (as described above). If not, please file an issue on chromium.

@ericroman920

This comment has been minimized.

Copy link

ericroman920 commented Aug 2, 2018

Do you have Forcepoint Endpoint installed?

We have found that Forcepoint adds the --winhttp-proxy-resolver command line flag to chrome.exe, which in turn causes the problems with SwitchyOmega diagnosed earlier in this thread.

@alswl

This comment has been minimized.

Copy link

alswl commented Aug 2, 2018

@ericroman920 I have Forcepoint Endpoint.

@mu-yu

This comment has been minimized.

Copy link

mu-yu commented Aug 2, 2018

@ericroman920 ERR_MANDATORY_PROXY_CONFIGURATION_FAILED happened after Forcepoint Endpoint was installed by system adminstrator. So do you know how to fix this problem?

@ericroman920

This comment has been minimized.

Copy link

ericroman920 commented Aug 2, 2018

The only current fix I am aware of is uninstalling Endpoint.

My recommendation is to file an issue with Forcepoint and ask them to remove their use of --winhttp-proxy-resolver.

You can point them to this Chromium bug for more information, as the flag is unsupported by Chromium and has a variety of issues. Hopefully Forcepoint can push out an update to resolve this.

@mu-yu

This comment has been minimized.

Copy link

mu-yu commented Aug 3, 2018

Endpoint is deployed by IT department and cann't be uninstalled, wtf. Hope chrome will fix this sooner.

@alswl

This comment has been minimized.

@mu-yu

This comment has been minimized.

Copy link

mu-yu commented Aug 3, 2018

Uninstal the extension didn't resolve the problem, and it will be reinstalled after system reboot.

@FelisCatus FelisCatus closed this Aug 13, 2018

@bostjan

This comment has been minimized.

Copy link

bostjan commented Aug 21, 2018

I've fixed this issue in a totally unrelated context - it was a PAC file permission issue. In my case (Linux system), only root was able to read the file and the browser was (of course) not running under the root username.

@stamhe

This comment has been minimized.

Copy link

stamhe commented Nov 24, 2018

My SwitchyOmega doesn't working anymore today suddenly. I have tried to reinstall chrome or SwitchyOmega,but it still not working. The same error "ERR_MANDATORY_PROXY_CONFIGURATION_FAILED". But it works fine in DIRECT and Proxy mode.

mac os: 10.13.6 (17G3025)
chrome: 版本 70.0.3538.110(正式版本) (64 位)
switchyomega: 2.5.20
OmegaLog_3.txt
OmegaProfile__pac_3.txt

Someone could help me ???

@pendulm

This comment has been minimized.

Copy link

pendulm commented Nov 26, 2018

I've try reinstall chrome and SwitchyOmega, the issue still been there. I also have DLP installed on my Macbook, and it breaks the pac proxy suddenly.

I just uninstall chrome and just use chromium, and no problem found.

I've no idea how DLP impact on chrome's proxy. but I think chromium should be safe and the IT guys should fix this problem.

@xizhendu

This comment has been minimized.

Copy link

xizhendu commented Mar 13, 2019

Got same issue with chrome Version 72.0.3626.121 (Official Build) (64-bit) on Mac.
For my use case replacing pac url "file:///" with "http://" fixed my pain.
Thanks @lewixliu the post helped a lot, #1474 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.