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

Scanner silently accepts blocks if opening them for writing fails #72

Open
chrysn opened this issue Feb 17, 2019 · 3 comments
Open

Scanner silently accepts blocks if opening them for writing fails #72

chrysn opened this issue Feb 17, 2019 · 3 comments

Comments

@chrysn
Copy link

chrysn commented Feb 17, 2019

When run on MCR files of corrupted chunks that are read-only (as typical of backup files), the scanner silently reports "no problems". It should either report a write error if it is actually necessary to open them write-only, or only open them for writing when necessary.

The current situation causes very hard-to-debug situations when scanning through backups none of which appear to be corrupt, even though any restored data set is shown as corrupt.

@Fenixin
Copy link
Owner

Fenixin commented Feb 17, 2019

Thanks for the bug report. I will fix it next time I give this some time.

@Fenixin
Copy link
Owner

Fenixin commented Apr 15, 2019

I have tried to reproduce this bug with no success. If I try to open read only regionfiles a PermissionError exception is raised. Could you please provide some information about your configuration/system? I have tried this in windows, tomorrow I can test this in linux.

@Fenixin
Copy link
Owner

Fenixin commented Apr 16, 2019

Ok, new information.

Regionfixer always open region files in "r+b" mode, that means read and write binary mode. When a file can't be opened in this way it just add the "Unreadable" status to it and it's considered a bad regionfile. This is how the NBT library works right now.

In the branch new2to3 I have added a new status for region files that differentiates between any IOError (for example file system problems) and PermissionError (file cannot be opened in write mode). Also, after this is finished it will be added some description in the wiki.

It's true that that it would be better to open region files in write mode only when needed, but that will be for the future.

I'm going to leave this open, maybe I'm able to code that in some time.

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

No branches or pull requests

2 participants