Bug 64450

Summary: InvalidFormatException because of a PivotTable
Product: POI Reporter: odelpozo <odelpozo>
Component: OPCAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: regression CC: matafagafo, odelpozo
Priority: P2    
Version: 4.1.2-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: XLSX File to reproduce the issue

Description odelpozo 2020-05-19 06:22:45 UTC
Created attachment 37250 [details]
XLSX File to reproduce the issue

Reading an XLSX document exported from Google Sheets raises an org.apache.poi.openxml4j.exceptions.InvalidFormatException: invalid relationship part/id when the excel file contains a PivotTable.

Code:
OPCPackage.open(stream)

Exception trace: 
org.apache.poi.openxml4j.exceptions.InvalidFormatException: invalid relationship part/id
	at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.parseRelationshipsPart(PackageRelationshipCollection.java:358) ~[poi-ooxml-4.1.2.jar:4.1.2]
	at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.<init>(PackageRelationshipCollection.java:163) ~[poi-ooxml-4.1.2.jar:4.1.2]
	at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.<init>(PackageRelationshipCollection.java:133) ~[poi-ooxml-4.1.2.jar:4.1.2]
	at org.apache.poi.openxml4j.opc.PackagePart.loadRelationships(PackagePart.java:570) ~[poi-ooxml-4.1.2.jar:4.1.2]
	at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:734) ~[poi-ooxml-4.1.2.jar:4.1.2]
	at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:310) ~[poi-ooxml-4.1.2.jar:4.1.2]


POI version 3.17 was able to read the file with no issues.

Find attached an example.
Comment 1 Dominik Stadler 2021-01-03 11:51:29 UTC
A change via r1885056 allows to parse such a document. However it seems this file is slightly corrupt as it includes an empty id in the relationship definitions.
Comment 2 odelpozo 2021-01-07 08:52:54 UTC
(In reply to Dominik Stadler from comment #1)
> A change via r1885056 allows to parse such a document. However it seems this
> file is slightly corrupt as it includes an empty id in the relationship
> definitions.

Hello,

Thanks for the update. When is expected to be released the version of the library with this issue fixed?
Comment 3 Dominik Stadler 2021-01-14 10:45:38 UTC
It will be included in the next major release 5.0.0 which is currently in the "voting phase", so ideally will be available soon.