IBM Support

Zip file fails to route with "Invalid compression method" error.

Troubleshooting


Problem

In Sterling File Gateway if a zip file arrives and the routing template is configured to unzip it then the file fails with FG_0455 with an error of "Arrived File is now failed while Determining Routes with error message: Zip file is unreadable. Cause: java.util.zip.ZipException: invalid compression method."

Symptom

The file fails to route.

Error in filegateway.log
[2015-02-13 09:53:27.304] ERROR [1423839207304] Zip file is unreadable. Cause: java.util.zip.ZipException: invalid compression method.
[2015-02-13 09:53:27.305] ERRORDTL [1423839207304]com.sterlingcommerce.fg.exception.FileGatewayRouteException: Zip file is unreadable. Cause: java.util.zip.ZipException: invalid compression method.
at com.sterlingcommerce.fg.exception.FileGatewayRouteException.newZipUnreadable(FileGatewayRouteException.java:51)
at com.sterlingcommerce.fg.router.RouteIdentifier.extractZipEntry(RouteIdentifier.java:665)
at com.sterlingcommerce.fg.router.RouteIdentifier.crackOpenZip(RouteIdentifier.java:630)
at com.sterlingcommerce.fg.router.RouteIdentifier.getZipTOC(RouteIdentifier.java:601)
at com.sterlingcommerce.fg.router.RouteIdentifier.getMatches(RouteIdentifier.java:512)
at com.sterlingcommerce.fg.router.RouteIdentifier.findRoutePlansForChannel(RouteIdentifier.java:227)
at com.sterlingcommerce.fg.router.RouteIdentifier.findRoutePlans(RouteIdentifier.java:163)
at com.sterlingcommerce.fg.router.ArrivedFile.determineRoutes(ArrivedFile.java:544)
at com.sterlingcommerce.fg.router.ArrivedFile.startRoute(ArrivedFile.java:211)
at com.sterlingcommerce.fg.router.FileGatewayRouter.processRoute(FileGatewayRouter.java:136)
at com.sterlingcommerce.fg.services.FileGatewayRouteService.primitiveProcessData(FileGatewayRouteService.java:76)
at com.sterlingcommerce.fg.services.TransformingRouterService.processData(TransformingRouterService.java:79)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.invokeService(ActivityEngineHelper.java:1818)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.nextMainLogic(ActivityEngineHelper.java:631)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.next(ActivityEngineHelper.java:362)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.doWork(WorkFlowQueueListener.java:442)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.run(WorkFlowQueueListener.java:236)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.onMessage(WorkFlowQueueListener.java:197)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.onMessage(WorkFlowQueueListener.java:184)
at com.sterlingcommerce.woodstock.workflow.queue.wfTransporter.run(wfTransporter.java:444)
at com.sterlingcommerce.woodstock.workflow.queue.BasicExecutor$Worker.run(BasicExecutor.java:508)
at java.lang.Thread.run(Thread.java:804)
Caused by: java.util.zip.ZipException: invalid compression method
at java.util.zip.ZipInputStream.read(ZipInputStream.java:235)
at java.io.FilterInputStream.read(FilterInputStream.java:118)
at com.sterlingcommerce.fg.router.RouteIdentifier.extractZipEntry(RouteIdentifier.java:656)

Cause

With further investigation of the zip file, it was discovered that the zip file was using the DEFLATE64 compression method to be compressed .

It is signaling an invalid compress method because java.util.Zip does not support DEFLATE64 compression method.
The javadoc for java.util.zip indicates that only the DEFLATE compression method is supported.

Diagnosing The Problem

Analyze the filegateway.log corresponding to the time frame of the error in the Sterling File Gateway user interface.
Inspect the zip file in question and use a file archiver program to determine the file's compression method.

Resolving The Problem

For Sterling File Gateway, create a custom protocol to use the CLA2 adapter to unzip these files by using an external program that supports DEFLATE64, instead of using the routing template to unzip these type of files.

NOTE: This type of exception can also manifest itself in Sterling B2B Integrator when using the Compression Service since the service also uses the java.util.zip class. The same resolution should be used, of using the CLA2 adapter to unzip the files via an external program.

[{"Product":{"code":"SS4TGX","label":"IBM Sterling File Gateway"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
14 November 2019

UID

swg21698689