fatal: repository 'http://' not found. When i try to execute the pipeline Gitlab CI/CD - gitlab

When i try to execute the pipeline in gitlab ci, i get an error like fatal: repository 'http://practice-host.dfsystems.ru/gitlab-instance-8435ed1c/objective.git/' not found
enter image description here
My gitlab-runner deployed in kubernetes cluster
enter image description here
Deployed with helm with this yaml file:
enter image description here
I did ssh-keygen in gitlab-runner and added in gitlab ssh-keys, but still not working
This pipeline what i use now
enter image description here
If you have any idea, i will appreciate it <3

Here are some steps you can try to resolve the issue:
Verify the repository URL: Make sure that the URL you're using is correct and that you have access to the repository.
Check the GitLab instance: If you're using a self-hosted GitLab instance, check that it is accessible and reachable from the GitLab CI runner.
Check authentication: If the repository is private, make sure that the GitLab CI runner has the necessary access token or SSH key to clone the repository.
Check network connectivity: Ensure that the GitLab CI runner has network connectivity to the GitLab instance and the repository.

Related

How do I force gitlab runner to use the host's domain name instead of ip address?

My company has a bitnami gitlab installation that we self-host. While I manage the gitlab installation, I am not an expert on it by any stretch. A few months back, I configured a project to use a gitlab runner in order to perform unit tests when the project is committed.
Today, when I pushed a commit, the gitlab runner tried to pull from the ip address using ssl. How do I tell it to pull the commit using the domain name?
I want it to use https://gitlab.ourcompany.com but it is using https://10.1.3.3
NOTE: not our real ip address or host name:
Getting source from Git repository
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/full-stack/apigw/.git/
fatal: unable to access 'https://10.1.2.3/full-stack/apigw.git/': SSL: no alternative certificate subject name matches target host name '10.1.2.3'
I found the answer after posting the question. Leaving both here for others.
It turns out that our gitlab.rb config file had the external_url set incorrectly. Here are the steps to change that:
/etc/gitlab/gitlab.rb
# other entries omitted for brevity
# was external_url 'https://10.1.2.3'
external_url 'https://gitlab.ourcompany.com'
Then reload your settings:
sudo gitlab-ctl reconfigure

How to solve the problem Host key verification failed

I created a .gitlab-ci.yml file.
the project is already in the remote server.
I created gitlab-runner in my remote server and I chose the shell option.
my file .gitlab-ci.yml just makes the update for the project i.e. (we will do "git pull origin master"
and here is my .gitlab-ci.yml script
stages:
- build
before_script:
- cd/home/devops/projects/my-project
building:
stage: build
script:
- git status
- sudo git pull origin master
when I run the pipeline i get this error.
$git pull origin master.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists. "
please how could we solve this problem?
I'm really stuck with this problem
thank you so much
It seems like an issue with your ssh keys between the gitlab-runner host and gitlab. This topic might answer your question:
Git-error-host-key-verification-failed-when-connecting-to-remote-repository
Basically, log in your gitlab-runner host and check ${HOME}/.ssh/known_hosts. You should see the current public key from your gitlab host. If not, you will need to remove it and update it.

Permission Denied for deploying in GitHub using travis-CI

I am working on a project which I want to publish in GitHub pages. To automate the deploying process I'm using Travis CI. For this I have created a deploy.sh file, which has the following code.
# build
npm run docs:build
# navigate into the build output directory
cd docs/.vuepress/dist
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io
# git push -f git#github.com:<USERNAME>/<USERNAME>.github.io.git master
# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f git#github.com:<username>/<repo>.git master:gh-pages
cd -
I have added this in my .travis.yml file, which is below
language: nodejs
node_js:
- "lts/*"
before_script:
- npm install
script:
- bash ./scripts/deploy.sh
Now when I push my code to the master, In travis-ci.org it shows that the build is failed, with the following outputs,
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The command "bash ./scripts/deploy.sh" exited with 128.
I have followed other SO answers of the same type of errors like this link and also followed the way to generate and adding ssh key to my GitHub account but no success. I will be grateful if you could help me out. Thank you.
If you want to push via ssh then travis needs to have access to the private part of the ssh key you generated. What you want to do is use the travis cli gem to encrypt the private key, add it to your repo and during the deploy stage decrypt it again and use it.
Here's a step-by-step

Push repository with all commits to gitlab server

We have recently lost access to our gitlab VM so we are unable to access our repositories. Is there any way to push our local repositories with all of their commits to a new gitlab server? We understand there's no way to restore issues, todos, etc.
Regards
As this question explains: Import an existing git project into GitLab?
Create the repository on gitlab, add the new remote gitlab to your local repo and push.
git remote add gitlab url-to-gitlab-repo
git push gitlab master -f

travis deployment Couldn't resolve host

I have setup travis-ci to deploy to azure website, travis use dpl for deployment,
but I get unable to resolve host:
fatal: unable to access 'https://username:!password#https://test-ci.azurewebsites.net/.scm.azurewebsites.net:443/https://test-ci.azurewebsites.net/.git/': Couldn't resolve host 'https'
but the actual git url at azure portal is:
https://username#test-ci.scm.azurewebsites.net:443/test-ci.git
As my test, we only need to provide the site name to the .travis.yml file. It is enough (do not use web app url or git url as the value of site). The following is my deploy part in .travis.yml.
deploy:
provider: azure_web_apps
username: "jambor1" # If AZURE_WA_USERNAME isn't set
password: "***" # If AZURE_WA_PASSWORD isn't set
site: "travistestja" # If AZURE_WA_SITE isn't set
verbose: true
Here is the result:
when you are creating deployment credentials don't use '#' character or other special characters which will break the git repository path created by azure local git deployment.
Follow article https://learn.microsoft.com/en-us/azure/app-service-web/scripts/app-service-powershell-deploy-local-git where you will see that git is using username and password both for connecting to git repository, so if there are some difference in actual repository path in azure portal and in travis ci that is not the actual problem.

Resources