Proxy Settings Aren't Working

View: New views
2 Messages — Rating Filter:   Alert me  

Proxy Settings Aren't Working

by leojhartiv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm currently running Nexus 1.3.3.

In order to access public repositories, I've set up the proxy settings in Nexus' System settings to be (names changed to protect the innocent):

<globalHttpProxySettings>
    <proxyHostname>http.some.proxy.address.com</proxyHostname>
    <proxyPort>1234</proxyPort>
</globalHttpProxySettings>

Nexus has been running and functioning fine for months now.  

Today, for some reason, Nexus has decided that it can no longer download JAR artifacts from Maven Central (or any other remote repository).  One artifact in particular I'm trying to grab is the 1.2.1 jar from here:

http://repo1.maven.org/maven2/commons-fileupload/commons-fileupload/1.2.1/

I initially figured it was some problem with my cache or index, so I asked Nexus to reindex.  Here's the error message I receive when I do this:

2009-06-22 10:54:28 INFO  [pool-1-thread-1] - o.s.n.f.FeedRecorder:default  - Reindexing repository Maven Central from path null and below. : Process started on Mon Jun 22 10:54:28 EDT 2009, not yet finished.
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.i.IndexerMana~:default  - Trying to get remote index for repository central
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.p.r.Repository:maven2   - Expiring local cache in repository ID='central' from path='/.index'
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.p.r.Repository:maven2   - Clearing NFC cache in repository ID='central' from path='/.index'
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.p.s.r.RemoteR~:apacheH~ - Remote storage settings change detected, updating HttpClient...
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.p.s.r.RemoteR~:apacheH~ - ... proxy setup with host http.some.proxy.address.com
2009-06-22 10:55:42 WARN  [pool-1-thread-1] - o.s.n.i.IndexerMana~:default  - Cannot fetch remote index:
org.sonatype.nexus.proxy.StorageException: Tranport error while executing GET method
        at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.CommonsHttpClientRemoteStorage.executeMethod(CommonsHttpClientRemoteStorage.java:512)
        at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.CommonsHttpClientRemoteStorage.retrieveItem(CommonsHttpClientRemoteStorage.java:133)
        at org.sonatype.nexus.index.DefaultIndexerManager$1.retrieve(DefaultIndexerManager.java:688)
        at org.sonatype.nexus.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:178)
        at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:103)
        at org.sonatype.nexus.index.DefaultIndexerManager.updateRemoteIndex(DefaultIndexerManager.java:720)
        at org.sonatype.nexus.index.DefaultIndexerManager.updateIndexForRemoteRepository(DefaultIndexerManager.java:592)
        at org.sonatype.nexus.index.DefaultIndexerManager.downloadRepositoryIndex(DefaultIndexerManager.java:559)
        at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:473)
        at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:429)
        at org.sonatype.nexus.DefaultNexus.reindexRepository(DefaultNexus.java:1324)
        at org.sonatype.nexus.tasks.ReindexTask.doRun(ReindexTask.java:40)
        at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.java:139)
        at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.java:342)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:65)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:168)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
        at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
        at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
        at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
        at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
        at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
        at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.CommonsHttpClientRemoteStorage.executeMethod(CommonsHttpClientRemoteStorage.java:483)
        ... 20 more
2009-06-22 10:55:42 INFO  [pool-1-thread-1] - o.s.n.i.IndexerMana~:default  - Cascading merge of group indexes for group 'public', where repository 'central' is member.

From what I can ascertain from other posts on this mailing list, this suggests that the proxy settings are not working.  I've verified that the proxy server is up and running by changing Maven's settings.xml file to not us Nexus, but hit Maven Central directly.  Everything works fine.  The problem seems to be in Nexus.

Any ideas?

Re: Proxy Settings Aren't Working

by leojhartiv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

FYI: a restart of the Tomcat instance upon which Nexus was deployed on made the problem go away.  It was not enough to just unload/reload Nexus.  The problem persisted until the JVM was killed.


leojhartiv wrote:
I'm currently running Nexus 1.3.3.

In order to access public repositories, I've set up the proxy settings in Nexus' System settings to be (names changed to protect the innocent):

<globalHttpProxySettings>
    <proxyHostname>http.some.proxy.address.com</proxyHostname>
    <proxyPort>1234</proxyPort>
</globalHttpProxySettings>

Nexus has been running and functioning fine for months now.  

Today, for some reason, Nexus has decided that it can no longer download JAR artifacts from Maven Central (or any other remote repository).  One artifact in particular I'm trying to grab is the 1.2.1 jar from here:

http://repo1.maven.org/maven2/commons-fileupload/commons-fileupload/1.2.1/

I initially figured it was some problem with my cache or index, so I asked Nexus to reindex.  Here's the error message I receive when I do this:

2009-06-22 10:54:28 INFO  [pool-1-thread-1] - o.s.n.f.FeedRecorder:default  - Reindexing repository Maven Central from path null and below. : Process started on Mon Jun 22 10:54:28 EDT 2009, not yet finished.
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.i.IndexerMana~:default  - Trying to get remote index for repository central
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.p.r.Repository:maven2   - Expiring local cache in repository ID='central' from path='/.index'
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.p.r.Repository:maven2   - Clearing NFC cache in repository ID='central' from path='/.index'
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.p.s.r.RemoteR~:apacheH~ - Remote storage settings change detected, updating HttpClient...
2009-06-22 10:55:32 INFO  [pool-1-thread-1] - o.s.n.p.s.r.RemoteR~:apacheH~ - ... proxy setup with host http.some.proxy.address.com
2009-06-22 10:55:42 WARN  [pool-1-thread-1] - o.s.n.i.IndexerMana~:default  - Cannot fetch remote index:
org.sonatype.nexus.proxy.StorageException: Tranport error while executing GET method
        at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.CommonsHttpClientRemoteStorage.executeMethod(CommonsHttpClientRemoteStorage.java:512)
        at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.CommonsHttpClientRemoteStorage.retrieveItem(CommonsHttpClientRemoteStorage.java:133)
        at org.sonatype.nexus.index.DefaultIndexerManager$1.retrieve(DefaultIndexerManager.java:688)
        at org.sonatype.nexus.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:178)
        at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:103)
        at org.sonatype.nexus.index.DefaultIndexerManager.updateRemoteIndex(DefaultIndexerManager.java:720)
        at org.sonatype.nexus.index.DefaultIndexerManager.updateIndexForRemoteRepository(DefaultIndexerManager.java:592)
        at org.sonatype.nexus.index.DefaultIndexerManager.downloadRepositoryIndex(DefaultIndexerManager.java:559)
        at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:473)
        at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:429)
        at org.sonatype.nexus.DefaultNexus.reindexRepository(DefaultNexus.java:1324)
        at org.sonatype.nexus.tasks.ReindexTask.doRun(ReindexTask.java:40)
        at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.java:139)
        at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.java:342)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:65)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:168)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
        at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
        at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
        at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
        at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
        at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
        at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.CommonsHttpClientRemoteStorage.executeMethod(CommonsHttpClientRemoteStorage.java:483)
        ... 20 more
2009-06-22 10:55:42 INFO  [pool-1-thread-1] - o.s.n.i.IndexerMana~:default  - Cascading merge of group indexes for group 'public', where repository 'central' is member.

From what I can ascertain from other posts on this mailing list, this suggests that the proxy settings are not working.  I've verified that the proxy server is up and running by changing Maven's settings.xml file to not us Nexus, but hit Maven Central directly.  Everything works fine.  The problem seems to be in Nexus.

Any ideas?