Tag Archives: gitlab

GitLab Page Error: 502 Whoops, GitLab is taking too much time to respond. Try refreshing the page, or going

If you confirm that gitlab has been started and the status is run

Log in to the website and report an error.

The first consideration is configuration,

Gitlab requires more than 4G memory. If not, please check whether the virtual machine or server configuration is enough.

Second, check whether your port is occupied

netstat -lntup

If port 8080 is occupied, you must kill it

You can query the log through gitlab CTL tail to see where the problem is

[Solved] Gitlab can clone via SSH, cannot clone via HTTP, and cannot pipeline. Prompt port 80: connection rejected

Problem record: vm-ubuntu 20.04 used NAT mode to connect at the beginning, and later changed to bridge mode. After the change, the gitlab service originally started with docker could not be cloned. It always prompted: fatal… There was no remote library. It was not solved. Later, the mapped directory, container and image were deleted and a new container was restarted, After configuration, SSH cloning can be performed, but HTTP cloning cannot be performed. When performing gitlab CI pipeline, you will be prompted with failed to connect to 192.168.xx.83 port 80: connection rejected

By trying the command: git clone http://192.168.1.83/liutaiqiang/test.git Unable to clone hint: failed to connect to 192.168.xx.83 port 80: connection rejected

By trying the command: git clone   http://192.168.1.83:9001/liutaiqiang/test.git You can clone. Modify gitlab.yml under/SRV/gitlab/data/gitlab rails/etc, change port 80 to 9001, and restart gitlab service, which will change back to port 80

The problem is solved by modifying in the following ways

Custom port used

View the ID of the container

wmg@debian:~$ sudo docker ps
CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS                   PORTS                                                            NAMES
1132de0d1960        gitlab/gitlab-ce:latest   "/assets/wrapper"   19 hours ago        Up 2 minutes (healthy)   80/tcp, 443/tcp, 0.0.0.0:8081->8081/tcp, 0.0.0.0:10022->22/tcp   gitlab

Remember the container ID

In order to prevent accidents, stop the container and docker before operation

docker stop gitlab         
systemctl stop docker

We need to change the HTTP port to access 9001, and the address at the time of cloning is correct. The SSH port of gitlab is changed to 8022 of the host.

Modify host /Config.v2.json and hostconfig.json files under VaR/lib/docker/containers/container ID/

root@debian:~# cd /var/lib/docker/containers/1132de0d1960e1049a3f1f014b2ba215442a6c7f23f4983b324e055306822c52/
root@debian:/var/lib/docker/containers/1132de0d1960e1049a3f1f014b2ba215442a6c7f23f4983b324e055306822c52# ls
1132de0d1960e1049a3f1f014b2ba215442a6c7f23f4983b324e055306822c52-json.log  checkpoints  config.v2.json  hostconfig.json  hostname  hosts  mounts  resolv.conf  resolv.conf.hash

config.v2.json

hostconfig.json

Tips: if VIM editing is not formatted, the readability will be very poor. I copied the file locally and changed it with Notepad + +

Modify the gitlab configuration file/etc/gitlab/gitlab.rb in the container

Because I mapped/etc/gitlab to/backup/gitlab/config, I went directly to this directory to modify the gitlab.rb file, with the following parameters

external 'http://192.168.88.213:8081'
nginx['listen_port'] = 8081
gitlab_rails['gitlab_shell_ssh_port'] = 10022

After the change, just start the docker and container

systemctl start docker

docker start gitlab

gitlaberror: object file .git/objects/….. is empty

How is 618 sales champion made?Uncover the secret of e-commerce’s “invigorating” hundreds of millions of sales data>>>

Reference: https://stackoverflow.com/questions/11706215/how-to-fix-git-error-object-file-is-empty

But found that according to the above reference, there is still a problem, next posted my personal treatment

Note: the above method needs to be processed on the remote server, that is, on gitlab, CD/MNT/data/git data/repositories/tontisa-xq/tontisa-xq-ui.git

Scene: the computer room is powered off, and the GIT file is damaged. Error: object file./objects/03/3a17bc5ecb32bdc14c27c3e92f0e02aec7aff9 is empty when the development computer executes git pull origin development

Treatment method:

Refer to the above article for processing, but the processing is as follows:

I’m dealing with the development branch: so it’s as follows:

cd /mnt/data/git-data/repositories/tontisa-xq/tontisa-xq-ui.git

cat refs/heads/develop

It is found that there is only one submission, that is, the submission point where the client pull reported an error, so the individual extra processing is as follows:

From colleagues’ clients, find the latest submission point of development, such as 2913373ae37a1514e9ee683511b20a3b0713a9b7

vim refs/heads/develop

Use: 2913373ae37a1514e9ee683511b20a3b0713a9b7 to replace the bad commit point of ref/heads/development, then OK

Gitlab Access error Whoops, GitLab is taking too much time to respond

Gitlab is taking too much time to respond

gitlab access error whoops, gitlab is taking too much time to respond

 

problem positioning

problem location port 8080 is occupied:

 

Solutions

solution 01:

Kill the process occupying port 8080

Or uninstall the software that occupies port 8080

Modify the running port of the program occupying port 8080

Restart gitlab

solution 02:

external_ URL add an unused port

external_url 'http://192.168.45.146

can be changed to unused port:

external_url 'http://192.168.45.146:8899'

open the following three lines of comments
Default comments:

unicorn['port'] = 8088
postgresql['shared_buffers'] = "256MB"
postgresql['max_connections'] = 200

 

Restart gitlab, Done!

Git you are not allowed to push code to protected branches on this project?

error: You are not allowed to push code to protected branches on this project.

error: failed to push some refs to …

there’s no problem – everything works as expected.

In GitLab some branches can be protected. By default only ‘master’ user can commit to protected branches.masterbranch is protected by default – it forces developers to issue merge requests to be validated by project master before integrating them into main code.

You can turn on and off protection on selected branches in Project Settings (where exactly depends on GitLab version – see instructions below).

On the same settings page you can also allow developers to push into the protected branches. With this setting on, protection will be limited to rejecting operations requiringgit push --force(rebase etc.)

I’m not really sure when this change was introduced, screenshots are from 10.3 version.

Now you can select who is allowed to merge or push into selected branches (for example: you can turn off pushes tomasterat all, forcing all changes to branch to be made via Merge Requests). Or you can click “Unprotect” to completely remove protection from branch.

source:

https://stackoverflow.com/questions/32246503/how-to-fix-you-are-not-allowed-to-push-code-to-protected-branches-on-this-proje