GitLab & GitLab CI WebHook Error - gitlab

I'm running GitLab 7.11.4 and GitLab CI 7.11.4, both installed via the Omnibus package. I've been running GitLab for awhile now, but have only just recently enabled the CI service. I have successfully setup GitLab and CI so that they're accessible at [code.subdomain.com] and [ci.subdomain.com] respectively. I've followed the instructions to enable CI access for one specific project, I've setup a runner, and I've made one test shell script for building (Basically: cmake .. && make).
This is where I hit problems. I'm supposed to visit my GitLab project settings page and hit "Test settings". When I do this, I receive the error We tried to send a request to the provided URL but an error occured. gitlab-rails/production.log shows this:
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/[namespace]/[project]/services/gitlab_ci/test" for 127.0.0.1 at 2015-06-17 13:33:54 -0400
Processing by Projects::ServicesController#test as HTML
Parameters: {"namespace_id"=>"[namespace]", "project_id"=>"[project]", "id"=>"gitlab_ci"}
WebHook Error => getaddrinfo: Name or service not known
I've replaced [namespace] and [project] in that log, but they do show the correct entries.
GitLab CI never seems to receive the request and trying to do a test commit on my project also doesn't trigger GitLab CI.
I'm at a loss for what to do and can't seem to find any documentation on what might be causing this issue. Any help or direction is much appreciated.

Problem sort of solved. I had to add a loopback reference into /etc/hosts for ci.subdomain.com.
127.0.2.1 ci.subdomain.com ci
This seems like maybe something I shouldn't have to do if my DNS has properly published my domain? Maybe someone can clarify why this was required.

Related

How to import publicly available jelastic manifests from gitlab repositories in the jelastic dashboard?

I am currently transitioning from github to gitlab. Today, my code is present at both those locations. I have a jps manifest on github:
https://github.com/shopozor/services/blob/master/manifest.jps
and the very same manifest on gitlab:
https://gitlab.hidora.com/softozor/services/blob/master/manifest.jps
In the Jelastic dashboard, I am able to load my github manifest. However, I am not able to load my manifest versioned on gitlab:
What is the problem? Do I have to configure something special somewhere? Both manifests are publicly available. Why can't I import the gitlab manifest?
I also tried to use the raw manifest:
https://gitlab.hidora.com/softozor/services/raw/master/manifest.jps
and I've also tried to get the manifest file by means of the gitlab API, without success.
EDIT
I've tried to load this manifest. There we see that I am running a command
wget "${baseUrl}/jelastic/postgres/execCmdScript.sh" -O /var/lib/pgsql/script.sh 2>&1
In the jelastic console, that command raises the error
[07:56:54 Shopozor.cluster:2]: ERROR: cmd [sqldb: 62900].response: {" result": 4109," source": “JEL”," error": “The operation could not be performed. ”," errOut": ""," nodeid": 62900," exitStatus": 4," out": “--2020-03-27 07:56:53-- https://gitlab.hidora.com/softozor/services/raw/install-postgres-in-dedicated-env/jelastic/postgres/execCmdScript.sh\nResolving gitlab.hidora.com (gitlab.hidora.com)... 10.102.1.82\nConnecting to gitlab.hidora.com (gitlab.hidora.com)|10.102.1.82|:443... failed: Connection refused.”}
If I now take a computer which I never authenticated with on gitlab through ssh, and run that very same command, then it works. This is a bit strange, isn't it? What authentication does Jelastic need??? it's all public and available to anyone, except Jelastic?
After some more research, I was finally able to load my manifests from gitlab into jelastic. The problem is probably due to the gitlab configuration. Loading the jps from the gitlab repo doesn't work over https in the settings I have (which I haven't made myself, it's a CI / CD as a service). It works, however, over http.

Log4j-Audit Getting Started fails for Catalog Editor

Was doing the Log4J-Audit getting started at https://logging.apache.org/log4j-audit/latest/gettingStarted.html
In the Catalog Editor section found some problems:
Download jar url was incorrect, missing "log4j-audit" folder
wget url was incorrect, had an extra 1.0.1 folder
git remote -v was set to ${remoteRepoUrl} instead of actual http://github.com/etc address. And the repo was not pulled. The .git folder was found but the git pull never happened. I think this might be related to proxy server but not sure if git supports a Variable.
Am I doing it wrong or are the instructions incorrect?
Where can I report such a problem?
In the end, I manually changed the
git remote set-url origin http://github.com/etc
did a manual git pull, and then the UI finally came up.
So, #1 and #2 are still a problem.
Because I have a corporate proxy server which also requires a user/password
3 was solved with adding system env vars like this
java -Dhttps.proxyHost=myProxyServer -Dhttps.proxyPort=8080 -jar log4j-catalog-editor-1.0.1.jar
It does seem that the sun.net.HTTPSClient class which is called, does not mention using Basic Auth so not convinced why it works.
A new thing I found in the Getting Started tutorial is that it's important to change the branch=master in the application.properties.

After Gitlab installation can't access gitlab page at VPS

I am trying to install Gitlab on my newly bought VPS(DigitalOcean, Ubuntu), but after the install and reconfigure, I can't get to the setup page of Gitlab. It's just showing the standard apache not found page. I have changed external_url to -> 'http://myip/gitlab'.
The errors I received after changing the url and reconfigure are below:
Error executing action run on resource 'execute[clear the gitlab-rails cache]'
Error executing action run on resource 'execute[create gitlab database user]'
Error executing action run on resource 'bash[generate assets]'
Error executing action restart on resource 'service[unicorn]'
Error executing action restart on resource 'service[sidekiq]'
Error executing action run on resource 'execute[clear the gitlab-rails cache]'
The Lamp stack is installed, and some basic ufw firewall.
I have used the official Gitlab install/download guide:
https://about.gitlab.com/downloads/#ubuntu1604
Using /gitlab is actually not supported from a omnibus installation. You would need to host it on a (sub)domain.
There is however a way to enable this but it will require quite a significant amount of work to enable GitLab to work like you want. There is quite a extensive tutorial in the GitLab Documentation so I recommend you check that out.
After 5 years, there happened a similar issue. since this one has no accepted answer besides being old, I have given an answer to it that seemingly solved the problem.
If someone finds this post, please check if that solves the issue: installed gitlab on ubuntu shows apache default page

Gitlab custom hook not running

We have Gitlab installed on the same server as a dev/staging copy of our test project. Two of us have local working copies with Gitlab as a remote, and are able to push/pull to Gitlab successfully. We also have Gitlab set as a remote in the staging copy of the project, and pulling from Gitlab works there manually as well.
However, when creating a custom hook for Gitlab (as described here), the hook simply fails to run with no errors. The content of the hook is:
#!/bin/bash
echo "Inside post_receive hook"
cd /path/to/staging/copy
git pull gitlab master
...where /path/to/staging/copy is the staging location of the project. Here's the ownership & permissions of the hook:
-rwxr-xr-x. 1 git git 114 Mar 30 10:28 post_receive
When pushing from my working copy to Gitlab, this hook should run, but it doesn't -- the staging copy is not updated, the echo message isn't shown, and the push results message doesn't show any errors.
I have tried a few tips from SO answers regarding setting/unsetting environment variables, and they didn't help. I'm out of ideas. Does anyone know why the custom hook isn't running?
Of course, this was my fault. I mis-named the hook with an underscore instead of a dash. Hook now fires appropriately.

How do I start using Gitlab-CI in Gitlab Omnibus edition?

I have installed Gitlab Omnibus gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm on CentOS 6.6. I have a few projects created and working fine but I would like to try using the continuous integration features. I don't know where to start and documentation/tutorials are thin on the ground.
I have found the following files that do not appear in an older Gitlab omnibus install I have:
/usr/bin/gitlab-ci-rake
/usr/bin/gitlab-ci-rails
I presume I need to do something with these? But do I need a configuration file first?
In my projects (Settings > Services > Gitlab CI) I can see there are options for Active, Token and Project Url but I do not know what to put in these fields.
Any help to get me started on CI would be appreciated. Cheers,jonny
We recently installed the omnibus GitLab 7.6.2 release which has GitLab CI 5.3 built in. I had the same question. Here's how we got it working.
We're using a single secured server over https; single ip for both gitlab and gitalb-ci hosts.
We have dns entries for both host names to a single ip. (Done with an alias for the ci server I think). We have two ssl certificates one for each hostname.
We have the following lines at the top of the /etc/gitlab/gitlab.rb script (found by searching the gitlab site for rb file setup details):
external_url 'https://gitlab.example.edu'
nginx['redirect_http_to_https'] = true
ci_external_url 'https://gitlab-ci.example.edu'
ci_nginx['redirect_http_to_https'] = true
For http, leave out the nginx statements.
If gitlab-ci url displays the gitlab site contents then the ci_nginx statement needs to be corrected.

Resources