ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Harrigan (JIRA)" <>
Subject [jira] Created: (IVY-1234) Ivy fails to publish to remote repository IF a proxy is set and the proxy has NO credential requirements.
Date Mon, 27 Sep 2010 20:01:33 GMT
Ivy fails to publish to remote repository IF a proxy is set and the proxy has NO credential

                 Key: IVY-1234
             Project: Ivy
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.2.0-RC1
         Environment: Snow Leopard 10.6.4 running Squid 3.0 and Artifactory 2.2.5
            Reporter: David Harrigan

I've just come across this problem and I believe it's critical. I've searched on JIRA for
similar issues and I can't find anything.

I have this configured in my ivysettings.xml:

<credentials host="localhost" realm="Artifactory Realm" username="admin" passwd="password"/>

Which is the default credentials for Artifactory 2.2.5.

I have this resolver as a remote:

 <url name="artifactory-snapshots">
                <ivy pattern="http://localhost:8081/artifactory/libs-snapshots-local/[organisation]/[module]/[revision]/ivy-[revision].xml"
                <artifact pattern="http://localhost:8081/artifactory/libs-snapshots-local/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"

Whenever I attempt to publish, Ivy is reporting this issue:

/Users/david/development/tmp/ant/includes/ivy.xml:25: impossible to publish artifacts for;0.1.0-SNAPSHOT: Access to URL http://localhost:8081/artifactory/libs-snapshots-local/
was refused by the server: User anonymous is not permitted to deploy ''
into ''.
	at org.apache.ivy.util.url.AbstractURLHandler.validatePutStatusCode(
	at org.apache.ivy.util.url.BasicURLHandler.upload(
	at org.apache.ivy.util.url.URLHandlerDispatcher.upload(
	at org.apache.ivy.util.FileUtil.copy(
	at org.apache.ivy.plugins.repository.url.URLRepository.put(
	at org.apache.ivy.plugins.repository.AbstractRepository.put(
	at org.apache.ivy.plugins.resolver.RepositoryResolver.put(
	at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(
	at org.apache.ivy.core.publish.PublishEngine.publish(
	at org.apache.ivy.core.publish.PublishEngine.publish(
	at org.apache.ivy.core.publish.PublishEngine.publish(
	at org.apache.ivy.Ivy.publish(
	at org.apache.ivy.ant.IvyPublish.doExecute(
	at org.apache.ivy.ant.IvyTask.execute(
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(

Notice how it is attempting to publish using anonymous credentials.

I am running squid 3.0 on my machine to speed up internet access, but it is an anonymous proxy
- there is no username or password required.

Looking at the latest source from svn, in IvyAuthenticator:

 String proxyHost = System.getProperty("http.proxyHost");
        if (getRequestingHost().equals(proxyHost)) {
            String proxyUser = System.getProperty("http.proxyUser");
            if ((proxyUser != null) && (proxyUser.trim().length() > 0)) {
                String proxyPass = System.getProperty("http.proxyPassword", "");
                Message.debug("authenicating to proxy server with username [" + proxyUser
+ "]");
                result = new PasswordAuthentication(proxyUser, proxyPass.toCharArray());
        } else {
            Credentials c = CredentialsStore.INSTANCE.getCredentials(getRequestingPrompt(),
            Message.debug("authentication: k='"
                    + Credentials.buildKey(getRequestingPrompt(), getRequestingHost()) + "'
c='" + c
                    + "'");
            if (c != null) {
                result = new PasswordAuthentication(c.getUserName(), c.getPasswd().toCharArray());

What appears to be happening is that the requesting host == localhost, it attempts to get
the proxy user, which is subsequently null, it then *completely* skips over the attempt at
line 91 (Credentials c = ...) to retrieve the configured credentials, thus it then attempts
to log in anonymously which fails...

I believe anyone running a proxy on their machine (or more seriously I suppose if their company
has an anonymous proxy between the developer/build machine and the repository) then as it
stands currently, any attempts to publish will fail.

If I can be of any further assistance, please do let me know.


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message