Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gridfs.errors.CorruptGridFile: no chunk #0 #21

Open
xxzk opened this issue Apr 27, 2021 · 3 comments
Open

gridfs.errors.CorruptGridFile: no chunk #0 #21

xxzk opened this issue Apr 27, 2021 · 3 comments

Comments

@xxzk
Copy link

xxzk commented Apr 27, 2021

Hello,

Executing the python script like below

python3 ./migrate.py -c dump -r rocketchat -t FileSystem -d /root/gridfs_dump/

And here is the return error.

Traceback (most recent call last):
  File "/usr/local/lib64/python3.6/site-packages/gridfs/grid_file.py", line 755, in next
    chunk = self._next_with_retry()
  File "/usr/local/lib64/python3.6/site-packages/gridfs/grid_file.py", line 747, in _next_with_retry
    return self._cursor.next()
  File "/usr/local/lib64/python3.6/site-packages/pymongo/cursor.py", line 1215, in next
    raise StopIteration
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./migrate.py", line 229, in <module>
    obj.dumpfiles("rocketchat_uploads", store)
  File "./migrate.py", line 104, in dumpfiles
    data = res.read()
  File "/usr/local/lib64/python3.6/site-packages/gridfs/grid_file.py", line 565, in read
    chunk_data = self.readchunk()
  File "/usr/local/lib64/python3.6/site-packages/gridfs/grid_file.py", line 528, in readchunk
    chunk = self.__chunk_iter.next()
  File "/usr/local/lib64/python3.6/site-packages/gridfs/grid_file.py", line 759, in next
    raise CorruptGridFile("no chunk #%d" % self._next_chunk)
gridfs.errors.CorruptGridFile: no chunk #0

Thanks.

@xxzk
Copy link
Author

xxzk commented Apr 27, 2021

Update infomation.

I dump the rocketchat database from MongoDB in docker container,and restore to another VM which installed MongoDB x86_64.
The restore progress done as well.
RocketChat version is v3.6.1 and MongoDB docker image version is 4.4.

@tamasgal
Copy link

I have a similar setup, trying to move from 3.18.7 (snap) with MongoDB 3.6 to 3.18.7 (Docker) with MongoDB 4.4.15 and when I try to dump the files in the 4.4.15 MongoDB service, I get

2423. Dumping iqL6yZ5ZP3F3yK4ME Untersuchen_von_Silizium_Photomultipliern__SiPM__zur_Verwendung__in_der_Intensit_tsinterferometrie.pdf
2424. Dumping Bi85dHH23Kbao6WiR Tuerschilde.pdf
2425. Dumping ioWaWWpA5ZhdXpNgD lecture_literature.pdf
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/gridfs/grid_file.py", line 794, in next
    chunk = self._next_with_retry()
  File "/usr/local/lib/python3.7/dist-packages/gridfs/grid_file.py", line 786, in _next_with_retry
    return self._cursor.next()
  File "/usr/local/lib/python3.7/dist-packages/pymongo/cursor.py", line 1251, in next
    raise StopIteration
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./migrate.py", line 244, in <module>
    obj.dumpfiles("rocketchat_uploads", store)
  File "./migrate.py", line 115, in dumpfiles
    data = res.read()
  File "/usr/local/lib/python3.7/dist-packages/gridfs/grid_file.py", line 606, in read
    return self._read_size_or_line(size=size)
  File "/usr/local/lib/python3.7/dist-packages/gridfs/grid_file.py", line 563, in _read_size_or_line
    buf = self.readchunk()
  File "/usr/local/lib/python3.7/dist-packages/gridfs/grid_file.py", line 529, in readchunk
    chunk = self.__chunk_iter.next()
  File "/usr/local/lib/python3.7/dist-packages/gridfs/grid_file.py", line 798, in next
    raise CorruptGridFile("no chunk #%d" % self._next_chunk)
gridfs.errors.CorruptGridFile: no chunk #0
I have no name!@b6ea9e515433:/bitnami/mongodb/upload_dump$

@tamasgal
Copy link

It turned out to be a migration error, probably caused by RocketChat or so, no idea. If I run the dump on the original server with MongoDB 3.6, it works. If I run it on the already migrated backup under MongoDB 4.4.15, I get the corruption errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants