{"record":{"id":"548ef2912d8be092","repo":"aosabook/500lines","slug":"could-not-communicate-with-dispatcher-server-s","errorCode":null,"errorMessage":"Could not communicate with dispatcher server: %s","messagePattern":"Could not communicate with dispatcher server: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"ci/code/repo_observer.py","lineNumber":49,"sourceCode":"    while True:\n        try:\n            # call the bash script that will update the repo and check\n            # for changes. If there's a change, it will drop a .commit_id file\n            # with the latest commit in the current working directory\n            subprocess.check_output([\"./update_repo.sh\", args.repo])\n        except subprocess.CalledProcessError as e:\n            raise Exception(\"Could not update and check repository. Reason: %s\" % e.output)\n\n        if os.path.isfile(\".commit_id\"):\n            # great, we have a change! let's execute the tests\n            # First, check the status of the dispatcher server to see\n            # if we can send the tests\n            try:\n                response = helpers.communicate(dispatcher_host,\n                                               int(dispatcher_port),\n                                               \"status\")\n            except socket.error as e:\n                raise Exception(\"Could not communicate with dispatcher server: %s\" % e)\n            if response == \"OK\":\n                # Dispatcher is present, let's send it a test\n                commit = \"\"\n                with open(\".commit_id\", \"r\") as f:\n                    commit = f.readline()\n                response = helpers.communicate(dispatcher_host,\n                                               int(dispatcher_port),\n                                               \"dispatch:%s\" % commit)\n                if response != \"OK\":\n                    raise Exception(\"Could not dispatch the test: %s\" %\n                    response)\n                print \"dispatched!\"\n            else:\n                # Something wrong happened to the dispatcher\n                raise Exception(\"Could not dispatch the test: %s\" %\n                response)\n        time.sleep(5)\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/aosabook/500lines/blob/fba689d101eb5600f5c8f4d7fd79912498e950e2/ci/code/repo_observer.py#L31-L67","documentation":"Error \"Could not communicate with dispatcher server: %s\" thrown in aosabook/500lines.","triggerScenarios":"Thrown at ci/code/repo_observer.py:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start the dispatcher server before running repo_observer.","Confirm the --dispatcher-server host:port argument matches where the dispatcher is actually listening.","Check that no firewall or port conflict blocks the socket connection."],"exampleFix":"python dispatcher.py --port 8888 &  # then run: python repo_observer.py --dispatcher-server localhost:8888 /path/to/repo","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fba689d101eb5600f5c8f4d7fd79912498e950e2","analyzedAt":"2026-08-13T06:26:32.792Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}