Questions tagged as ['gitlab']

Gitlab is self hosted Git management software.
Score: 0
Uday Kiran Reddy avatar
How to check script status after_script?
cn flag

In the after_sctipt section, if the script section fails or success, still it runs as I keep allow_failure: true But, how to check in after_script that whether script section failed/success so that I can pass the same in some api call in the after_script

Score: 0
Cache gems for every build on GitLab Runner
us flag

I have a GitLab Runner installed on a Ubuntu server. It uses 'docker' executor.

I want every CI job which executes on this runner to use the same Ruby gems cache, to prevent downloading from the same version several times in a row.

There seems to be two solutions:

  1. Use cache: instruction in .gitlab-ci.yml. I don't like that because I would have per-project cache instead of single cache ...

Score: 0
fajin yu avatar
Gerrit replication plugin reload with error "lacks ${name} placeholder in FileBasedConfig"
in flag

The server which I deploied Gerrit's OS is Ubuntu 18.04.05, and my Gitlab server's IP address is I tried using replication plugin to push gerrit project to local Gitlab server. My gerrit_site/etc/replication.config file likes below:

[remote "test_project"]
    url = git@
    push = +refs/heads/*:refs/heads/*
    push =  ...
Score: 0
Uday Kiran Reddy avatar
How to execute remote commands on linux and update return value?
cn flag

As part of automation in gitlab ci.

I am running a terraform template and creating a linux machine.

After that, I need to run few commands on the remote machine. I am running those using the ssh remote command. But at the end, even if it is failure, it is showing as successful.

Please let me know how to setup this kind of environment. Installing any tool as a step is also feasible

Score: 0
How to dynamically change cgroup of systemd service subprocesses (gitlab runner)?
ru flag

I am running a gitlab runner and I want each job to put itself into its own cgroup.

I can set the gitlab bash subprocess to the right cgroup, but its children don't inherit the cgroup.

This is how I'm doing it:

$ /usr/bin/ps -opid,cgroup $PPID $$
 43547 11:blkio:/user.slice,9:devices:/user.slice,7:pids:/user.slice,6:memory:/user.slice,2:cpuacct,cpu:/user.slice,1:name=systemd:/user.slice/use ...
Score: 0
Uday Kiran Reddy avatar
How to fix script config should be a string or a nested array of strings up to 10 levels deep?
cn flag

With below pipeline job, I am getting syntax error.

gitlab error

Found errors in your .gitlab-ci.yml:
jobs:test-artifact:script config should be a string or a nested array of strings up to 10 levels deep
You can also test your .gitlab-ci.yml in CI Lint

Some one suggested to keep the : part in double quotes but it is already part of it.

  stage: build
  allow_failure: false
  needs:  ...
Score: 0
Jeysson Paiva avatar
How can to resolve a coreDNS pods with status ContainerCreating - kubernetes
cn flag

I hope somebody can help me.

Well, I'm building a server (CentOS) with Gitlab, Gitlab-Runner, docker, and Kubernetes to CI/CD.

GitLab information

Version:        14.10.2
Revision:       07d12f3fd11
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     12.7    


Version:      14.10.1


Version:           20.10.15


# kubectl v ...
Score: 1
GitLab Helm Chart Minio use existing PVC
ec flag

Previously in my helm chart, I had the snippet below...

  replicas: 1
    enabled: true
    existingClaim: minio
    #size: 10Gi
  serviceType: LoadBalancer

Because I do have an existing PVC that I intend to use with Minio. It worked fine, up until a couple months ago, when GitLab changed their chart format up.

Now, it shows that I can set minio.persistence.volumeName to use an e ...

Score: 0
Gitlab pipeline is giving connection error
ng flag

We have created a wrapper executable for our product with python setup tools.

with aws machine, it is running and even in docker container.

But when I run the same command in gitlab runner with same docker image, I am getting error as below.

But when I run the same command in gitlab runner, I am getting error as below.

HTTPConnectionPool(host='', port=80): Max retries exceeded with url:  ...

Score: 0
uday avatar
How to run aws cli on amazon linux container?
ke flag

I want to run amazon linux commands as part of gitlab pipeline.

So, trying to use docker image as runner, amazonlinux:latest

So, connected to docker container and ran below command.

yum -yq install aws-cli

It installed aws-cli

Then, configured aws cli.

aws configure set region $AWS_REGION
aws configure set aws_access_key_id $AWS_ACCESS_KEY
aws configure set aws_secret_access_key $AWS_SECRET_KEY
aws con ...
Score: 0
How to deploy terraform in another account of aws using gitlab?
kr flag

I have a gitlab runner configured in the aws ec2 instance.

For any aws deployments, we simply added the role to the ec2 instance.

But, our gitlab runner is configured in one aws account. And we need to apply aws terraform templates on a different account(not IAM, complete different root account).

How to give gitlab runner permission to this different aws account

Score: 0
Key forwarding with putty isn't working, but plink DOES work
nl flag

I'm having a problem where putty's key forwarding (via pageant) to my gitlab server isn't working. I'm doing a putty session to my server, with ssh auth forwarding enabled. I see the effects of that forwarding in the environment variables on the remote system.

Here's a transcript from an attempt that is not working. This is in a putty window.

login as: elyograg
Authenticating with public key "elyog ...
Score: 1
WilhelmM avatar
Using git lfs to manage data in storage server
cn flag

I am part of a small physics research team (10-15 people) which recently has acquired a storage server and I will be responsible for setting it up. As such, I needed to think the best way to organize the data we will be generating.

When researching the best way to do this, I came across git lfs. We already use GitLab (the cloud version) to version control our codes and easily share them between u ...

Score: 1
Scorpioooooon21 avatar
Unable to login to docker via Ubuntu 18.04.5 LTS
mx flag

I am having an issue on login to docker from my Ubuntu 18.04.5 LTS

This is the command I run to login docker

sudo docker login -u myname -p mypass

This is the error I've got

Error response from daemon: Get net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I did searches on google and seems it is not quite a common  ...

Score: 0
How to re-use vault files in different Ansible Tower projects?
in flag

I have an Ansible Tower installation and a lot of playbooks in Gitlab projects. Several projects make use of vault files, i.e. they contain credentials for a VMware VCenter.

Whenever I start a new project/playbook, I keep making copies of vault files from project to project because in Ansible Tower I can't access more than one GitLab project at once. That leads to vault files scattered all over m ...

Score: 0
DutchEllie avatar
How do I write a maintainable Terraform template
cn flag

for my company I have been tasked with creating a standard configuration and template for an (EKS) Kubernetes cluster in Terraform that can be deployed using GitLab CI/CD. The deployment and configuration has been done for a while, but I have been struggling with the template side of things.

Here's my task: create a template project/repo with configuration that someone else can copy and edit.

Howeve ...

Score: 0
Max K avatar
Mount volume to build image used by gitlab runner
ec flag

I have custom image where I want to run some tests which require installed app which in turn need openGL context. I can run it in container composed this way and manually build project and run tests. docker-compose.yml:

version: "3.6"

  - /tmp/.X11-unix/:/tmp/.X11-unix
  - /var/run/dbus:/var/run/dbus
  - /dev/shm:/dev/shm
privileged: true
Score: 0
Stefan NovakDev avatar
NGINX location rewrite for Gitlab
pk flag

I'm trying to make Gitlab work behind Nginx. my configs:


upstream gitlab-workhorse {
    server unix:/var/opt/gitlab/gitlab-workhorse/sockets/socket fail_timeout=0;

location /gitlab/ {
       rewrite ^/gitlab(/.*)$ $1 break;
       client_max_body_size 0;
       gzip off;
       proxy_read_timeout      300;
       proxy_connect_timeout   300;
       proxy_redirect          off;
       p ...
Score: 0
Goural avatar
Terraform source Gitlab module
cn flag

I need help with sourcing terraform modules from a gitlab repository with multiple modules in it like ec2, vpc etc. I have two branches in module repo - develop and main. I tried all the ways below but got an error. I am sourcing something like below. I need ssh only, not https.

source = "git::ssh://"
"git::ssh:// ...
Score: 0
sokolata avatar
Gitlab: Possible to specify roles in Azure AD manifest?
cn flag

I already use Azure AD for login to Gitlab and now I want to manage roles (Regular user, Admin user) in Azure AD as well and pass them to Gitlab. Roles can be stored in the Azure Manifest, which are then recognized by the application. Is this also possible for Gitlab CE?

Here is an example for Grafana:

"appRoles": [
                "a ...
Score: 0
Sidekiq crash loop, no jobs run
ec flag

After upgrading GitLab to 14.7, sidekiq fails to stay running, and no jobs are running.

All CI jobs are stuck saying This job depends on upstream jobs that need to succeed in order for this job to be triggered. I also cannot push in this state.

Kubernetes version: 1.21.6 Helm chart version: 5.7.0 (gitlab 14.7.0)

Output of kubectl get pods

NAME                                         READY   STATUS      R ...
Score: 0
In Gitab repo Merge Requests shows "Checking pipeline status" as stuck
ca flag

We recently updated gitlab server and we can see for some repos while creating Merge Requests we can see "Checking pipeline status" as stuck. We verified and confirmed settings for "Pipelines must succeed" is not enabled for this repo and also this repo has no .gitlab-ci.yml. On these job we had jenkins pipeline jobs as web hook. In its empty.

But for other rep ...

Score: 0
Nightbird avatar
Starting Gitlab 14.6.3 Docker (custom ports) without errors but webserver not reachable
br flag

I am trying to run gitlab docker image 14.6.3 with custom ports for HTTP (60000) HTTPS (60001) and SSH (60002).

For this, I created the folder /srv/gitlabNB/ and started the instance like so:

 sudo docker run --detach \
 --hostname \
 --publish 60000:60000 --publish 60001:60001 --publish 60002:60002 \
 --name gitlabNB \
 --restart always \
 --volume /srv/gitlabNB/config:/etc/gi ...
Score: 0
Gitlab-runner using Virtualbox VM stuck in 'poweroff' state
ph flag

The Problem

After a specific project runs on my CI, virtualbox hangs while trying to 'poweroff' the VM. vboxmanage list runningvms shows nothing, but ps ax | grep VBoxHeadless shows the process is still running, and vboxmanage controlvm <VMName> poweroff throws error: The virtual machine is being powered down. It will sit like this indefinitely until I manually kill the process.

The Details

Score: 0
Sam avatar
How to detect traffic change and trigger GitLab pipeline?
cn flag

We have two etcd clusters running in Kubernetes one act as primary(A) and the second one act as backup(B). We also have etcdctl make-mirror in place between these two clusters, now the problem is if we switch traffic from cluster A to B then cluster B becomes primary, and cluster A becomes the backup cluster. There is an F5 load balancer in front of these two clusters.

I'm looking for a mechanism/trigg ...

Score: 0
cr001 avatar
Openssl s_client shows CONNECT_CR_SRVR_HELLO only when -servername option provided
tr flag

I have an HTTPS-enabled centOS7 server setup with GitLab/nginx, with an A record registered on a payed DNS and certificate verified by Let's Encrypt. (I will use here). The domain name has been tested to be accessible at least via ssh and plain HTTP.

With HTTPS, I can connect to the server using direct IP like https://x.x.x.x . Although the unsafe certificate error will pop up (due to  ...

Score: 1
How to automatically link commit-history to a ticketing system?
cn flag

Our organization uses Gitlab to host all our git-repositories. Most commits refer to one (sometimes more) Jira-tickets and/or other issue-trackers. Something like:

Add a widget to the trinket

Jira: FOOBAR-1117
ServiceNow: INC0000001319

or even simply:

FOOBAR-1119: add a bell to the wistle

The commit-messages themselves are, obviously, in plain text -- and that's, how it should be. However, when vie ...

Score: 0
Suggestions for backup plans on Godaddy VPS
in flag

I have subscribed for GoDaddy VPS, where I am hosting GitLab servers. I would like to understand the backup methodologies used in the industry, to keep the data secure. I know GoDaddy provides a weekly automatic backup plan. I'm interested in daily backup plans if available.

Score: 0
How to pass enveronment variable in gitlab to setup cicd gitlab-ci.yml
in flag

Running with gitlab-runner 14.5.2 (e91107dd) on ibrahimrunner a8c7nx2r Preparing the "shell" executor 00:00 Using Shell executor... Preparing environment 00:00 Running on ip-172-31-5-177... ERROR: Job failed: prepare environment: exit status 1. Check for more information

I have install gitlab server in one aws ec2 and in the same ...

Score: 0
Can Poyrazoğlu avatar
Moving raw GitLab repositories to a new GitLab instance with access to old disk image but no backups
cu flag

I need to move all the data from a NON-BOOTING (so I can't create a GitLab backup normally) GitLab instance on EC2 to a fresh instance. I do NOT have GitLab backups, but have access to full disk of the old instance.

I have:

  • Detached the volume from the old, non-booting instance
  • Launched a new EC2 instance
  • Attached the volume to the new instance (not as the root volume, as an additional volume as ...