Error when pointing artifactory to artifactory - maven

I have an instance of Artifactory installed locally. Within the instance, I am able to create references to other remote repositories.
Now, I have another instance of Artifactory, which exposes its own repository: .../remoteArtifactory/repo
I am trying to point to this repo in the first instance of Artifactory.
But in doing so, I have:
Connection failed with exception: Circular redirect to
".../remoteArtifactory/repo"
What am I doing wrong here?

I had exactly the same problem as you, and fixed it by completely ignoring that error message and saving the repository. To reiterate:
Ensure you have the correct path to the remote repository, eg: http://host:8080/artifactory/libs-release-local/
Click Test, and you'll get the Connection failed with exception: Circular redirect to - Ignore this!
Click Save
Note: different versions of Artifactory have slightly different paths/URLs. This caused me a little grief.
Remote Repository Settings
I guess it's worth mentioning that I needed to specify the local proxy server (TdmsProxy).
Also, to confirm that you've got the correct path to the remote instance, check that you can receive a POM via the browser (or wget) from it, eg:
http://your-remote-repo:8080/artifactory/libs-releases-local/com/company/area/project/version/project-version.pom
Once, you've received the POM, just use the first part of the URL, eg:
http://your-remote-repo:8080/artifactory/libs-releases-local/
(I realise you've probably checked your path at least 10 times, but this bit me!)

Related

Maven returns "401 Unauthorized" when attempting to download Apache SOLRJ artifact

I'm having issues when I build my project using Maven and it attempts to download an artifact from my privately hosted Artifactory repository. I have a large number of artifacts used by my project that are stored in this Artifactory instance. It downloads many of them fine during the build process, but when it gets to the org.apache.solr SOLRJ artifact download, it fails with a "401 Unauthorized" error.
I know my configurations in my Maven project POM file and my local Maven settings file are correct (repo ID matches, username and password entered, etc.) because it successfully downloads the first half of the artifacts referenced in my project and only fails when it gets to the SOLRJ artifact. In addition, when I navigate to the repo in a browser window, I can freely navigate the tree and view other artifacts without providing credentials, but when I try to click on the link for the org.apache.solr folder, it prompts me for credentials and none of my known credentials work, even though I know the username and password are correct. So it seems the issue is isolated to this one artifact.
I have copied the org.apache.solr contents from another local repository to attempt to get it to skip downloading the file, but it is still trying to download even though it would appear the version is correct and matches.
I am confused why, when navigating the repo in the browser, this one folder in the repo would be prompting for authentication when no other artifacts are behaving the same way, and why none of my username/passwords entered (including the administrator username/password) are being recognized and accepted.
Any help is greatly appreciated to either a) point me in the right direction to make that artifact behave like the others and not require a username/password, or b) get my build to recognize that I've already got the files in the local repository so it doesn't need to download them again.

Artifactory - Problems with overit-central and This item is not cached

We've been experiencing problems with our overit-central repository on Artifactory. Some elements appear as "not-cached" and while trying to retrieve them from a build, we're encountering an "element not found" error. That same element does exist in the overit-central repo, but somehow our Artifactory instance doesn't seem to find it or cache it. (The problem doesn't happen with all the elements of the repo, and we don't know why. Some of them are actually cached)
We've already run a re-index of said repository but still the "This item is not cached" continues to appear.
We tried creating a new remote repository hooked to the same url and running some maven re-indexes from Artifactory, but it didn't help.
How do we force the caching of the elements from Artifactory? The documentation in the JFrog support page mentions it, but doesn't explain how to do it.
Thank you in advance
Regards
A remote repository in Artifactory is a mirror of the endpoint you have configured. It doesn't download the artifacts by default and this is the reason it says "Artifact is not cached". It is the intended behavior and it lets you know that you have never downloaded this artifact.
In order to cache an artifact, you have to simply download it from the remote endpoint. This can be done in two ways:
From the UI - Right click --> download
Using the API "curl -uUSERNAME:PASSWORD http://ARTIFACTORY_URL:PORT/artifactory/REMOTE_REPOSITORY/PATH_TO_ARTIFACT
Once the artifact is downloaded, it means that it is cached and you will be able to see it in the "name-of-the-remote-repository-cache" repository which shows the downloaded cached artifacts.

Artifactory not downloading some jars or POMS correctly, strange POM parsing error

I set up an artifactory locally, which works great, and then we tried to set one up over our network. I did my best to configure it like the local one. However, we are having issues with artifactory showing weird things in the repo caches. It will say it downloaded a jar but the jar is actually corrupt. Also, it doesnt put the POM in the cache. Looking at the logs, I am getting this type of error over and over:
[ERROR] (o.a.r.HttpRepo :294) - jcenter: Failed to download 'http://jcenter.bintray.com/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom'. Received status code 200 and caught exception: Failed to read POM for 'org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom': Expected root element 'project' but found 'html' (position: START_TAG seen ...TD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n\n... #3:7) .
I tried supressing POM consistency checks based on what I saw here, but that didnt work.
It's most certainly a proxy misconfiguration. Artifactory tries to download files from jcenter and gets an error message from the proxy. Two problems here:
Artifactory is not configured to use a proxy to get to outside world (to jcenter, namely).
Proxy itself is misconfigured and returns status code 200 on an error (and emits error message in html page).
Combination of the two brings to wierd situation when Artifactory thinks it stored the file correctly, when actually some error html page is stored. Since you have the pom consistency checks turned on, Artifactory tries to parse the pom on save and fails.

Apache Archiva not caching?

I've just set up Archiva and I'm testing it. I'm trying to get mysql-connector-java and I'm expecting it to not find it in the internal repository, download it from the central repository and then cache it.
When I check <archiva>/data/repositories/internal, however, it's empty. Also Browse in the admin pages is empty and Search won't return anything.
I'm assuming this means that it's not storing the artifact and that it will get it from the central repo again next time. I'm also assuming I'm not getting something so some help would be great.
My bad - I was using the wrong URL for the repository. I had http://myrepo:8080/archiva and it needed http://myrepo:8080/archiva/repository/internal so it was going to central repo directly. Works fine now.

SVN Server with single repo and no root path

I have a strange SVN server configuration issue I cannot figure out.
A previous employee setup Collabnet svn server (version 1.6.9) on a windows server at work which we use for development. It's a great system, love using it.
We use a local LAN path for the repository with all our various folders, like this...
"svn://server1"
It has one repository called "repo".
I have recently installed a second SVN on another server (same version, same OS)
It has one repository called "main". In order to access it I have to use the svn path of ...
"svn://server2/main"
So the question is.... does anyone know how we ended up with one server requiring to use a "repo name" after the server name (and does not work without it) and one server not requiring a "repo name" (and does not work with it)?
The main reason for asking is I also need to setup additional repositories on the original server and do not want to affect the current configuration. I assume this is some level or option or configuration or a "default repo" setting or something, but I just can't seem to find where and how it was set.
Check the entry in your conf file. If you have your svn information within a location tag, the location is the only way to access the repository.

Resources