Invalid stored block lengths ошибка как исправить

I am trying to extract a ZIP file from my current JAR using:

InputStream resource = getClass().getClassLoader().getResourceAsStream(name);

This get the correct InputStream, but it gives an error when I try to unzip it using the following code (I’m storing each file into a Hashmap<file, filename>):

public static HashMap<String, String> readZip(InputStream inputStream) throws IOException {
    byte[] buffer = new byte[1024];
    HashMap<String, String> list = new HashMap<>();
    ZipInputStream zipInputStream = new ZipInputStream(inputStream);
    ZipEntry entry = zipInputStream.getNextEntry();
    while (entry != null) {
        if (!entry.isDirectory()) {
            StringBuilder stringBuilder = new StringBuilder();
            while (IOUtils.read(zipInputStream, buffer) > 0) {
                stringBuilder.append(new String(buffer, "UTF-8"));
            }
            list.put(stringBuilder.toString(), entry.getName());
        }
        zipInputStream.closeEntry();
        entry = zipInputStream.getNextEntry();
    }
    zipInputStream.closeEntry();
    zipInputStream.close();
    return list;
}

However when I try to do this, I get this exception (on IOUtils.read)

java.util.zip.ZipException: invalid stored block lengths
   at java.util.zip.InflaterInputStream.read(Unknown Source)
   at java.util.zip.ZipInputStream.read(Unknown Source)

Am I doing this wrong? I’ve done plenty of googling of the error, and I didn’t see anything related to my issue.

I am scraping a website and it contains many URLs from which O need to fetch data.
I used XPath and fetched all the hrefs (URLs) and saved in to a list. I looped this list and yielded a request. Below is my spider code,

class ExampledotcomSpider(BaseSpider):
   name = "exampledotcom"
   allowed_domains = ["www.example.com"]
   start_urls = ["http://www.example.com/movies/city.html"]


   def parse(self, response):
       hxs = HtmlXPathSelector(response)
       cinema_links = hxs.select('//div[@class="contentArea"]/div[@class="leftNav"]/div[@class="cinema"]/div[@class="rc"]/div[@class="il"]/span[@class="bt"]/a/@href').extract()
       for cinema_hall in cinema_links:
            yield Request(cinema_hall, callback=self.parse_cinema)


   def parse_cinema(self, response):
       hxs = HtmlXPathSelector(response)
       cinemahall_name = hxs.select('//div[@class="companyDetails"]/div[@itemscope=""]/span[@class="srchrslt"]/h1/span/text()').extract()
       ........

Here, for example, I had 60 URLs in the list, and for about 37 URLs are not downloaded: for these, an error message appeared:

2012-06-06 14:00:12+0530 [exampledotcom] ERROR: Error downloading <GET http://www.example.com/city/Cinema-Hall-70mm-%3Cnear%3E-place/040PXX40-XX40-000147377847-A6M3>: Error -3 while decompressing: invalid stored block lengths
2012-06-06 14:00:12+0530 [exampledotcom] ERROR: Error downloading <GET http://www.example.com/city/Cinema-Hall-35mm-%3Cnear%3E-place/040PXX40-XX40-000164969686-H9C5>: Error -3 while decompressing: invalid stored block lengths

Only for some URLs Scrapy is downloading, and for the remainder, I do not understand what’s happening and what’s wrong with my code.

Can anyone please suggest me how to remove these errors?

Unpacking (larger) zipped archives from github repositories will result in error: invalid stored block lengths.

I was at least able to reproduce this issue with the packed releases 1 and 2. Any zip file of respectable size should produce the error. However, on smaller distro’s (3) the error is not occurring.

  1. https://github.com/TryGhost/Ghost/releases/download/0.3.3/Ghost-0.3.3.zip
  2. https://github.com/primus/primus/archive/1.4.4.zip
  3. https://github.com/Swaagie/smith/archive/v1.0.zip
var fs = require('fs')
  , zlib = require('zlib')
  , file = process.env.HOME + '/Downloads/dist.zip'; // any packed repo with: git archive HEAD -o dist.zip 

fs.createReadStream(file).pipe(zlib.createInflateRaw());

I know this does not lead to any useful output in itself, but it is a simplification of the unzip package process.

This seems to be related to the two different underlying package libraries.

  • git archive uses the libarchive library
  • node.js uses the zlib library

Repackaging the files with zip results in the same error, I couldn’t find the underlying library that is used by zip however. Will follow up on this tomorrrow

Repacking the files with tar and using createUnzip completes without errors.

Does anyone know of other languages/command line tools that bind into the zlib library so node.js could actually be excluded or not?

Edit: this same error is also present in node version 0.8.25 which makes me suspect the zlib library, is there an update available for this library?

System specs:
64 bit, node 0.10.21, ubuntu 13.10

Problem

Over the top Cognos installation fails with «invalid stored block lengths» exception message

Symptom

Following error occurs when an over-the-top Cognos installation is performed.

Error installing file: file_location_install_file.zip Exception Message: invalid stored block lengths Call Stack: java.util.zip.ZipException: invalid stored block lengths at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:175) at java.util.zip.ZipInputStream.read(ZipInputStream.java:205) at java.io.FilterInputStream.read(FilterInputStream.java:118) at java.nio.file.Files.copy(Files.java:2919) at java.nio.file.Files.copy(Files.java:3038) at manifest.Part.extractFile(Part.java:307) at manifest.Part.unpackZIP(Part.java:276) at manifest.Part.install(Part.java:213) at manifest.Part.install(Part.java:167) at InstallFromRepo.InstallParts(InstallFromRepo.java:384) at InstallFromRepo.install(InstallFromRepo.java:139) at com.zerog.ia.installer.actions.CustomAction.installSelf(Unknown Source) at com.zerog.ia.installer.InstallablePiece.install(Unknown Source) at com.zerog.ia.installer.InstallablePiece.install(Unknown Source) at com.zerog.ia.installer.InstallablePiece.install(Unknown Source) at com.zerog.ia.installer.InstallablePiece.install(Unknown Source) at com.zerog.ia.installer.GhostDirectory.install(Unknown Source) at com.zerog.ia.installer.InstallablePiece.install(Unknown Source) at com.zerog.ia.installer.Installer.install(Unknown Source) at com.zerog.ia.installer.actions.InstallProgressAction.ae(Unknown Source) at com.zerog.ia.installer.actions.ProgressPanelAction$1.run(Unknown Source)

Cause

Invalid write permission to the installation directory caused the issue.

Diagnosing The Problem

Everyone group did not have write permissions to the installation directory (755). Changing the permissions for everyone group to include write (777) resolved the issue.

Resolving The Problem

Giving write permission to everyone group (777) resolved the issue.

Document Location

Worldwide

[{«Type»:»MASTER»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w\/o TPS»},»Product»:{«code»:»SSTSF6″,»label»:»IBM Cognos Analytics»},»ARM Category»:[{«code»:»a8m50000000Cl3yAAC»,»label»:»Installation and Configuration»}],»ARM Case Number»:»TS007075607″,»Platform»:[{«code»:»PF016″,»label»:»Linux»}],»Version»:»All Versions»}]

ImperialPearl

New Here

,

/t5/photoshop-ecosystem-discussions/error-idat-invalid-stored-block-lengths/td-p/10108834
Sep 29, 2018
Sep 29, 2018

Copy link to clipboard

Copied

I’m getting this error IDAT: invalid stored block lengths when trying to open a png image… The resolution of the image is really big 12800 x 7200.

Anyone know why this is happening ?

Thank you,
Daniel

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Adobe

Explore related tutorials & articles

replies
2
Replies
2

Mylenium

LEGEND

,

/t5/photoshop-ecosystem-discussions/error-idat-invalid-stored-block-lengths/m-p/10108835#M198902
Sep 30, 2018
Sep 30, 2018

Copy link to clipboard

Copied

Without any info how the file was created in the first place, system info, exact version info for PS and so on nobody can tell you much.

Mylenium

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

davescm

Community Expert

Community Expert

,

/t5/photoshop-ecosystem-discussions/error-idat-invalid-stored-block-lengths/m-p/10108836#M198903
Sep 30, 2018
Sep 30, 2018

Copy link to clipboard

Copied

LATEST

It sounds like a corrupt file.

Can you open it with any other application? If so, can you resave it as a new copy from that application then try opening the new copy in Photoshop.

Dave

  • Follow
  • Report

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

community guidelines

Понравилась статья? Поделить с друзьями:

Интересное по теме:

  • Invalid start mode archive offset tlauncher ошибка
  • Invalid remid симс 4 ошибка как исправить
  • Invalid data about errors перевод ошибка
  • Invalid qualifier vba excel ошибка
  • Invalid payload register ошибка

  • Добавить комментарий

    ;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: