logo
58
185
WeChat Login

根据提示无法成功推送仓库#1816

Resolved
created 2025-08-28
Edit

简单描述一下问题和重现方式

使用空仓推送模式:

git init .
git remote add origin https://cnb.cool/xxx.top/xxx/docker-images.git
git config --local user.name xxx
git config --local user.email "xxx@noreply.cnb.cool"
git config credential.helper store

推送报错:

$ git push -u origin master
remote: Not Found
fatal: repository 'https://cnb.cool/xxx.top/xxx/docker-images.git/' not found

https://cnb.cool/xxx.top/xxx/docker-images.git/浏览器报404
https://cnb.cool/xxx.top/xxx/docker-images.git 去掉斜杠正常

访问令牌按照模板创建的:
12d0ae4d-309e-4814-8d37-2bc06e98c72b.png

Creator
$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        ignorecase = true
[remote "origin"]
        url = https://cnb.cool/xxx.top/xxx/docker-images.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[user]
        name = xxx
        email = xxx+xxx@noreply.cnb.cool
[credential]
        helper = store
Creator
$ git config --local --list
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.url=https://cnb.cool/xxx.top/xxx/docker-images.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
user.name=xxx
user.email=xxx+xxx@noreply.cnb.cool
credential.helper=store

https://cnb.cool/liwenqiu/golang/use-private-lib

添加这个配置可以执行cnb验证

Creator

$ GIT_CURL_VERBOSE=1 git push -u origin master
13:19:50.911011 http.c:845 == Info: Couldn't find host cnb.cool in the .netrc file; using defaults
13:19:50.911116 http.c:845 == Info: Trying 127.0.0.1:7890...
13:19:50.911533 http.c:845 == Info: Connected to 127.0.0.1 (127.0.0.1) port 7890
13:19:50.911556 http.c:845 == Info: CONNECT tunnel: HTTP/1.1 negotiated
13:19:50.911567 http.c:845 == Info: allocate connect buffer
13:19:50.911572 http.c:845 == Info: Establish HTTP proxy tunnel to cnb.cool:443
13:19:50.911588 http.c:792 => Send header, 0000000107 bytes (0x0000006b)
13:19:50.911603 http.c:804 => Send header: CONNECT cnb.cool:443 HTTP/1.1
13:19:50.911605 http.c:804 => Send header: Host: cnb.cool:443
13:19:50.911606 http.c:804 => Send header: User-Agent: git/2.43.0
13:19:50.911607 http.c:804 => Send header: Proxy-Connection: Keep-Alive
13:19:50.911608 http.c:804 => Send header:
13:19:50.911843 http.c:792 <= Recv header, 0000000037 bytes (0x00000025)
13:19:50.911859 http.c:804 <= Recv header: HTTP/1.1 200 Connection established
13:19:50.911865 http.c:792 <= Recv header, 0000000002 bytes (0x00000002)
13:19:50.911874 http.c:804 <= Recv header:
13:19:50.911877 http.c:845 == Info: CONNECT phase completed
13:19:50.911879 http.c:845 == Info: CONNECT tunnel established, response 200
13:19:50.972457 http.c:845 == Info: found 438 certificates in /etc/ssl/certs
13:19:50.972972 http.c:845 == Info: GnuTLS ciphers: NORMAL:-ARCFOUR-128:-CTYPE-ALL:+CTYPE-X509:-VERS-SSL3.0
13:19:50.973007 http.c:845 == Info: ALPN: curl offers h2,http/1.1
13:19:50.986595 http.c:845 == Info: SSL connection using TLS1.3 / ECDHE_RSA_AES_256_GCM_SHA384
13:19:50.987131 http.c:845 == Info: server certificate verification OK
13:19:50.987146 http.c:845 == Info: server certificate status verification SKIPPED
13:19:50.987190 http.c:845 == Info: common name: .cnb.cool (matched)
13:19:50.987200 http.c:845 == Info: server certificate expiration date OK
13:19:50.987203 http.c:845 == Info: server certificate activation date OK
13:19:50.987207 http.c:845 == Info: certificate public key: RSA
13:19:50.987208 http.c:845 == Info: certificate version: #3
13:19:50.987219 http.c:845 == Info: subject: C=CN,ST=Guangdong Province,L=Shenzhen,O=Tencent Technology (Shenzhen) Company Limited,CN=
.cnb.cool
13:19:50.987224 http.c:845 == Info: start date: Mon, 25 Aug 2025 00:00:00 GMT
13:19:50.987226 http.c:845 == Info: expire date: Tue, 15 Sep 2026 23:59:59 GMT
13:19:50.987232 http.c:845 == Info: issuer: C=US,O=DigiCert, Inc.,CN=DigiCert Secure Site OV G2 TLS CN RSA4096 SHA256 2022 CA1
13:19:50.987250 http.c:845 == Info: ALPN: server accepted h2
13:19:50.987303 http.c:845 == Info: using HTTP/2
13:19:50.987334 http.c:845 == Info: [HTTP/2] [1] OPENED stream for https://cnb.cool/xxx.top/xxx/docker-images.git/info/refs?service=git-receive-pack
13:19:50.987344 http.c:845 == Info: [HTTP/2] [1] [:method: GET]
13:19:50.987346 http.c:845 == Info: [HTTP/2] [1] [:scheme: https]
13:19:50.987347 http.c:845 == Info: [HTTP/2] [1] [:authority: cnb.cool]
13:19:50.987348 http.c:845 == Info: [HTTP/2] [1] [:path: /xxx.top/xxx/docker-images.git/info/refs?service=git-receive-pack]
13:19:50.987357 http.c:845 == Info: [HTTP/2] [1] [user-agent: git/2.43.0]
13:19:50.987367 http.c:845 == Info: [HTTP/2] [1] [accept: /]
13:19:50.987369 http.c:845 == Info: [HTTP/2] [1] [accept-encoding: deflate, gzip, br, zstd]
13:19:50.987371 http.c:845 == Info: [HTTP/2] [1] [accept-language: C, *;q=0.9]
13:19:50.987372 http.c:845 == Info: [HTTP/2] [1] [pragma: no-cache]
13:19:50.987386 http.c:792 => Send header, 0000000228 bytes (0x000000e4)
13:19:50.987397 http.c:804 => Send header: GET /xxx.top/xxx/docker-images.git/info/refs?service=git-receive-pack HTTP/2
13:19:50.987399 http.c:804 => Send header: Host: cnb.cool
13:19:50.987408 http.c:804 => Send header: User-Agent: git/2.43.0
13:19:50.987410 http.c:804 => Send header: Accept: /
13:19:50.987419 http.c:804 => Send header: Accept-Encoding: deflate, gzip, br, zstd
13:19:50.987422 http.c:804 => Send header: Accept-Language: C, *;q=0.9
13:19:50.987423 http.c:804 => Send header: Pragma: no-cache
13:19:50.987426 http.c:804 => Send header:
13:19:51.015829 http.c:792 <= Recv header, 0000000013 bytes (0x0000000d)
13:19:51.015868 http.c:804 <= Recv header: HTTP/2 401
13:19:51.015873 http.c:792 <= Recv header, 0000000037 bytes (0x00000025)
13:19:51.015875 http.c:804 <= Recv header: date: Thu, 28 Aug 2025 05:19:50 GMT
13:19:51.015877 http.c:792 <= Recv header, 0000000041 bytes (0x00000029)
13:19:51.015894 http.c:804 <= Recv header: content-type: text/plain; charset=utf-8
13:19:51.015900 http.c:792 <= Recv header, 0000000020 bytes (0x00000014)
13:19:51.015901 http.c:804 <= Recv header: content-length: 12
13:19:51.015903 http.c:792 <= Recv header, 0000000022 bytes (0x00000016)
13:19:51.015912 http.c:804 <= Recv header: server: nginx/1.26.3
13:19:51.015914 http.c:792 <= Recv header, 0000000070 bytes (0x00000046)
13:19:51.015916 http.c:804 <= Recv header: traceparent: 00-b5e963c07183680392a0dd5fff5c5d0b-58208d3b8216f507-01
13:19:51.015928 http.c:792 <= Recv header, 0000000037 bytes (0x00000025)
13:19:51.015929 http.c:804 <= Recv header:13:19:51.015929 Basic realm="CNB"
13:19:51.015940 http.c:792 <= Recv header, 0000000031 bytes (0x0000001f)
13:19:51.015942 http.c:804 <= Recv header: vary: Accept-Encoding, Accept
13:19:51.015943 http.c:792 <= Recv header, 0000000045 bytes (0x0000002d)
13:19:51.015953 http.c:804 <= Recv header: strict-transport-security: max-age=63072000
13:19:51.015955 http.c:792 <= Recv header, 0000000002 bytes (0x00000002)
13:19:51.015956 http.c:804 <= Recv header:
13:19:51.015968 http.c:845 == Info: Connection #0 to host 127.0.0.1 left intact
13:20:05.678470 http.c:845 == Info: Found bundle for host: 0x559ecd764f20 [can multiplex]
13:20:05.678509 http.c:845 == Info: Re-using existing connection with proxy 127.0.0.1
13:20:05.678523 http.c:845 == Info: Server auth using Basic with user 'cnb'
13:20:05.678564 http.c:845 == Info: [HTTP/2] [3] OPENED stream for https://cnb.cool/xxx.top/xxx/docker-images.git/info/refs?service=git-receive-pack
13:20:05.678576 http.c:845 == Info: [HTTP/2] [3] [:method: GET]
13:20:05.678577 http.c:845 == Info: [HTTP/2] [3] [:scheme: https]
13:20:05.678579 http.c:845 == Info: [HTTP/2] [3] [:authority: cnb.cool]
13:20:05.678581 http.c:845 == Info: [HTTP/2] [3] [:path: /xxx.top/xxx/docker-images.git/info/refs?service=git-receive-pack]
13:20:05.678582 http.c:845 == Info: [HTTP/2] [3] [authorization: Basic ]
13:20:05.678594 http.c:845 == Info: [HTTP/2] [3] [user-agent: git/2.43.0]
13:20:05.678604 http.c:845 == Info: [HTTP/2] [3] [accept: /]
13:20:05.678607 http.c:845 == Info: [HTTP/2] [3] [accept-encoding: deflate, gzip, br, zstd]
13:20:05.678609 http.c:845 == Info: [HTTP/2] [3] [accept-language: C, *;q=0.9]
13:20:05.678612 http.c:845 == Info: [HTTP/2] [3] [pragma: no-cache]
13:20:05.678670 http.c:792 => Send header, 0000000295 bytes (0x00000127)
13:20:05.678686 http.c:804 => Send header: GET /xxx.top/xxx/docker-images.git/info/refs?service=git-receive-pack HTTP/2
13:20:05.678696 http.c:804 => Send header: Host: cnb.cool
13:20:05.678697 http.c:804 => Send header: Authorization: Basic
13:20:05.678698 http.c:804 => Send header: User-Agent: git/2.43.0
13:20:05.678699 http.c:804 => Send header: Accept: /
13:20:05.678701 http.c:804 => Send header: Accept-Encoding: deflate, gzip, br, zstd
13:20:05.678710 http.c:804 => Send header: Accept-Language: C, *;q=0.9
13:20:05.678719 http.c:804 => Send header: Pragma: no-cache
13:20:05.678729 http.c:804 => Send header:
13:20:05.709522 http.c:792 <= Recv header, 0000000013 bytes (0x0000000d)
13:20:05.709587 http.c:804 <= Recv header: HTTP/2 404
13:20:05.709678 http.c:792 <= Recv header, 0000000037 bytes (0x00000025)
13:20:05.709700 http.c:804 <= Recv header: date: Thu, 28 Aug 2025 05:20:05 GMT
13:20:05.709703 http.c:792 <= Recv header, 0000000041 bytes (0x00000029)
13:20:05.709704 http.c:804 <= Recv header: content-type: text/plain; charset=utf-8
13:20:05.709706 http.c:792 <= Recv header, 0000000019 bytes (0x00000013)
13:20:05.709707 http.c:804 <= Recv header: content-length: 9
13:20:05.709709 http.c:792 <= Recv header, 0000000022 bytes (0x00000016)
13:20:05.709710 http.c:804 <= Recv header: server: nginx/1.26.3
13:20:05.709720 http.c:792 <= Recv header, 0000000070 bytes (0x00000046)
13:20:05.709724 http.c:804 <= Recv header: traceparent: 00-c8df6317c93f85cd5a8a96420d352d4f-f2a113da79de97a7-01
13:20:05.709726 http.c:792 <= Recv header, 0000000037 bytes (0x00000025)
13:20:05.709728 http.c:804 <= Recv header:13:20:05.709728 Basic realm="CNB"
13:20:05.709730 http.c:792 <= Recv header, 0000000031 bytes (0x0000001f)
13:20:05.709740 http.c:804 <= Recv header: vary: Accept-Encoding, Accept
13:20:05.709742 http.c:792 <= Recv header, 0000000045 bytes (0x0000002d)
13:20:05.709743 http.c:804 <= Recv header: strict-transport-security: max-age=63072000
13:20:05.709746 http.c:792 <= Recv header, 0000000002 bytes (0x00000002)
13:20:05.709747 http.c:804 <= Recv header:
13:20:05.709794 http.c:845 == Info: Connection #0 to host 127.0.0.1 left intact
remote: Not Found
fatal: repository 'https://cnb.cool/xxx.top/xxx/docker-images.git/' not found

Administrator

根组织管控开启了“只允许远程开发”所以拒绝了 git 客户端访问,私仓直接返回了 404

Resolved ISSUE
Creator

根组织管控开启了“只允许远程开发”所以拒绝了 git 客户端访问,私仓直接返回了 404

@wenqiuli(阿秋) 谢谢老师,问题已经解决

Assignee
None yet
Label
一定是bug:待鉴定
Priority
None yet
Time period
-
Property
Add custom properties to record and label key information
Participant