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

v3.10 breaks SSH connections #4081

Open
Fmstrat opened this issue Feb 18, 2024 · 4 comments
Open

v3.10 breaks SSH connections #4081

Fmstrat opened this issue Feb 18, 2024 · 4 comments
Assignees
Labels
Area-Ssh/Scp/Sftp Issue-Bug Related unexpected behavior or something worth investigating.

Comments

@Fmstrat
Copy link

Fmstrat commented Feb 18, 2024

Describe the bug
When using SSH connections, either the system can't validate the host key, or the second folder deep shows no files.

To Reproduce
Problem 1:
Steps to reproduce the behavior:

  1. Connect to SSH server connection that goes direct to a path like /storage
  2. Get list of folders
  3. Choose any sub folder
  4. No files are displayed

Problem 2:

  1. Connect to another SSH server
  2. Get:
ComposedException 1 :
	net.schmizz.sshj.transport.TransportException: [HOST_KEY_NOT_VERIFIABLE] Could not verify `ssh-ed25519` host key with fingerprint `...` for `...com` on port 1028

Expected behavior
Functional SSH with existing connections after upgrade

Smartphone (please complete the following information):

  • Device: S9 Pro tablet
  • OS: Android 14
  • Rooted: no
  • Version: 3.10
@VishalNehra
Copy link
Member

VishalNehra commented Feb 18, 2024

@TranceLove

@VishnuSanal VishnuSanal added Issue-Bug Related unexpected behavior or something worth investigating. Area-Ssh/Scp/Sftp labels Feb 19, 2024
@TranceLove TranceLove self-assigned this Feb 24, 2024
@Fmstrat
Copy link
Author

Fmstrat commented Mar 3, 2024

Any news on this? Trying to hold off on Google updates since this breaks a primary use case. Thanks!

@TranceLove
Copy link
Collaborator

Short answer: #4101 to the fix.

Longer answer: #4101 seems fix the problem, but this is to revert the change we did before to make other things work. Still running the regressions when I'm free, but not very satisfying. So I think for the time being the best workaround would be refrain from using SSH connections with default path to open, i.e. just browse from the root.

Even longer answer: deep down the classes, the culprit was the way lookup the connection parameters and connection instance from the connection pool, when the connection string in database has default path to open included, e.g.

ssh://[email protected]:22222/home/user

When the user opens /home/user/subfolder, current codebase has problem looking up connection with ssh://[email protected]:22222/home/user/subfolder.

I'm seeing some refactoring required to accommodate this, like separating the base URI and default path, so code can always lookup the connection using ssh://[email protected]:22222.

Otherwise, as a band-it solution, we deduct the path elements one by one, and try to match the connection string with database and connection pool until there is one; but this is inefficient and IMO not a good approach.

On the other hand, we may just drop the connection pool and use singletons to store the SSH/FTP connections instead. We have only 2 tabs, and perhaps 90% usecases we are copying files between device and remote server, but not between remote servers, so this might work as well. But this is refactoring equally expensive as the above "split URI to base path and default path" method.

@Fmstrat
Copy link
Author

Fmstrat commented Mar 4, 2024

Thank you! The default path info is helpful as that allows me to upgrade, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Ssh/Scp/Sftp Issue-Bug Related unexpected behavior or something worth investigating.
Projects
None yet
Development

No branches or pull requests

4 participants