Getting 502 errors when using Maven with Nexus OSS 2.14.5-02

2,972 views
Skip to first unread message

Mehul Sanghvi

unread,
Aug 16, 2017, 9:53:16 PM8/16/17
to Nexus Users
Maven: 3.3.3
Nexus: 2.14.5-02 OSS

Lately we have been getting the following type of errors when doing our builds with Maven:

     Could not transfer artifact org.apache.maven:maven-plugin-api:jar:2.0.4 from/to releases
     Failed to transfer file:
     code is: 502 , ReasonPhrase:notresolvable. -> [Help 1]

This has been happening over the last several weeks with increasing frequency, to the point anyone doing a build with a fresh Maven local repository will run into the issue.   The artefacts themselves are there on the nexus server and are available for download if I use the URL given in a web browser and are available when I look at the Nexus web UI as well, whether I look in the storage or index, makes no difference.

I have re-index all the repositories,  updated the meta-data,  restarted the server, upgraded from 2.14.1 to 2.14.5,  checked the Maven POM files, etc.  So far nothing has provided a solution.  I've looked in the log files for Nexus and that too has not provided any information or clues about what could be happening.

This does not happen with every artefact,  only with certain artefacts, the one above being one of them.  Artefacts like the one above,  which come from Maven Central, I have even tried re-caching them from Central, since we have that behind a proxy.


Has anyone seen this sort of an error ?

Why is is "notresolvable" when the artefact is clearly there in the repository index and storage according to Nexus ? 

Anyway  to track a request through Nexus and to see what is going on ?  Maybe I do not have proper settings for getting the correct information in the logs.

Any ideas for troubleshooting ? 

Suggestions / potential fixes ?   



cheers,

        mehul

Rich Seddon

unread,
Aug 17, 2017, 9:51:55 AM8/17/17
to Nexus Users
The first thing to do is check the nexus request.log file to see if these 502 responses are actually coming from Nexus.  Nexus 2.x generally doesn't return 502, it's almost always something running in front of it that is returning 502.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/a198ca26-bc80-46ee-85de-42775d3bada5%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

Mehul Sanghvi

unread,
Aug 17, 2017, 11:12:11 AM8/17/17
to Nexus Users
My apologies, I forgot to mention that this is a standalone Nexus setup.  There is no server in front of it.


On Thursday, August 17, 2017 at 9:51:55 AM UTC-4, Rich Seddon wrote:
The first thing to do is check the nexus request.log file to see if these 502 responses are actually coming from Nexus.  Nexus 2.x generally doesn't return 502, it's almost always something running in front of it that is returning 502.
On Wed, Aug 16, 2017 at 8:53 PM, Mehul Sanghvi <mehul....@gmail.com> wrote:
Maven: 3.3.3
Nexus: 2.14.5-02 OSS

Lately we have been getting the following type of errors when doing our builds with Maven:

     Could not transfer artifact org.apache.maven:maven-plugin-api:jar:2.0.4 from/to releases
     Failed to transfer file:
     code is: 502 , ReasonPhrase:notresolvable. -> [Help 1]

This has been happening over the last several weeks with increasing frequency, to the point anyone doing a build with a fresh Maven local repository will run into the issue.   The artefacts themselves are there on the nexus server and are available for download if I use the URL given in a web browser and are available when I look at the Nexus web UI as well, whether I look in the storage or index, makes no difference.

I have re-index all the repositories,  updated the meta-data,  restarted the server, upgraded from 2.14.1 to 2.14.5,  checked the Maven POM files, etc.  So far nothing has provided a solution.  I've looked in the log files for Nexus and that too has not provided any information or clues about what could be happening.

This does not happen with every artefact,  only with certain artefacts, the one above being one of them.  Artefacts like the one above,  which come from Maven Central, I have even tried re-caching them from Central, since we have that behind a proxy.


Has anyone seen this sort of an error ?

Why is is "notresolvable" when the artefact is clearly there in the repository index and storage according to Nexus ? 

Anyway  to track a request through Nexus and to see what is going on ?  Maybe I do not have proper settings for getting the correct information in the logs.

Any ideas for troubleshooting ? 

Suggestions / potential fixes ?   



cheers,

        mehul

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.

Peter Lynch

unread,
Aug 17, 2017, 12:08:03 PM8/17/17
to Mehul Sanghvi, Nexus Users
On Thu, Aug 17, 2017 at 12:12 PM, Mehul Sanghvi <mehul....@gmail.com> wrote:
My apologies, I forgot to mention that this is a standalone Nexus setup.   There is no server in front of it.

Did you look in the Nexus request.log and confirm there are 502 responses coming from it that correlate to the URLs reported by the build failures?  
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.

To post to this group, send email to nexus...@glists.sonatype.com.

Peter Lynch

unread,
Aug 17, 2017, 12:15:03 PM8/17/17
to Mehul Sanghvi, Nexus Users
On Thu, Aug 17, 2017 at 1:08 PM, Peter Lynch <ply...@sonatype.com> wrote:


On Thu, Aug 17, 2017 at 12:12 PM, Mehul Sanghvi <mehul....@gmail.com> wrote:
My apologies, I forgot to mention that this is a standalone Nexus setup.   There is no server in front of it.

Did you look in the Nexus request.log and confirm there are 502 responses coming from it that correlate to the URLs reported by the build failures?  


On Thursday, August 17, 2017 at 9:51:55 AM UTC-4, Rich Seddon wrote:
The first thing to do is check the nexus request.log file to see if these 502 responses are actually coming from Nexus.   Nexus 2.x generally doesn't return 502, it's almost always something running in front of it that is returning 502.

On Wed, Aug 16, 2017 at 8:53 PM, Mehul Sanghvi <mehul....@gmail.com> wrote:
Maven: 3.3.3
Nexus: 2.14.5-02 OSS

Lately we have been getting the following type of errors when doing our builds with Maven:

      Could not transfer artifact org.apache.maven:maven-plugin-api:jar:2.0.4 from/to releases
      Failed to transfer file:
      code is: 502 , ReasonPhrase:notresolvable. -> [Help 1]

BTW - I think this ReasonPhrase confirms Nexus is not returning 502. Nexus never returns the word "notresolvable" as the status reason phrase, let alone status code 502.

It looks like the builds are going through a firewall or an HTTP proxy server that is returning that code and reason phrase.

Mehul Sanghvi

unread,
Aug 17, 2017, 1:35:52 PM8/17/17
to Peter Lynch, Nexus Users
I do not see a 502 in the request.log file for the artefacts.   We do not have a firewall between our build machine and the Nexus server,  nor do we have a proxy between those.  I did the following:

bash$ gzcat request*.gz | grep -F " 502 "

and did not get anything.

I created just a stripped down POM file that had a dependency for a couple of the artefacts that we've seen an issue with, including the maven-plugin-api artefact.  When running this stripped down POM file,  everything just worked.


I am going to see if I can monitor the request.log file while doing a full fledged build, just to verify the grep results I got.




--
Mehul N. Sanghvi
email: mehul....@gmail.com

Rich Seddon

unread,
Aug 17, 2017, 3:47:40 PM8/17/17
to Nexus Users
No 502's in the request.log indicates this is coming from something outside Nexus. One possibility... check to see if your Maven build is going through an http proxy server (this will be in the settings.xml if it is).  

Mehul Sanghvi

unread,
Aug 17, 2017, 4:45:28 PM8/17/17
to Rich Seddon, Nexus Users

There is a http proxy server setup in the settings.xml, but that has been there, unchanged, for at least 5 years now, which is when I joined the company.   We have noProxyHosts setup for our corporate domains, so it shouldn't be
hitting the proxy anyway.

Just to be clear:  If I have a proxy setting in settings.xml does that mean that every request is being directed to the proxy by Maven ?   Or only requests to repositories on the "outside"  are getting directed to the proxy ?   All our repositories are internal to us, so I would expect no requests to hit the proxy at all.






Rich Seddon

unread,
Aug 17, 2017, 4:59:51 PM8/17/17
to Nexus Users
If noProxyHosts hosts is set correctly then it shouldn't be a problem. I was just noting it's something to check for, I've seen 502 responses returned from HTTP proxy servers when the proxy bypass isn't configured correctly for a local Nexus.

Mehul Sanghvi

unread,
Aug 17, 2017, 5:07:26 PM8/17/17
to Rich Seddon, Nexus Users
That is the way I was looking at it as well.  And since those settings have not changed over the years, and worked, I never paid too much attention to them.

Turns out that if I comment the proxy out, everything works just fine.   I got no 502 responses.  This still seems strange to me.  But re-enabling the proxy settings returned the 502 responses.  

Hopefully I have more information tomorrow. 


I'm glad I found this list.   There is another long-standing issue we've got, but one thing at a time. :)

Thank you Rich & Peter for the help.


cheers,

    mehul


Mariska Hoogenboom

unread,
Aug 18, 2017, 2:56:35 AM8/18/17
to Mehul Sanghvi, Nexus Users

Maybe something did change in your corporate proxy and your noProxyHost setting was incorrect for 5 years.

Can you post your proxy settings. We have something like this:

    <proxy>

      <id>normalproxy</id>

      <active>true</active>

      <protocol>http</protocol>

      <host>proxy.mydomain.org</host>

      <port>8080</port>

      <nonProxyHosts>*.mydomain.org|10.*</nonProxyHosts>

    </proxy>

 

Met vriendelijke groet/Kind regards,


Mariska Hoogenboom

 

 



 

--

Mehul N. Sanghvi
email: mehul....@gmail.com

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.



 

--

Mehul N. Sanghvi
email: mehul....@gmail.com

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.



 

--

Mehul N. Sanghvi
email: mehul....@gmail.com

--

You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.

Reply all
Reply to author
Forward
0 new messages