GitLab: Push operation timed out

Posted 阿迷创客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GitLab: Push operation timed out相关的知识,希望对你有一定的参考价值。

文章目录

1.问题描述

建立新AOSP仓库之后,推送AOSP源码,始终提示 GitLab: Push operation timed out 错误,没法把源码推上去。

2.日志及流程

  • 从下面操作日志可知,和lfs有关系
  • in LFS cancelled
szhou@bc04:~/mt/main/aosp$ git push origin  master
枚举对象中: 926922, 完成.
对象计数中: 100% (926922/926922), 完成.
使用 64 个线程进行压缩
压缩对象中: 100% (538300/538300), 完成.
写入对象中: 100% (926922/926922), 19.96 GiB | 2.25 MiB/s, 完成.
总共 926922(差异 294898),复用 925791(差异 293788),包复用 0
remote: Resolving deltas: 100% (294898/294898), done.
remote: Checking connectivity: 926922, done.
remote: GitLab: Push operation timed out
remote:
remote: Timing information for debugging purposes:
remote: Running checks for ref: master
remote: Checking if you are allowed to push... (37.1ms)
remote: Checking if default branch is being deleted... (0.02ms)
remote: Checking if you are force pushing to a protected branch... (41.29ms)
remote: Checking if you are allowed to push to the protected branch... (47.86ms)
remote: Scanning repository for blobs stored in LFS and verifying their files have been uploaded to GitLab... (cancelled after 29071.32ms)
remote: Running checks for 1 changes (cancelled after 29071.46ms)
To https://60.190.224.xx:xxxx/android/aosp.git
 ! [remote rejected]       master -> master (pre-receive hook declined)
error: 推送一些引用到 'https://60.190.224.xx:xxxx/android/aosp.git' 失败
szhou@bc04:~/mt/main/aosp$ 

3.解决办法

  • 进入gitlab服务器
  • 输入如下命令:
  • irb(main):003:0> Feature.disable(:lfs_check)
  • 即关闭lfs check, 规避此问题
szhou@Android-Gitlab:~$ sudo gitlab-rails console
[sudo] szhou 的密码: 
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
 GitLab:       14.6.3-ee (6360adc49de) EE
 GitLab Shell: 13.22.1
 PostgreSQL:   12.7
--------------------------------------------------------------------------------
Loading production environment (Rails 6.1.4.1)
irb(main):003:0> Feature.disable(:lfs_check)
=> true

4.测试结果

szhou@bc04:~/mt/main/aosp$ git push origin  master
枚举对象中: 926922, 完成.
对象计数中: 100% (926922/926922), 完成.
使用 64 个线程进行压缩
压缩对象中: 100% (538300/538300), 完成.
写入对象中: 100% (926922/926922), 19.96 GiB | 2.29 MiB/s, 完成.
总共 926922(差异 294902),复用 925787(差异 293788),包复用 0
remote: Resolving deltas: 100% (294902/294902), done.
remote: Checking connectivity: 926922, done.
To https://60.190.224.xxx:5757/android/aosp.git
 * [new branch]            master -> master
szhou@bc04:~/mt/main/aosp$ 

以上是关于GitLab: Push operation timed out的主要内容,如果未能解决你的问题,请参考以下文章

如何禁止GitLab分支被push

如何将 GitLab Operator 部署到 AWS EKS 集群?

如何禁止GitLab分支被push

gitlab push本地代码到gitlab上

如何禁止GitLab分支被push

如何禁止GitLab分支被push