Skip to content

Docker 构建 QTDockerEnv 失败(Git 返回 128 错误) #1305

@tiansuo-114

Description

@tiansuo-114

❓ Questions and Help

We sincerely suggest you to carefully read the documentation. After that, if you still feel puzzled, please describe the question clearly under this issue.

2025-11-30 08:17:54.329 | INFO | rdagent.app.utils.health_check:check_and_list_free_ports:50 - Port 19899 is not occupied, you can run the rdagent ui command
(rdagent) osboxes@osboxes:/Desktop/DR/RD-Agent$ rdagent fin_quant
2025-11-30 08:18:22.346 | INFO | rdagent.utils.env:prepare:784 - Building the image from dockerfile: /home/osboxes/miniconda3/envs/rdagent/lib/python3.10/site-packages/rdagent/scenarios/qlib/docker
error: The command '/bin/sh -c git fetch --all && git reset --hard origin/main'…
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/osboxes/miniconda3/envs/rdagent/lib/python3.10/site-packages/rdagent/a │
│ pp/qlib_rd_loop/quant.py:135 in main │
│ │
│ 132 │ │ dotenv run -- python rdagent/app/qlib_rd_loop/quant.py $LOG_PA │
│ 133 │ """ │
│ 134 │ if path is None: │
│ ❱ 135 │ │ quant_loop = QuantRDLoop(QUANT_PROP_SETTING) │
│ 136 │ else: │
│ 137 │ │ quant_loop = QuantRDLoop.load(path, checkout=checkout) │
│ 138 │
│ │
│ ╭────── locals ───────╮ │
│ │ all_duration = None │ │
│ │ checkout = True │ │
│ │ loop_n = None │ │
│ │ path = None │ │
│ │ step_n = None │ │
│ ╰─────────────────────╯ │
│ │
│ /home/osboxes/miniconda3/envs/rdagent/lib/python3.10/site-packages/rdagent/a │
│ pp/qlib_rd_loop/quant.py:35 in init
│ │
│ 32 │ ) │
│ 33 │ │
│ 34 │ def init(self, PROP_SETTING: BasePropSetting): │
│ ❱ 35 │ │ scen: Scenario = import_class(PROP_SETTING.scen)() │
│ 36 │ │ logger.log_object(scen, tag="scenario") │
│ 37 │ │ │
│ 38 │ │ self.hypothesis_gen: HypothesisGen = import_class(PROP_SETTING │
│ │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ PROP_SETTING = QuantBasePropSetting( │ │
│ │ │ │ │
│ │ scen='rdagent.scenarios.qlib.experiment.quant_experiment… │ │
│ │ │ knowledge_base='', │ │
│ │ │ knowledge_base_path='', │ │
│ │ │ hypothesis_gen='', │ │
│ │ │ interactor='', │ │
│ │ │ hypothesis2experiment='', │ │
│ │ │ coder='', │ │
│ │ │ runner='', │ │
│ │ │ summarizer='', │ │
│ │ │ evolving_n=10, │ │
│ │ │ │ │
│ │ quant_hypothesis_gen='rdagent.scenarios.qlib.proposal.qu… │ │
│ │ │ │ │
│ │ model_hypothesis2experiment='rdagent.scenarios.qlib.prop… │ │
│ │ │ │ │
│ │ model_coder='rdagent.scenarios.qlib.developer.model_code… │ │
│ │ │ │ │
│ │ model_runner='rdagent.scenarios.qlib.developer.model_run… │ │
│ │ │ │ │
│ │ model_summarizer='rdagent.scenarios.qlib.developer.feedb… │ │
│ │ │ │ │
│ │ factor_hypothesis2experiment='rdagent.scenarios.qlib.pro… │ │
│ │ │ │ │
│ │ factor_coder='rdagent.scenarios.qlib.developer.factor_co… │ │
│ │ │ │ │
│ │ factor_runner='rdagent.scenarios.qlib.developer.factor_r… │ │
│ │ │ │ │
│ │ factor_summarizer='rdagent.scenarios.qlib.developer.feed… │ │
│ │ │ action_selection='bandit' │ │
│ │ ) │ │
│ │ self = <rdagent.app.qlib_rd_loop.quant.QuantRDLoop object at │ │
│ │ 0x7aa37fa6ace0> │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/osboxes/miniconda3/envs/rdagent/lib/python3.10/site-packages/rdagent/s │
│ cenarios/qlib/experiment/quant_experiment.py:42 in init
│ │
│ 39 class QlibQuantScenario(Scenario): │
│ 40 │ def init(self) -> None: │
│ 41 │ │ super().init() │
│ ❱ 42 │ │ self._source_data = deepcopy(get_data_folder_intro()) │
│ 43 │ │ │
│ 44 │ │ self._rich_style_description = deepcopy(T(".prompts:qlib_facto │
│ 45 │ │ self.experiment_setting = deepcopy(T(".prompts:qlib_factor_ex │
│ │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ self = <rdagent.scenarios.qlib.experiment.quant_experiment.QlibQuantSce… │ │
│ │ object at 0x7aa37fa6acb0> │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/osboxes/miniconda3/envs/rdagent/lib/python3.10/site-packages/rdagent/s │
│ cenarios/qlib/experiment/utils.py:174 in get_data_folder_intro │
│ │
│ 171 │ ): │
│ 172 │ │ # FIXME: (xiao) I think this is writing in a hard-coded way. │
│ 173 │ │ # get data folder intro does not imply that we are generating │
│ ❱ 174 │ │ generate_data_folder_from_qlib() │
│ 175 │ content_l = [] │
│ 176 │ for p in Path(FACTOR_COSTEER_SETTINGS.data_folder_debug).iterdir() │
│ 177 │ │ if re.match(fname_reg, p.name, flags) is not None: │
│ │
│ ╭──────── locals ─────────╮ │
│ │ flags = 0 │ │
│ │ fname_reg = '.*' │ │
│ │ variable_mapping = None │ │
│ ╰─────────────────────────╯ │
│ │
│ /home/osboxes/miniconda3/envs/rdagent/lib/python3.10/site-packages/rdagent/s │
│ cenarios/qlib/experiment/utils.py:16 in generate_data_folder_from_qlib │
│ │
│ 13 def generate_data_folder_from_qlib(): │
│ 14 │ template_path = Path(file).parent / "factor_data_template" │
│ 15 │ qtde = QTDockerEnv() │
│ ❱ 16 │ qtde.prepare() │
│ 17 │ │
│ 18 │ # Run the Qlib backtest │
│ 19 │ execute_log = qtde.check_output( │
│ │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ qtde = <rdagent.utils.env.QTDockerEnv object at 0x7aa37fa6ac80> │ │
│ │ template_path = PosixPath('/home/osboxes/miniconda3/envs/rdagent/lib/py… │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/osboxes/miniconda3/envs/rdagent/lib/python3.10/site-packages/rdagent/u │
│ tils/env.py:962 in prepare │
│ │
│ 959 │ │ """ │
│ 960 │ │ Download image & data if it doesn't exist │
│ 961 │ │ """ │
│ ❱ 962 │ │ super().prepare() │
│ 963 │ │ qlib_data_path = next(iter(self.conf.extra_volumes.keys())) │
│ 964 │ │ if not (Path(qlib_data_path) / "qlib_data" / "cn_data").exists │
│ 965 │ │ │ logger.info("We are downloading!") │
│ │
│ ╭───────────────────────────── locals ──────────────────────────────╮ │
│ │ args = () │ │
│ │ kwargs = {} │ │
│ │ self = <rdagent.utils.env.QTDockerEnv object at 0x7aa37fa6ac80> │ │
│ ╰───────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/osboxes/miniconda3/envs/rdagent/lib/python3.10/site-packages/rdagent/u │
│ tils/env.py:799 in prepare │
│ │
│ 796 │ │ │ │ │ │ │ status_dict = json.loads(line) │
│ 797 │ │ │ │ │ │ │ if "error" in status_dict: │
│ 798 │ │ │ │ │ │ │ │ p.update(task, description=f"[red]erro │
│ ❱ 799 │ │ │ │ │ │ │ │ raise docker.errors.BuildError(status

│ 800 │ │ │ │ │ │ │ if "stream" in status_dict: │
│ 801 │ │ │ │ │ │ │ │ p.update(task, description=status_dict │
│ 802 │ │ │ logger.info(f"Finished building the image from dockerfile: │
│ │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ args = () │ │
│ │ client = <docker.client.DockerClient object at 0x7aa37fa6abc0> │ │
│ │ kwargs = {} │ │
│ │ line = '{"error":"The command '/bin/sh -c git fetch --all │ │
│ │ \u0026\u0026 git reset --hard '+196 │ │
│ │ lines = [ │ │
│ │ │ '{"error":"The command '/bin/sh -c git fetch --all │ │
│ │ \u0026\u0026 git reset --hard '+196, │ │
│ │ │ '' │ │
│ │ ] │ │
│ │ p = <rich.progress.Progress object at 0x7aa37fa6b820> │ │
│ │ part = b'{"error":"The command '/bin/sh -c git fetch --all │ │
│ │ \u0026\u0026 git reset --hard '+198 │ │
│ │ resp_stream = <generator object APIClient._stream_helper at │ │
│ │ 0x7aa37f9dd380> │ │
│ │ self = <rdagent.utils.env.QTDockerEnv object at 0x7aa37fa6ac80> │ │
│ │ status_dict = { │ │
│ │ │ 'error': "The command '/bin/sh -c git fetch --all && │ │
│ │ git reset --hard origin/main' returne"+22, │ │
│ │ │ 'errorDetail': { │ │
│ │ │ │ 'code': 128, │ │
│ │ │ │ 'message': "The command '/bin/sh -c git fetch │ │
│ │ --all && git reset --hard origin/main' returne"+22 │ │
│ │ │ } │ │
│ │ } │ │
│ │ task = 0 │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
BuildError: The command '/bin/sh -c git fetch --all && git reset --hard
origin/main' returned a non-zero code: 128
(rdagent) osboxes@osboxes:
/Desktop/DR/RD-Agent$

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions