invalid stored block lengths ошибка как исправить
Zlib nodejs Error: invalid stored block lengths
I’m trying to send some compressed data over the network, I think the data is successfully compressed since I can re-inflate it from the code that deflates the data (written in C), however when the data arrives at my server (nodejs using express) and tries to inflate the data I’m receiving:
Any Help will be really appreciated, thanks in advance.
P.D: I can provide code snipped if it is useful for anyone.
EDIT:
Thanks for the quick answer and sorry for the delay, I’ve been working in my code, now I’m sending the original data to the server along with the compressed data. When the original data arrives the server I’m deflating it in order to see the buffers generated, surprisingly the buffers of the compressed data sent over the network and the buffer compressed in the server are the same except for the two first bytes particulary:
So, I think my question now is can I assume that this first two bytes will always appear in the compressed data from the C program? Is there any option to avoid this first two bytes? Am I doing well?
Here I leave you the function that compress the data in the C part, the node part is just formidable parsing the post input and a little work with buffers now.
EDIT 2: I’m dumping my buffers now and I can see some trailing bytes that differs too, here you have the buffer coming from C program:
And the buffer deflated in the server:
However creating a new buffer without the first two bytes I’m able to se my data properly inflated in the server:
zlib: Error: invalid stored block lengths #6384
Comments
Swaagie commented Oct 20, 2013
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.
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.
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
The text was updated successfully, but these errors were encountered:
We are unable to convert the task to an issue at this time. Please try again.
The issue was successfully created but we are unable to update the comment at this time.
Как восстановить объекты Git, поврежденные сбоем жесткого диска?
у меня есть резервные копии репозитория, но единственная резервная копия, которая включает файл пакета, уже повреждена. Поэтому я думаю, что мне нужно найти способ получить отдельные объекты из разных резервных копий и каким-то образом поручить Git создать новый пакет с только правильными объектами.
не могли бы вы дать мне подсказывает, как исправить мой репозиторий?
7 ответов:
в некоторых предыдущих резервных копиях ваши плохие объекты могут быть упакованы в разные файлы или еще могут быть свободными объектами. Так что ваши объекты могут быть восстановлены.
кажется, есть несколько плохих объектов в базе данных. Так что вы можете сделать это вручную.
(ваши пакеты перемещаются из репозитория, и распаковал снова в нем; только хорошие объекты теперь находятся в базе данных)
и проверьте тип объекта.
если тип дерева: вы могли бы использовать git ls-tree для восстановления дерева из предыдущих резервных копий; затем git mktree to запишите его снова в текущем репозитории.
конечно, я бы сделал резервную копию вашей оригинальной рабочей копии перед началом этого процесса.
Banengusk ставил меня на правильный путь. Для получения дополнительной информации я хочу опубликовать шаги, которые я предпринял, чтобы исправить повреждение репозитория. Мне посчастливилось найти все необходимые объекты либо в старых пакетах, либо в резервных копиях репозитория.
сначала попробуйте выполнить следующие команды (при необходимости повторите их):
и тогда у вас все еще есть проблемы, попробуйте может:
удалите все поврежденные объекты, например
удалить все пустые объекты, например,
проверьте сообщение «сломанная ссылка»:
это будет говорит вам, какой файл коррумпированный blob пришел откуда?
чтобы восстановить файл, вам может очень повезти, и это может быть версия, которую вы уже проверили в своем рабочем дереве:
снова, и если он выводит отсутствующий SHA1 (4b945..) вы теперь все сделали!
предполагая, что это была какая-то более старая версия, которая была сломана, самый простой способ сделать это-сделать:
и что покажет вам весь журнал для этого файла (пожалуйста, поймите что дерево, которое у вас было, может быть не деревом верхнего уровня, поэтому вам нужно выяснить, в каком подкаталоге он был самостоятельно), то теперь вы можете снова воссоздать отсутствующий объект с помощью hash-object.
чтобы получить список всех ссылок с отсутствующими коммитами, деревьями или блобами:
ниже вы можете найти расширенное использование команд, которые потенциально могут привести к потере ваших данных в вашем репозитории git, если они не используются разумно, поэтому сделайте резервную копию раньше вы случайно делаете дальнейшие повреждения своему git. Попробуйте на свой страх и риск, если вы знаете, что делаете.
чтобы вытащить текущую ветвь поверх восходящей ветви после извлечения:
вы также можете попробовать проверить новую ветку и удалить старую:
чтобы найти поврежденный объект в git для удаления, выполните следующую команду:
если выше не помогает, вы можете попробовать rsync или скопировать объекты git из другого РЕПО, например
чтобы исправить сломанную ветку при попытке проверки следующим образом:
Попробуйте удалить его и загрузить из вверх по течению снова:
в случае, если git приведет вас в отстраненное состояние, проверьте master и слиться с ней в отдельной ветке.
другая идея состоит в том, чтобы перебазировать существующее мастер рекурсивно:
вот шаги, которые я следовал, чтобы восстановить из поврежденного объекта blob.
1) Определить коррумпированный blob
2) переместить поврежденный blob в безопасное место (на всякий случай)
3) получить родитель коррумпированного blob
4) получить соответствующее имя файла чтобы испортить blob
найдите этот конкретный файл в резервной копии или в вышестоящем репозитории git (в моем случае это свалка.смола.ГЗ). Затем скопируйте его где-нибудь в локальном репозитории.
5) Добавить ранее поврежденный файл в базу данных объектов git
git checkout может фактически выбрать отдельные файлы из ревизии. Просто дайте ему хэш фиксации и имя файла. Более подробная информация здесь.
Я думаю, что самый простой способ исправить это безопасно-вернуться к новейшей незафиксированной резервной копии, а затем выборочно выбрать неповрежденные файлы из новых коммитов. Удачи вам!
вот две функции, которые могут помочь, если ваша резервная копия повреждена или у вас есть несколько частично поврежденных резервных копий, а также (это может произойти, если вы резервное копирование поврежденных объектов).
запустите оба в репо, которое вы пытаетесь восстановить.
стандартное предупреждение: используйте только если вы действительно в отчаянии, и вы создали резервную копию своего (поврежденного) РЕПО. Это может ничего не решить, но по крайней мере должно подчеркнуть уровень коррупция.
Я решил эту проблему, чтобы добавить некоторые изменения, такие как git add-A и git commit снова.
Error reading BAM file: «invalid stored block lengths» #199
Comments
benjamin-cogne commented Jun 2, 2016
when i try igv javascript with web url of a BAM, as in your exemples, it’s working very well.
But when i try to run it on a local file via apache server i have an error saying «invalid stored block lengths». They are BAM files produces by GATK’s pipeline, i can’t figure out what’s going on.
The text was updated successfully, but these errors were encountered:
We are unable to convert the task to an issue at this time. Please try again.
The issue was successfully created but we are unable to update the comment at this time.
jrobinso commented Jun 2, 2016
What version of igv.js are you using?
Is you Apache server configured to allow range-byte requests (most are)?
Are you able to view these files in IGV desktop?
Would it be possible to make one available for me to test, or produce a
small one that reproduces the problem and attach it here?
On 6/2/16 7:55 AM, benjamin-cogne wrote:
when i try igv javascript with web url of a BAM, as in your exemples,
it’s working very well.
But when i try to run it on a local file via apache server i have an
error saying «invalid stored block lengths». They are BAM files
produces by GATK’s pipeline, i can’t figure out what’s going on.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#199, or mute the thread
https://github.com/notifications/unsubscribe/AA49HLzzjtZZekgJIheSwFvMk-908hByks5qHu7ngaJpZM4IspMX.
benjamin-cogne commented Jun 2, 2016
Hi Jim, thanks for your response
i’m using version 1.0
I’m able to view the files in IGV desktop
Here are a zip with the html file and an extracted bam region:
IGV_test.zip
I don’t know how to check if the Apache server is configured to allow range-byte requests. i’m a biologist and those things are quite hard for me to understand^^
Thanks for your help!
Benjamin
jrobinso commented Jun 9, 2016
Hi Benjamin, your test files are loading fine for me.
What do you know about the configuration of this server? Apache supports range-byte requests out of the box, you have to do some configuration to turn it off.
If you can send me the contents of the javascript console it might have some hints.
jrobinso commented Jun 9, 2016
Update, I doubt the range-byte header is the problem. You will get a more specific error if it is (see below). So I don’t know what this is, or how to solve it, but more information on your server might be helpful
benjamin-cogne commented Jul 25, 2016
As it’d be too easy, i have now another message: «Error accessing resource; test.bam.bai Status 0».
If you have any idea.
Thanks so much for your help
benjamin-cogne commented Jul 25, 2016
benjamin-cogne commented Jul 25, 2016
Finally, i got it to work. by trying with firefox. It seems to be an error with Chrome only.