gpt4 book ai didi

github - 使用 GitPython 克隆存储库显示 "cannot pread pack file: No such file or directory error"

转载 作者:行者123 更新时间:2023-12-05 07:07:17 26 4
gpt4 key购买 nike

我正在使用 GitPython 将一个存储库从 GitHub 克隆到 databricks dbfs 位置,如下所示:

outdir = "dbfs:/tmp/project"
repo = Repo.clone_from('https://<github token>@github.com/xyz/project.git', outdir, branch='master')

但 gitpython 显示以下错误(我启用了 GIT_PYTHON_TRACE=1 & GIT_TRACE_PACKET=1)

GitCommandError: Cmd('git') failed due to: exit code(128)
cmdline: git clone --branch=master -v https://<github token>@github.com/xyz/project.git /dbfs/tmp/project
stderr: '10:47:50.269995 git.c:344 trace: built-in: git 'clone' '--branch=master' '-v' 'https://<github token>@github.com/xyz/project.git' '/dbfs/tmp/project'
Cloning into '/dbfs/tmp/project'...
10:47:54.849690 run-command.c:334 trace: run_command: 'git-remote-https' 'origin' 'https://<github token>@github.com/xyz/project.git'
10:47:55.127316 pkt-line.c:80 packet: git< # service=git-upload-pack
10:47:55.127342 pkt-line.c:80 packet: git< 0000
10:47:55.127350 pkt-line.c:80 packet: git< 9ca6ebc37f3b520522b3b122752980deaa731118 HEAD\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/master filter agent=git/github-g8c0f36024410
10:47:55.127358 pkt-line.c:80 packet: git< 9ca6ebc37f3b520522b3b122752980deaa731118 refs/heads/master
10:47:55.127363 pkt-line.c:80 packet: git< dda701fe8b184376d38a39b41b5e5480dfe4f671 refs/heads/mccoy04041991-mlflow
10:47:55.127368 pkt-line.c:80 packet: git< dda701fe8b184376d38a39b41b5e5480dfe4f671 refs/pull/1/head
10:47:55.127373 pkt-line.c:80 packet: git< ab6fd089edc1ac4823f36cfc1af0606845b9f10e refs/pull/1/merge
10:47:55.127377 pkt-line.c:80 packet: git< 0000
10:47:55.427723 pkt-line.c:80 packet: git> 9ca6ebc37f3b520522b3b122752980deaa731118 refs/heads/master
10:47:55.427741 pkt-line.c:80 packet: git> 9ca6ebc37f3b520522b3b122752980deaa731118 refs/heads/master
10:47:55.427745 pkt-line.c:80 packet: git> dda701fe8b184376d38a39b41b5e5480dfe4f671 refs/heads/mccoy04041991-mlflow
10:47:55.427748 pkt-line.c:80 packet: git> 0000
10:47:55.427765 run-command.c:334 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' '--no-progress' 'https://<github token>@github.com/xyz/project.git/'
10:47:55.428430 exec_cmd.c:120 trace: exec: 'git' 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' '--no-progress' 'https://<github token>@github.com/xyz/project.git/'
10:47:55.944975 git.c:344 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' '--no-progress' 'https://<github token>@github.com/xyz/project.git/'
10:47:55.945055 pkt-line.c:80 packet: fetch-pack< 9ca6ebc37f3b520522b3b122752980deaa731118 refs/heads/master
10:47:55.945062 pkt-line.c:80 packet: fetch-pack< 9ca6ebc37f3b520522b3b122752980deaa731118 refs/heads/master
10:47:55.945066 pkt-line.c:80 packet: fetch-pack< dda701fe8b184376d38a39b41b5e5480dfe4f671 refs/heads/mccoy04041991-mlflow
10:47:55.945070 pkt-line.c:80 packet: fetch-pack< 0000
10:47:55.945075 pkt-line.c:80 packet: fetch-pack< 9ca6ebc37f3b520522b3b122752980deaa731118 HEAD\0multi_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/master filter agent=git/github-g8c0f36024410
10:47:55.945080 pkt-line.c:80 packet: fetch-pack< 9ca6ebc37f3b520522b3b122752980deaa731118 refs/heads/master
10:47:55.945084 pkt-line.c:80 packet: fetch-pack< dda701fe8b184376d38a39b41b5e5480dfe4f671 refs/heads/mccoy04041991-mlflow
10:47:55.945087 pkt-line.c:80 packet: fetch-pack< dda701fe8b184376d38a39b41b5e5480dfe4f671 refs/pull/1/head
10:47:55.945091 pkt-line.c:80 packet: fetch-pack< ab6fd089edc1ac4823f36cfc1af0606845b9f10e refs/pull/1/merge
10:47:55.945094 pkt-line.c:80 packet: fetch-pack< 0000
10:47:56.598867 pkt-line.c:80 packet: fetch-pack> want 9ca6ebc37f3b520522b3b122752980deaa731118 multi_ack_detailed no-done side-band-64k thin-pack no-progress ofs-delta agent=git/2.7.4
10:47:56.598888 pkt-line.c:80 packet: fetch-pack> want dda701fe8b184376d38a39b41b5e5480dfe4f671
10:47:56.598892 pkt-line.c:80 packet: fetch-pack> 0000
10:47:56.598896 pkt-line.c:80 packet: fetch-pack> done
10:47:56.598907 pkt-line.c:80 packet: fetch-pack> 0000
10:47:56.598946 pkt-line.c:80 packet: git< 008bwant 9ca6ebc37f3b520522b3b122752980deaa731118 multi_ack_detailed no-done side-band-64k thin-pack no-progress ofs-delta agent=git/2.7.40032want dda701fe8b184376d38a39b41b5e5480dfe4f67100000009done
10:47:56.598966 pkt-line.c:80 packet: git< 0000
POST git-upload-pack (202 bytes)
10:47:56.732107 pkt-line.c:80 packet: fetch-pack< NAK
10:47:56.732121 pkt-line.c:80 packet: fetch-pack> 0000
10:47:56.742802 pkt-line.c:80 packet: sideband< PACK ...
10:47:56.742909 run-command.c:334 trace: run_command: 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-pack 3079 on 0427-184217-chew477-10-220-226-214' '--check-self-contained-and-connected' '--pack_header=2,990'
10:47:56.743191 exec_cmd.c:120 trace: exec: 'git' 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-pack 3079 on 0427-184217-chew477-10-220-226-214' '--check-self-contained-and-connected' '--pack_header=2,990'
10:47:57.191239 git.c:344 trace: built-in: git 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-pack 3079 on 0427-184217-chew477-10-220-226-214' '--check-self-contained-and-connected' '--pack_header=2,990'
10:48:03.761742 pkt-line.c:80 packet: git< 0000
10:48:05.488992 pkt-line.c:80 packet: sideband< 0000
fatal: cannot pread pack file: No such file or directory
fatal: index-pack failed

我正在克隆的存储库不包含大文件,但仍然显示此错误。如何在数据 block dbfs 位置成功克隆远程存储库?

最佳答案

我从这个链接分享这个答案:https://forums.databricks.com/questions/8066/access-data-in-github.html

在你的笔记本中使用它来将存储库克隆到你的驱动程序机器中:

%sh git clone https://github.com/path_to_project

使用此命令查看驱动程序中的文件:

%sh ls -al

关于github - 使用 GitPython 克隆存储库显示 "cannot pread pack file: No such file or directory error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62214031/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com