{"record":{"id":"65208e4741c227e8","repo":"XX-net/XX-Net","slug":"helper-failed-r-please-manually-reset-proxy-sett","errorCode":null,"errorMessage":"helper failed:%r, please manually reset proxy settings after switching connection","messagePattern":"helper failed:%r, please manually reset proxy settings after switching connection","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/launcher/mac_tray.py","lineNumber":426,"sourceCode":"        if proxy_setting == \"pac\" and config.enable_smart_router:\n            helperDisableGlobalProxy(currentService)\n            helperEnableAutoProxy(currentService)\n        elif proxy_setting == \"gae\" and config.enable_gae_proxy:\n            helperDisableAutoProxy(currentService)\n            helperEnableGlobalProxy(currentService)\n        elif proxy_setting == \"x_tunnel\" and config.enable_x_tunnel:\n            helperDisableAutoProxy(currentService)\n            helperEnableXTunnelProxy(currentService)\n        elif proxy_setting == \"smart_router\" and config.enable_smart_router:\n            helperDisableAutoProxy(currentService)\n            helperEnableSmartRouterProxy(currentService)\n        else:\n            helperDisableAutoProxy(currentService)\n            helperDisableGlobalProxy(currentService)\n        # else:\n        #     xlog.warn(\"proxy_setting:%r\", proxy_setting)\n    except Exception as e:\n        xlog.warn(\"helper failed:%r, please manually reset proxy settings after switching connection\", e)\n\n\nsys_tray = MacTrayObject.alloc().init()\ncurrentService = None\n\n\ndef fetchCurrentService(protocol):\n    global currentService\n    status = SystemConfiguration.SCDynamicStoreCopyValue(None, \"State:/Network/Global/\" + protocol)\n    if not status:\n        currentService = None\n        return\n    serviceID = status['PrimaryService']\n    service = SystemConfiguration.SCDynamicStoreCopyValue(None, \"Setup:/Network/Service/\" + serviceID)\n    if not service:\n        currentService = None\n        return\n    currentService = service['UserDefinedName']","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/launcher/mac_tray.py#L408-L444","documentation":"This warning is emitted by MacTrayObject.loadConfig when the PyObjC helper calls to enable/disable the system proxy (e.g. helperSetPac / helperDisableAutoProxy / helperDisableGlobalProxy) raise an exception while a network change is being processed. The launcher catches the exception so the app keeps running, but the macOS proxy settings may now be stale or left pointing at the old connection.","triggerScenarios":"Calling loadConfig via applicationDidFinishLaunching_ or the networkChanged callback on macOS; any exception thrown by the PyObjC-backed helper functions that manipulate network location proxy settings (helper not installed, missing privileges, NSException from SystemConfiguration APIs).","commonSituations":"Switching Wi-Fi networks or docking/undocking Ethernet while the launcher runs; PyObjC or the xxnet_helper privilege helper not properly installed; macOS SystemConfiguration refusing the change due to a profile/MDM lock.","solutions":["Reinstall/repair the privilege helper and PyObjC: sudo pip3 install -U PyObjC, then restart the launcher","Manually reset the proxy: System Settings -> Network -> Advanced -> Proxies, turn off the Web/Secure Proxy or PAC the launcher set","Check the launcher log for the underlying %r exception to identify which helper call failed","If it recurs on every network change, remove and re-grant the helper's authorization (re-run the helper install step)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import subprocess\ndef helper_available():\n    try:\n        subprocess.run(['networksetup','-getwebproxy','Wi-Fi'], capture_output=True, timeout=5)\n        return True\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    apply_proxy_settings()\nexcept Exception as e:\n    log.warning('helper failed: %r; resetting proxy manually', e)\n    revert_to_direct_connection()","preventionTips":["Install/repair the PyObjC privilege helper before enabling proxy control","Test proxy switching after installing on a new macOS machine","Watch logs after network changes to catch stale proxy state"],"tags":["macos","proxy","pyobjc","network-change"],"backgroundTag":"system-proxy-update-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}