使用GitPython克隆存储库显示“无法预打包文件:无此类文件或目录错误”

时间:2020-06-05 11:13:40

标签: github databricks gitpython

我正在使用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

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

1 个答案:

答案 0 :(得分:0)

我通过以下链接分享了此答案:https://forums.databricks.com/questions/8066/access-data-in-github.html

在笔记本中使用此工具将存储库克隆到驱动器计算机中:

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

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

%sh ls -al