通过公司代理推送到gitlab.com-错误:RPC失败; HTTP 403 curl 22请求的URL返回错误:403

时间:2020-07-31 04:25:00

标签: git proxy gitlab

我目前正在通过公司防火墙(当然使用HTTPS)使用gitlab,某些回购协议运行良好,但是一些回购协议抛出消息 error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403

您是否知道为什么会发生此问题?我该怎么做才能进一步解决此问题?

这是控制台日志

ME@MYPC MINGW64 /d/git/working/my-project (master)
$ git push -u gitlab master
Enumerating objects: 4734, done.
Counting objects: 100% (4734/4734), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2565/2565), done.
Writing objects: 100% (4734/4734), 122.85 MiB | 34.32 MiB/s, done.
Total 4734 (delta 3085), reused 3485 (delta 2057), pack-reused 0
error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

这是我的/.git/config内容

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "gitlab"]
    url = https://gitlab.com/my-group/my-project.git
    fetch = +refs/heads/*:refs/remotes/gitlab/*
[http]
    proxy = http://my-account:my-password@my-company-proxy-server:8080
    sslVerify = false
[https]
    proxy = http://my-account:my-password@my-company-proxy-server:8080

如VonC所建议,这是详细的日志

16:10:39.509989 common-main.c:48                  version 2.28.0.windows.1
16:10:39.509989 common-main.c:49                  start 'C:\Program Files\Git\mingw64\bin\git.exe' rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
16:10:39.525618 git.c:445                         cmd_name rev-parse (rev-parse)
16:10:39.525618 repository.c:134                  worktree D:/git/working/my-project
16:10:39.541275 git.c:675                         exit elapsed:0.051582 code:0
16:10:39.541275 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.051664 code:0
16:10:39.650660 common-main.c:48                  version 2.28.0.windows.1
16:10:39.650660 common-main.c:49                  start 'C:\Program Files\Git\mingw64\bin\git.exe' config --bool core.sparseCheckout
16:10:39.681866 repository.c:134                  worktree D:/git/working/my-project
16:10:39.681866 git.c:445                         cmd_name config (config)
16:10:39.681866 git.c:675                         exit elapsed:0.045467 code:1
16:10:39.681866 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.045496 code:1
16:10:45.739576 common-main.c:48                  version 2.28.0.windows.1
16:10:45.739576 common-main.c:49                  start 'C:\Program Files\Git\mingw64\bin\git.exe' remote -v
16:10:45.755196 repository.c:134                  worktree D:/git/working/my-project
16:10:45.770850 git.c:445                         cmd_name remote (remote)
16:10:45.770850 git.c:675                         exit elapsed:0.045971 code:0
16:10:45.770850 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.046016 code:0
16:10:45.911479 common-main.c:48                  version 2.28.0.windows.1
16:10:45.911479 common-main.c:49                  start 'C:\Program Files\Git\mingw64\bin\git.exe' rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
16:10:45.942731 git.c:445                         cmd_name rev-parse (rev-parse)
16:10:45.942731 repository.c:134                  worktree D:/git/working/my-project
16:10:45.942731 git.c:675                         exit elapsed:0.054844 code:0
16:10:45.942731 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.054877 code:0
16:10:46.052109 common-main.c:48                  version 2.28.0.windows.1
16:10:46.052109 common-main.c:49                  start 'C:\Program Files\Git\mingw64\bin\git.exe' config --bool core.sparseCheckout
16:10:46.083328 repository.c:134                  worktree D:/git/working/my-project
16:10:46.083328 git.c:445                         cmd_name config (config)
16:10:46.083328 git.c:675                         exit elapsed:0.045001 code:1
16:10:46.083328 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.045029 code:1
16:10:53.959099 common-main.c:48                  version 2.28.0.windows.1
16:10:53.959099 common-main.c:49                  start 'C:\Program Files\Git\mingw64\bin\git.exe' push -u gltest --all
16:10:53.974725 repository.c:134                  worktree D:/git/working/my-project
16:10:53.974725 git.c:445                         cmd_name push (push)
16:10:53.990319 run-command.c:735                 child_start[0] git remote-https gltest https://gitlab.com/my-group/my-project.git
16:10:54.052831 common-main.c:48                  version 2.28.0.windows.1
16:10:54.052831 common-main.c:49                  start git remote-https gltest https://gitlab.com/my-group/my-project.git
16:10:54.084065 git.c:698                         cmd_name _run_dashed_ (push/_run_dashed_)
16:10:54.084065 run-command.c:735                 child_start[0] git-remote-https gltest https://gitlab.com/my-group/my-project.git
16:10:54.177848 common-main.c:48                  version 2.28.0.windows.1
16:10:54.177848 common-main.c:49                  start git-remote-https gltest https://gitlab.com/my-group/my-project.git
16:10:54.209098 repository.c:134                  worktree D:/git/working/my-project
16:10:54.209098 remote-curl.c:1481                cmd_name remote-curl (push/_run_dashed_/remote-curl)
16:10:54.637397 run-command.c:735                 child_start[0] 'git credential-manager get'
16:10:54.802881 common-main.c:48                  version 2.28.0.windows.1
16:10:54.802881 common-main.c:49                  start 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' credential-manager get
16:10:54.834159 git.c:698                         cmd_name _run_dashed_ (push/_run_dashed_/remote-curl/_run_dashed_)
16:10:54.834159 run-command.c:735                 child_start[0] git-credential-manager get
16:10:55.115376 run-command.c:990                 child_exit[0] pid:20444 code:0 elapsed:0.276884
16:10:55.115376 git.c:720                         exit elapsed:0.329788 code:0
16:10:55.115376 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.329819 code:0
16:10:55.131003 run-command.c:990                 child_exit[0] pid:20928 code:0 elapsed:0.488029
16:10:56.052991 run-command.c:735                 child_start[1] 'git credential-manager store'
16:10:56.177920 common-main.c:48                  version 2.28.0.windows.1
16:10:56.177920 common-main.c:49                  start 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' credential-manager store
16:10:56.209132 git.c:698                         cmd_name _run_dashed_ (push/_run_dashed_/remote-curl/_run_dashed_)
16:10:56.209132 run-command.c:735                 child_start[0] git-credential-manager store
16:10:56.443596 run-command.c:990                 child_exit[0] pid:17972 code:0 elapsed:0.240786
16:10:56.443596 git.c:720                         exit elapsed:0.284058 code:0
16:10:56.443596 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.284073 code:0
16:10:56.459161 run-command.c:990                 child_exit[1] pid:6784 code:0 elapsed:0.403007
16:10:56.459161 run-command.c:735                 child_start[2] 'git credential-manager store'
16:10:56.556409 common-main.c:48                  version 2.28.0.windows.1
16:10:56.556409 common-main.c:49                  start 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' credential-manager store
16:10:56.587688 git.c:698                         cmd_name _run_dashed_ (push/_run_dashed_/remote-curl/_run_dashed_)
16:10:56.587688 run-command.c:735                 child_start[0] git-credential-manager store
16:10:56.869181 run-command.c:990                 child_exit[0] pid:11192 code:0 elapsed:0.281542
16:10:56.869181 git.c:720                         exit elapsed:0.334916 code:0
16:10:56.869181 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.334930 code:0
16:10:56.884570 run-command.c:990                 child_exit[2] pid:13840 code:0 elapsed:0.425113
16:10:56.884570 run-command.c:735                 child_start[3] 'git credential-manager store'
16:10:56.978322 common-main.c:48                  version 2.28.0.windows.1
16:10:56.978322 common-main.c:49                  start 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' credential-manager store
16:10:57.009567 git.c:698                         cmd_name _run_dashed_ (push/_run_dashed_/remote-curl/_run_dashed_)
16:10:57.009567 run-command.c:735                 child_start[0] git-credential-manager store
16:10:57.290788 run-command.c:990                 child_exit[0] pid:17544 code:0 elapsed:0.276504
16:10:57.290788 git.c:720                         exit elapsed:0.320204 code:0
16:10:57.290788 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.320218 code:0
16:10:57.290788 run-command.c:990                 child_exit[3] pid:20724 code:0 elapsed:0.408926
16:10:57.290788 run-command.c:735                 child_start[4] 'git credential-manager store'
16:10:57.384574 common-main.c:48                  version 2.28.0.windows.1
16:10:57.384574 common-main.c:49                  start 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' credential-manager store
16:10:57.415786 git.c:698                         cmd_name _run_dashed_ (push/_run_dashed_/remote-curl/_run_dashed_)
16:10:57.415786 run-command.c:735                 child_start[0] git-credential-manager store
16:10:57.714217 run-command.c:990                 child_exit[0] pid:18192 code:0 elapsed:0.302592
16:10:57.714217 git.c:720                         exit elapsed:0.345537 code:0
16:10:57.714217 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.345603 code:0
16:10:57.739239 run-command.c:990                 child_exit[4] pid:5340 code:0 elapsed:0.438338
16:10:57.741259 run-command.c:735                 child_start[5] git send-pack --stateless-rpc --helper-status --thin --progress https://gitlab.com/my-group/my-project.git/ --stdin
16:10:57.786540 common-main.c:48                  version 2.28.0.windows.1
16:10:57.786540 common-main.c:49                  start git send-pack --stateless-rpc --helper-status --thin --progress https://gitlab.com/my-group/my-project.git/ --stdin
16:10:57.802166 repository.c:134                  worktree D:/git/working/my-project
16:10:57.817823 git.c:445                         cmd_name send-pack (push/_run_dashed_/remote-curl/send-pack)
16:10:57.833420 run-command.c:735                 child_start[0] git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
16:10:57.880320 common-main.c:48                  version 2.28.0.windows.1
16:10:57.880320 common-main.c:49                  start git pack-objects --all-progress-implied --revs --stdout --thin --delta-base-offset --progress
16:10:57.895946 repository.c:134                  worktree D:/git/working/my-project
16:10:57.911540 git.c:445                         cmd_name pack-objects (push/_run_dashed_/remote-curl/send-pack/pack-objects)
16:11:04.650297 git.c:675                         exit elapsed:6.796223 code:0
16:11:04.650297 trace2/tr2_tgt_normal.c:123       atexit elapsed:6.796321 code:0
16:11:04.665919 run-command.c:990                 child_exit[0] pid:10476 code:0 elapsed:6.835603
16:11:04.960226 usage.c:77                        error RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
16:11:04.960226 run-command.c:1088                exit elapsed:7.197974 code:128
16:11:04.960226 trace2/tr2_tgt_normal.c:123       atexit elapsed:7.198040 code:128
16:11:04.960226 run-command.c:990                 child_exit[5] pid:928 code:128 elapsed:7.230909
16:11:04.960226 remote-curl.c:1374                exit elapsed:10.809890 code:128
16:11:04.960226 trace2/tr2_tgt_normal.c:123       atexit elapsed:10.810300 code:128
16:11:04.975851 run-command.c:990                 child_exit[0] pid:972 code:128 elapsed:10.895059
16:11:04.975851 git.c:720                         exit elapsed:10.943129 code:128
16:11:04.975851 trace2/tr2_tgt_normal.c:123       atexit elapsed:10.943157 code:128
16:11:04.991478 run-command.c:990                 child_exit[0] pid:11728 code:128 elapsed:11.000633
16:11:04.991478 git.c:675                         exit elapsed:11.044201 code:1
16:11:04.991478 trace2/tr2_tgt_normal.c:123       atexit elapsed:11.044233 code:1
16:11:05.147721 common-main.c:48                  version 2.28.0.windows.1
16:11:05.147721 common-main.c:49                  start 'C:\Program Files\Git\mingw64\bin\git.exe' rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
16:11:05.178969 git.c:445                         cmd_name rev-parse (rev-parse)
16:11:05.178969 repository.c:134                  worktree D:/git/working/my-project
16:11:05.178969 git.c:675                         exit elapsed:0.045678 code:0
16:11:05.178969 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.045707 code:0
16:11:05.299183 common-main.c:48                  version 2.28.0.windows.1
16:11:05.299183 common-main.c:49                  start 'C:\Program Files\Git\mingw64\bin\git.exe' config --bool core.sparseCheckout
16:11:05.330396 repository.c:134                  worktree D:/git/working/my-project
16:11:05.330396 git.c:445                         cmd_name config (config)
16:11:05.330396 git.c:675                         exit elapsed:0.045826 code:1
16:11:05.330396 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.045856 code:1

1 个答案:

答案 0 :(得分:1)

除了GIT_CURL_VERBOSEGIT_TRACE_CURL外,我documented here

git config --global trace2.normalTarget ~/log.normal

这可以帮助您了解正在发生的事情。
确保首先更新为latest Git for Windows(2.28)