{"record":{"id":"211c0401f6a2ba0f","repo":"XX-net/XX-Net","slug":"save-cloudflare-domain-but-cloudflare-front-not-en","errorCode":null,"errorMessage":"save_cloudflare_domain but cloudflare front not enabled","messagePattern":"save_cloudflare_domain but cloudflare front not enabled","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/x_tunnel/local/front_dispatcher.py","lineNumber":78,"sourceCode":"        session_fronts.append(tls_relay_front)\n        light_fronts.append(tls_relay_front)\n        g.tls_relay_front = tls_relay_front\n\n    if g.config.enable_direct:\n        from . import direct_front\n        all_fronts.append(direct_front)\n        session_fronts.append(direct_front)\n        light_fronts.append(direct_front)\n\n    for front in all_fronts:\n        front.start()\n\n    threading.Thread(target=front_staticstic_thread, name=\"front_statistic_thread\").start()\n\n\ndef save_cloudflare_domain(domains):\n    if not g.config.enable_cloudflare:\n        xlog.warn(\"save_cloudflare_domain but cloudflare front not enabled\")\n        return\n\n    for front in all_fronts:\n        if front.name != \"cloudflare_front\":\n            continue\n\n        front.ip_manager.save_domains(domains)\n\n\ndef front_staticstic_thread():\n    while g.running:\n        for front in all_fronts:\n            dispatcher = front.get_dispatcher()\n            if not dispatcher:\n                continue\n\n            dispatcher.statistic()\n","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/x_tunnel/local/front_dispatcher.py#L60-L96","documentation":"save_cloudflare_domain() is invoked (typically after login/balance requests succeed and return Cloudflare domains) but the Cloudflare front was disabled in configuration, so the domains are discarded. It signals config inconsistency: something uses cloudflare results while enable_cloudflare is False.","triggerScenarios":"request_balance() or req_token_login_handler() runs and the server response contains cloudflare domain info, while g.config.enable_cloudflare is False in the local config.","commonSituations":"User disabled cloudflare front in config but the account/server still supplies cloudflare domains; mixed old config with new code paths.","solutions":["Enable cloudflare front in config if you want to use these domains","Otherwise ignore — it's harmless and the domains are simply not applied","Make sure the correct config file is loaded (not a stale one)"],"exampleFix":"// before\ng.config.enable_cloudflare = False\n// expect cloudflare domains to be used\n// after\ng.config.enable_cloudflare = True\nsave_cloudflare_domain(domains)","handlingStrategy":"validation","validationCode":"if g.config.enable_cloudflare:\n    save_cloudflare_domain(domains)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Align config with server-provided domain info"],"tags":["x-tunnel","cloudflare","config"],"backgroundTag":"feature-disabled-by-config","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}