I am trying to connect a local artifactory running on a laptop in docker to a remote artifactory on AWS behind an ELB - artifactory

I have set up Artifactory OSS Version 6.9.1 on an AWS instance behind an ELB and have been successfully deploying builds to it from GitLab CI/CD. I am now trying to set up a local Artifactory OSS Version 6.10.0 on my laptop so that I can develop builds locally before sharing with the team.
My local artifactory connects perfectly to JCentre and I can browse that repository.
My gradle build will happily connect to the AWS hosted artifactory at http://{URL}/artifactory and resolve my dependencies.
When I connect a remote repository with http://"{URL}/artifactory I get a 500 Internal Error message on Test. If I take off the /artifactory it says it has connected successfully but when I try to browse the remote repo it is empty.
I read Connect one Artifactory to another Artifactory and followed the instructions to edit the json configuration and make the remote repository a smart repository here https://www.jfrog.com/confluence/display/RTF/Smart+Remote+Repositories.
It now has the smart repository image but still cannot be browsed.
Gradle still cannot resolve dependencies with the local artifactory using the remote-repo name.

As stated in the Smart Remote Repository documentation, you should configure the remote repository URL with the following structure:
http://ARTIFACTORY_URL/api/package-type/repository-key
So if you have a Gradle repository named "gradle-test", the URL should be:
http://ARTIFACTORY_URL/api/gradle/gradle-test
Hope this helps.

In the end it turned out to be ridiculously simple. When setting up the remote repository the key needs to be in the url as well as the key field.
So for a repo with a repository key 'fractal' the connection URL is counter-intuitively http:///artifactory/fractal

Related

Artifactory to Artifactory remote repos

i have 2 Artifactory server and have configured ubuntu repos.
One off the artifactorys goes to internet to ubuntu and the other
artifactory connects to the artifactory with internet access.
I have the following problem. From my local artifactory i get always the error 404.
I cant fetch the metafile (Packages) from the ubuntu repo.
But if i reconfigure my remote repo and set --> store artifacts locally all seems fine.
I want store the artifacts locally. My local artifactory should ask the artifactory with internet access and should get all files from the remote artifactory.
Have anyone a idea how to solve my problem?
best regards
I assume you are trying to set up a smart remote repository with Artifactory. Refer to this wiki and set up the smart remote repository, basically, you should be adding the URL in your local Artifactory's remote repository as http://ARTIFACTORY_URL/ubuntu-remote/ and make sure the "store artifacts locally"is checked so that this remote repository can able to index the artifacts.

VSTS dotnet restore corporate (or self-signed) certificate issue

I am trying the dotnet restore command on the build step process. My nuget store is in Artifactory. Despite installing the corporate certificate, i am getting a SSL issue. My VSTS agent is running in a Ubuntu container on kubernetes
Retrying 'FindPackagesByIdAsyncCore' for source 'https://<artifactory url>/nuget/FindPackagesById()?id='Client.HostingStartup'&semVerLevel=2.0.0'.
The SSL connection could not be established, see inner exception.
The remote certificate is invalid according to the validation procedure.
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
Do we need to do any addition steps for the VSTS agent to pick up self-signed certificates?
If it is not working by installing the corporate certificate in the ubuntu container which hosts your VSTS agent. You can try below workarounds:
1, Create a Nuget service connection to authenticate Artifactory nuget server.
You can create the service connection by adding a new Credentials for feeds ... in the dotnet restore task. See below: Click + New
Then enter your credentials for Artifactory server. See below screeshot.
Another possible workaround is creating a Artifactory Service Connection and use Artifactory Nuget task to restore your packages. See Artifactory Azure DevOps Extension for more information.
Install JFrog Artifactory extension to your azure devops organziation. Then add Artifactory Nuget Task in your pipeline to restore your package.
Click + New from Artifactory Nuget task to add an Artifactory service connection.

What is the difference between local repository, remote respository and virtual repository in JFrog Artifactory

Could someone please explain what's are these 3 types of repos local, remote and virtual in JFrog Artifactory. , I'm not getting a clear picture of it from JFrog Artifactory documentation.
https://www.jfrog.com/confluence/display/RTF/Configuring+Repositories
Local repositories are physical, locally-managed repositories into which you can deploy artifacts.
A remote repository serves as a caching proxy for a repository managed at a remote URL (which may itself be another Artifactory remote repository).
Artifacts are stored and updated in remote repositories according to various configuration parameters that control the caching and proxying behavior. You can remove artifacts from a remote repository cache but you cannot actually deploy a new artifact into a remote repository.
A virtual repository (or "repository group") aggregates several repositories with the same package type under a common URL.

'authenticationrequired' error on accessing debian repository

I am trying to create a remote repository with Artifactory to a Debian mirror (http://ftp.uni-stuttgart.de/debian/) repository. It doesn't matter which one I try, I always get the same error message:
Connection failed: Error 407: authenticationrequired
A Artifactory-wide proxy is configured and already working for NuGet, Maven and NPM package repositories.
Accessing the above mentioned repository via browser does not require any authentication.
What could be the reason for that?
Problem solved: Only connections using HTTPS are allowed. Perhaps as for accessing the Artifactory server itself HTTPS is used already, no degredation of communication channel is allowed.

Proxy https://flywaydb.org/repo repository using Nexus OSS?

I'm trying to proxy https://flywaydb.org/repo using Nexus Repository OSS v2.13.0 because we rely on flyway-sbt sbt plugin.
I can download the plugin fine if I add
resolvers += "Flyway" at "https://flywaydb.org/repo"
to plugins.sbt
But we want to proxy the artefacts using a local Nexus repository because we don't want our builds to depend on a server that is outside our control.
However when I add the server to Nexus (using Maven2 as provider and format) Nexus is unable to proxy artefacts and I get following error in logs:
[proxy-3-thread-5] admin org.sonatype.nexus.proxy.maven.maven2.M2Repository - Remote peer of proxy repository "flywaydb.org" [id=flywaydb.org] threw a org.sonatype.nexus.proxy.ItemNotFoundException exception. Auto-blocking this repository to prevent further connection-leaks and known-to-fail outbound connections until administrator fixes the problems, or Nexus detects remote repository as healthy. - Cause(s): Remote peer of repository M2Repository(id=flywaydb.org) detected as unavailable.
I would be happy to hear if somebody was able to get this working. We successfully proxy several other external repositories.
The problem was that we ran Nexus using an old Java 6 version. Java threw an exception which seems to be related to SSL communication. Running Nexus using Java 8 solved the problem for us.

Resources