MaterialFiles icon indicating copy to clipboard operation
MaterialFiles copied to clipboard

Error when opening remote file with apps other than Material Files

Open DanrDoesCode opened this issue 1 year ago • 2 comments

So I got java.lang.ArrayIndexOutOfBoundsException: src.length=1 srcPos=0 dst.length=256 dstPos=-5 length=1 error when opening remote (SFTP) files with apps other than Material Files

How to reproduce:

  1. Open Material files.
  2. Setup remote SFTP file storage if you havent done so.
  3. Open any file inside the remote storage. Video: https://github.com/zhanghai/MaterialFiles/assets/169248210/a5b1aff2-db5d-41dd-8b4d-2b23e913373a

If the file is opened with Material Files (eg. Photo viewer, Text editor), it works But if i open it in apps other than Material Files (in the video below i choose Xed, but it can be any app), it will throw error like i mentioned above

The only way to fix the error is to restart the app (remove it from recent apps, then manually relaunch)

I'm using latest version 1.7.2 arm64 from play store

DanrDoesCode avatar May 18 '24 10:05 DanrDoesCode

Likely an underlying issue in hierynomus/sshj, but I don't even use SFTP myself...

zhanghai avatar May 18 '24 21:05 zhanghai

I also experience this issue already for a long time, exactly as explained. in my case, specifically if I try to open a remote PDF file using https://f-droid.org/packages/com.artifex.mupdf.viewer.app/ and a blank error appears because the remote file cannot be opened. interesting is that there is no good way to recover from this error once the issue appeared once. even closing the app and opening it again does not resolve it. it seems the SFTP connection is maintained and the server remains unreachable with this error. only when you wait for a while (probably when the ssh connection times out or is closed automatically after inactivity) material files is able to make a new connection and use the SFTP server again.

even if this is an issue with sshj, it would be great if material files could recover from this error.

this seems to be the same error as #851 .

Image

lriesebos avatar Jan 20 '25 20:01 lriesebos