{"record":{"id":"34e5f320952d233d","repo":"XX-net/XX-Net","slug":"x-tunnel-login-session-fail-session-not-start","errorCode":null,"errorMessage":"x-tunnel login_session fail, session not start","messagePattern":"x-tunnel login_session fail, session not start","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"code/default/x_tunnel/local/proxy_session.py","lineNumber":149,"sourceCode":"            self.traffic_upload = 0\n            self.traffic_download = 0\n            self.last_traffic_upload = 0\n            self.last_traffic_download = 0\n            self.last_traffic_reset_time = time.time()\n\n            # sn => (payload, send_time)\n            # sn => ack\n            self.wait_ack_send_list = dict()\n            self.ack_send_continue_sn = 0\n\n            self.received_sn = []\n            self.receive_next_sn = 1\n            self.target_on_roads = 0\n            self.server_time_offset = 0\n            self.server_time_deviation = 9999\n\n            if not self.login_session():\n                xlog.warn(\"x-tunnel login_session fail, session not start\")\n                return False\n\n            self.running = True\n\n            for i in range(0, g.config.concurent_thread_num):\n                if i in self.round_trip_thread:\n                    continue\n\n                self.round_trip_thread[i] = threading.Thread(target=self.normal_round_trip_worker, args=(i,),\n                                                             name=\"roundtrip_%d\" % i)\n                self.round_trip_thread[i].start()\n\n            self.connection_pipe.start()\n            xlog.info(\"session started.\")\n            return True\n\n    def timeout_checker(self):\n        while self.running:","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/x_tunnel/local/proxy_session.py#L131-L167","documentation":"proxy_session.start() initializes transfer state and then calls login_session() to authenticate with the x-tunnel server; when login fails (bad credentials, unreachable server, or API error) start() logs this warning and returns False, so the session never sets running=True and no worker threads are spawned.","triggerScenarios":"Calling start() with an incorrect login_username/login_password, an expired/invalid account, or when the control API server is unreachable, causing login_session() to return False.","commonSituations":"Wrong or expired x-tunnel credentials in config; account out of quota; server-side migration/URL change; DNS or firewall blocking the API endpoint; system clock skew breaking auth.","solutions":["Verify login_username/login_password in your x-tunnel config are correct and the account is active with remaining quota.","Check network/DNS access to the x-tunnel API server and retry after transient outages.","Inspect preceding log lines for the specific login_session failure reason (HTTP status, API error message).","If credentials were rotated, update config and restart the tunnel."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"ok = session.start()\nif not ok:\n    # fall back to direct connection or another proxy\n    switch_to_direct()","typeGuard":"def can_start(session) -> bool:\n    return bool(session.login_session()) if hasattr(session, 'login_session') else True","tryCatchPattern":null,"preventionTips":["Verify credentials and account quota before starting the session.","Fail over to a direct/alternate route when start() returns False.","Alert on repeated login failures rather than silently retrying forever."],"tags":["authentication","login","tunnel","config"],"backgroundTag":"authentication-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}