This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 254873 - the bundled http wagon 2.4 limits downloaded index size to Integer.MAX_VALUE
Summary: the bundled http wagon 2.4 limits downloaded index size to Integer.MAX_VALUE
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0
Hardware: Macintosh Mac OS X
: P2 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords: 8.1_WAIVER_APPROVED
Depends on:
Blocks:
 
Reported: 2015-08-31 13:29 UTC by Tomas Stupka
Modified: 2016-04-08 01:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Stupka 2015-08-31 13:29:39 UTC
Product Version = NetBeans IDE Dev (Build 20150831-9135a8cba0b8)
Operating System = Mac OS X version 10.10.3 running on x86_64
Java; VM; Vendor = 1.8.0_60-ea
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.60-b07

Reproducibility: Happens every time


as mentioned in issue #251987
the bundled http wagon 2.4 calls getTransfer(resource, stream, is, true, Integer.MAX_VALUE)


cbourque 2015-08-27 22:56:56 UTC

INFO [org.netbeans.modules.maven.indexer.NexusRepositoryIndexerImpl]: could not (re-)index main java.io.EOFException: Unexpected end of ZLIB input stream

The downloaded index has a size of 2147483647 bytes (Integer.MAX_VALUE) when in fact the real archive is 2949372869 bytes!

Comment 6 psilvaggio@netbeans.org 2015-08-28 03:39:05 UTC
Confirming Dr. cbourque issue with this fact:

maven.indexer depends on ext/indexer-core-5.1.1-patched.jar

which depends on maven-wagon 2.3

Tracing calls shows that we end up calling getTransfer( resource, stream, is, true, Integer.MAX_VALUE ).

I don't know about you, but that's bad.

I suggest overriding maven-wagon to a more recent version, i.e.: 2.9 which should be backward compatible!
Comment 1 Tomas Stupka 2015-09-14 13:35:46 UTC
waiver request:
The bug is in the http_wagon library coming together with the bundled maven client. 

An upgrade is necessary, but due to the administrative overhead and an eventual risk of regression we need to postpone to next release.
Comment 2 cbourque 2015-09-14 18:27:10 UTC
Postpone to next release?

You do realize that this is a MAJOR issue right? 

A lot of NetBeans users will be affected by this problem! And the fix is simple as updating a dependency in your packaging! I understand that there could be side effects but 8.1 won't be released for another month so there's still plenty of time to test the fix don't you think?
Comment 3 Jiri Kovalsky 2015-09-18 06:47:44 UTC
Bug waiver for 8.1 approved. We will upgrade the http wagon library after 8.1 is branched, test it accordingly in trunk for several months to make sure no serious regressions show up and then deliver the fix via first 8.1 patch release. Thanks for your understanding.

Tomasi, is there possibly some workaround Christian Bourque could use in the meantime?
Comment 4 Tomas Stupka 2015-09-18 14:59:22 UTC
> Tomasi, is there possibly some workaround Christian Bourque could use in the meantime?
enhanced some switches we used for diagnostics. 
now it is possible to bypass the download step from the IDE and index a repository based on manually downloaded index files
jet-main #58944538e690 

1.) manually download the index files (.porperties and .gz from a remote repository)
2.) run netbeans with: 
-J-Dmaven.indexing.diag=true -J-Dmaven.diag.index.properties.$repo_id=$index_prop_file -J-Dmaven.diag.index.gz.$repo_id=$index_gz_file
where $repo_id is the repository id as specified in services > maven repositories 
3.) when indexing for the particular repository is invoked, it will grab the loacl index files

it's clumsy, but still hope this helped at least a bit
Comment 5 cbourque 2015-09-18 16:08:38 UTC
Here's the definitive and very simple workaround:

Download the following Maven Wagon 2.9 librairies from Maven Central: http://search.maven.org/

1) wagon-file-2.9.jar
2) wagon-provider-api-2.9.jar
3) wagon-http-2.9-shaded.jar

Rename the downloaded files like that (to match the version bundled with NetBeans 8.1):

1) wagon-file-2.4.jar
2) wagon-provider-api-2.4.jar
3) wagon-http-2.4-shaded.jar

Copy the 3 files in your NetBeans installation (this will override the 3 librairies bundled with NetBeans):

<NETBEANS_HOME>/java/maven/lib

Start NetBeans and voila!

(Kudos to psilvaggio for this workaround that makes NetBeans 8.1 actually usable with Maven!)
Comment 6 Tomas Stupka 2016-04-07 15:03:54 UTC
fixed in jet-main #cb5da8fa838f
Comment 7 Quality Engineering 2016-04-08 01:47:14 UTC
Integrated into 'main-silver', will be available in build *201604080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cb5da8fa838f
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #254873 - the bundled http wagon 2.4 limits downloaded index size to Integer.MAX_VALUE