看板 Python 關於我們 聯絡資訊
前言: 目前想把一些source code管理的工作由jenkins代勞 而製作了一些python code, 在單獨執行自己寫的python 做git clone (透過 ssh rsa_id)動作的時候 整個程式動作 可以正常完成結束 但在jenkins底下透過windows batch去執行python做git clone時候就會出現 git\repo\base.py", line 1148, in clone_from return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options, **kwargs) repo\base.py", line 1086, in _clone finalize_process(proc, stderr=stderr) \git\util.py", line 386, in finalize_process proc.wait(**kwargs) git\cmd.py", line 502, in wait raise GitCommandError(remove_password_if_present(self.args), status, errstr) git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git clone -v C:/mytest/test stderr: 'Cloning into 'C:/mytest/test'... Host key verification failed. fatal: Could not read from remote repository 原圖: https://imgur.com/Ex5lv7v.jpg
但有測試過直接在win10下寫一個batch 去呼叫python是可以正常完成clone的動作 請問有沒有甚麼建議或者資料能協助理解這個問題 謝謝高手們囉 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.99.136.146 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1662435524.A.993.html
lycantrope: 錯誤訊息都被你略過,只能猜ssh設定有問題了 09/06 11:47
woogee: 錯誤訊息被省略掉了... 09/06 12:28
※ 編輯: ckai007 (175.99.136.146 臺灣), 09/06/2022 13:15:30 ※ 編輯: ckai007 (175.99.136.146 臺灣), 09/06/2022 13:21:20
roccqqck: key有問題 先確定路徑吧 09/06 14:23
lycantrope: 如果是用GitPython,tutorial內有寫怎麼設定ssh_key. 09/06 14:55
ckai007: python裡面有寫入env={“GIT_SSH_COMMAND: key路徑} 09/06 16:21