I am trying to upload the artifact to Nexus repository using the Artifact deployment stage in the Jenkins pipeline. For doing this I am providing Jenkins with the Nexus credentials and the path to find the repository. But, this stage is failed with an error "the connection is refused to nexus".
However, I am able to access Nexus on http://localhost:8081/nexus.
Below is the code used in pipeline_config.yml file.
artifactDeployment:
nexus:
version: nexus2
url: 'http://localhost:8081/nexus/'
repository: myrepo
credentialsId: 'nexus'
additionalClassifiers:
- type: jar
classifier: classes
Could someone please suggest in resolving this issue?
On your VM, login to your Jenkins container
ex
docker exec -it s4sdk-jenkins-master bash
Then execute curl command to reach the nexus from there.
ex
curl http://<your VM's IP>:8081/nexus
You will be able to upload artifact to nexus, only if the host is reachable from within the Jenkins container.
this looks very much like an issue with the localhost URL. From within the Jenkins container, localhost refers to that container, and not to your local Nexus.
The solution should be to use the hostname of the Nexus in your pipeline config. It looks like this is the hostname of your laptop in this case.
Hope this helps.
Best regards,
Florian
If You have Jenkins and Nexus container, So:
Change localhost: 8081 to address ip host, eg 192.168.0.3:8081
I fixed problem in my environment local.
I hope can helps!
Related
I have installed the recent patch (jfrog-artifactory-oss-7.21.5-windows.zip) and post installation, I am not able to reach the UI of Jfrog. Below is the screen, that I am getting. Is this a known issue?
Maryo - I think you are hit by this issue: jfrog artifactory could not validate router error
Can you update your system.yaml (will be in var/etc/ folder) with the following and try? If there is no system.yaml, add one with user artifactory as the owner of the file.
shared:
node:
ip: <your ipv4 IP>
I've really tried to understand artifactory and to use artifactory as a proxy to get packages and files from public registries and github but haven't got it to work yet.
Github repository key in artifactory:
github.com
File I want:
https://github.com/nvm-sh/nvm/archive/v0.37.2.tar.gz
I have tried to reach it through a machine with command:
wget https://artifactoryenterprise.corp.com/github.com/nvm-sh/nvm/archive/v0.37.2.tar.gz
But it just timed out.
I'm not sure if it is relevant now, but I assume the issue is with the repo key "github.com" which is causing the DNS resolution difficult. Can you test out by creating a generic remote repository with repo key as "githubcom" and wget the file as below
wget https://artifactoryenterprise.corp.com/artifactory/githubcom/nvm-sh/nvm/archive/v0.37.2.tar.gz
I am trying to configure Jenkins to work with Gitlab.
Currently, I have set Gitlab host URL in the Jenkins configure page as https://gitlab.example.com, which results in the following error:
HTTP ERROR 403
Problem accessing /descriptorByName/com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig/checkUrl. Reason:
Forbidden
As I understand it, the Gitlab host URL is specified under external_url in the /etc/gitlab/gitlab.rb file. However, this file doesn't exist on my local machine. I believe it's created when gitlab is installed but I am unsure it is possible to install gitlab on a mac as I have thus far been unable to find any instructions as to how to do so.
Where would I find the correct gitlab host URL in this case?
when build a dockerfile.
FROM ruby:latest
MAINTAINER ...
I receive some info:
Pulling repository docker.io/library/ruby
bfe1e909440a: Download complete
33a372e3ad95: Download complete
1230b07f5c40: Download complete
0ebd84a329dd: Download complete
...
Pulling repository docker.io/library/ruby
Tag latest not found in repository docker.io/library/ruby
I try with run in console 'docker pull ruby' , it through the same error.
Is it a problem of docker server?
You Probably have some kind of connection issue. I get that when I'm using free (unreliable) proxy servers.
You can also try to restart your aws instance and check again.
So, we have permissions setup on who can push to the docker registry in artifactory. Now, I created a dockercfg file in $HOME/.dockercfg on my mac and added the username and passing using the curl command:
curl -uaaaaa:bbbbbbb "https://docker.io/v2/auth" >> $HOME/.dockercfg
After that when I try to push an image to docker registry, it fails with the below error:
unauthorized: The client does not have permission to push to the repository.
When I look at the docker request.log in the registry, I see its trying to push as anonymous from my mac. This is very confusing. Even though I have the $HOME/.dockercfg which has a user.
I also tried the docker login docker.io way but that too isnt helping.
It seems that the artifactory docker registry isnt able to find the user info when I am pushing from my mac and shows as anonymous.
My artifactory server version is 4.5.0 and docker 1.12.0-rc2.
Can anybody please help.
To the best of my knowledge Docker 1.12 no longer supports configuration placed under ~/.dockercfg instead it should be placed under ~/.docker/config.json --> In any case the method you're using was relevant for the older docker clients, you should use docker login to authenticate your docker client with Artifactory.
As a side note, Your version of Artifactory is a bit old - newer versions have made significant changes to support the newer Docker versions so you should upgrade before trying again.
Also remember to configure your Reverse Proxy to work with Artifactory and that you also probably need to set up Docker (and your reverse proxy) to use self-signed certificates.