{"record":{"id":"f3cf5fc76a7eb143","repo":"aosabook/500lines","slug":"could-not-update-and-check-repository-reason-s","errorCode":null,"errorMessage":"Could not update and check repository. Reason: %s","messagePattern":"Could not update and check repository\\. Reason: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"ci/code/repo_observer.py","lineNumber":38,"sourceCode":"def poll():\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"--dispatcher-server\",\n                        help=\"dispatcher host:port, \" \\\n                        \"by default it uses localhost:8888\",\n                        default=\"localhost:8888\",\n                        action=\"store\")\n    parser.add_argument(\"repo\", metavar=\"REPO\", type=str,\n                        help=\"path to the repository this will observe\")\n    args = parser.parse_args()\n    dispatcher_host, dispatcher_port = args.dispatcher_server.split(\":\")\n    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),","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/aosabook/500lines/blob/fba689d101eb5600f5c8f4d7fd79912498e950e2/ci/code/repo_observer.py#L20-L56","documentation":"Error \"Could not update and check repository. Reason: %s\" thrown in aosabook/500lines.","triggerScenarios":"Thrown at ci/code/repo_observer.py:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the repository path passed to repo_observer is correct and accessible.","Run ./update_repo.sh manually against the repo to see the underlying failure (permissions, git errors, network).","Ensure the observer process has read/write permissions to the repository and its working directory."],"exampleFix":"./update_repo.sh /path/to/repo  # inspect its error output, then fix the reported git/permission issue before restarting the observer","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"}