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

[Warning] Mounting of 'redacted rarpath' failed because of: Archive to open (redactedpath) has unrecognized format! #108

Closed
zDEFz opened this issue Feb 27, 2023 · 6 comments

Comments

@zDEFz
Copy link

zDEFz commented Feb 27, 2023

Having tons of rar archives. Tons of them cannot be mounted by ratarmount. Wondering how we can debug this without me sending one of the failing archives. Is there anything I can do to give the information required to debug? I definitely had .part archives in there, and I passed a password.

@mxmlnkn
Copy link
Owner

mxmlnkn commented Feb 27, 2023

  • You could try calling ratarmount with -d 3 and send me that output after redacting anything that needs to.
  • You could also try opening that RAR file with rarfile and see if that works or if that already throws errors because that is what ratarmount uses internally. It might also show a more detailed error message. Try this:
    import rarfile
    rf = rarfile.RarFile( "file.rar" )
    rf.setpassword( "password" );
    for info in rf.infolist()[:5]:
       print(info.filename)
       if info.is_file():
           print(rf.read(info.filename)[:10])

@zDEFz
Copy link
Author

zDEFz commented Feb 27, 2023

  • single file mount does not throw any errors and succeeds.

  • output of rarfile doesn't throw any errors. As in ratarmount --password mypassword "/mnt/external-hdd-storage/20tb-3" /ratarmount. Shows something like ... b'\xff\xd8\xff\xe0\x00\x10JFIF' and other filenames that are not mounted with proper names cause SHIFT-JIS encoding was used. But instead of the \ and so on I get a string with actual fileendings but weird names.

  • contents of rarfiles use what seems SHIFT-JIS which means that for me, in the first place, would require something like https://github.com/kjerk/sjisunzip but I'm almost sure some unextractors have the option too. Cause

recursive mount throws errors. As used in:
ratarmount --password mypassword -r "/mnt/external-hdd-storage/20tb-3/" /ratarmount

But was confuses me more is that the recursive option fails while the single file option succeeds

@mxmlnkn
Copy link
Owner

mxmlnkn commented Feb 27, 2023

As for the encoding issue, you could try to play around with the FUSE options, e.g., --fuse modules=iconv,from_code=SHIFT-JIS or with the --encoding SHIFT-JIS option. It may not work. There are too many layers that have to handle encodings correctly :/.

b'\xff\xd8\xff\xe0\x00\x10JFIF' is not the file name though. My example code above printed the file names and also the first 10 bytes of each file. This is a jpeg file as can be seen from the JFIF keyword. I did this because some archives only encrypt the file contents and simply iterating over the files and printing the file names would not trigger encryption errors when a wrong password has been used.

If recursive mount fails but single-mount works, then you may have encrypted RAR files with a different password inside the RAR files you actually want to mount. Note that the issue title speaks of a "Warning". Are you missing some data that should be mounted?

Could you try --recursion-depth 1 instead of -r?

@zDEFz
Copy link
Author

zDEFz commented Feb 27, 2023

Could you try --recursion-depth 1 instead of -r?

With a recursion depth of 1, no archive seems mounted, instead the folder containing the rar. It appears a --recursion-depth of 2 is required then to really mount the archive, is that right? When using the --encoding SHIFT-JIS option, the mounted archives are just empty. I think not all of my archives are mounted with a weird name in it. This night I will give it another try, mounting those archives with a depth of 2 because it takes a long time.

When I do that, it says it mounts files actually, but it doesnt show up until the process finished completely. If there are some issues like above, I think, the process will stop completely. But let me see what after this night, with a --recursion-depth of 2 will bring.

@zDEFz
Copy link
Author

zDEFz commented Mar 1, 2023

If one out of 30000 rar files fail to mount, will nothing get mounted? I would expect after it says "Recursively mounted" that it has mounted something. By the way, program is great, issue seems just on my end. The issue is, that the format .exe of which winrar uses as extraction container is not supported by rarfile. It is however, with 7z afaik.

@mxmlnkn
Copy link
Owner

mxmlnkn commented Mar 15, 2023

I'm sorry for the late answer. It seems I lost track of the discussion (notifications).

If one out of 30000 rar files fail to mount, will nothing get mounted?

If those are independent rar files (not a multipart archive), then it should mount the 29999 normally while showing the faulty file directly instead of as a folder.

The issue is, that the format .exe of which winrar uses as extraction container is not supported by rarfile.

  • Thank you for figuring that out. Is this your original issue, i.e., would this issue be resolved by adding support for self-extracting archives? I would like to add libarchive support, which should be able to mount self-extracting rar archives but it can take a while and I would like to close this issue in favor of Support more formats #109.

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