veeso / termscp

🖥 A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3/SMB
https://termscp.veeso.dev
MIT License
1.61k stars 47 forks source link

[BUG] stays stuck on "loading local directory" #275

Open teto opened 3 weeks ago

teto commented 3 weeks ago

Description

Let me start with a grazie mille ! This is something I've been looking for a specific usecase. Everytime I change my hardware and need to reinstall my linux, it's pretty fast because my whole OS is configured as a nix derivation, the hard part is to transfer data, aka my passwords and various git repos. I used https://github.com/magic-wormhole/magic-wormhole.rs 'till now but it's not practical for lots of folders so I was looking for something more interactive like an rsync TUI and I found your project.

That's it for the introduction, now to my problems.

There is a server where I can SCP just fine. But once I use termscp to connect to the remote server it gets stuck at Loading local directory... until it timeouts with


        Could not initialize bookmarks (at "/home/teto/.config/termscp/bookmarks.toml",       │                                               │
  "/home/teto/.config/termscp/"): IO error (Could not write key to storage: Provider service  │                                               │

I press enter and then it resets the screen to default landing page (which I find a bit sad, I would prefer to it to prefill the connection settings with the URI I've just passed on the CLI)

Steps to reproduce

I've just done termscp -D scp://teto@192.168.1.20:12666

Note that scp -r -P12666 teto@192.168.1.20:/home/teto/hm ./hm worked just fine

Expected behaviour

Successful connection to server. Maybe more intermediate message, to know if it successfully logged in for instance. Right now it seems to display rightaway "Loading local directory" and I am not sure what directory it is ? Is it on localhost ? or the remote machine ? else why would it fail ?

Environment

Log

Here is the log file (would be nice if --help showed where it is): https://gist.github.com/teto/bd0684e9eb75a4ce2b83c1ccb2addd1c

NB: the template should tell about -D and where to find the log (even termscp --help or its manpage should tell where to look)

Additional information

Add any other context about the problem here.

veeso commented 3 weeks ago

Thank you! I appreciate you like termscp!

Does the directory /home/teto/.config/termscp exist? Is it writable by your current user?

teto commented 3 weeks ago

It is

➜ ls -l  ~/.config/ | grep termscp
drwxr-xr-x    - teto 16 Aug 16:33 termscp

ls -l  ~/.config/termscp 
.rw-r--r-- 395 teto 16 Aug 14:20  config.toml
.rw-r--r-- 948 teto 16 Aug 14:20  theme.toml
.rw-r--r--   0 teto 16 Aug 16:33  toto
veeso commented 3 weeks ago

Ok, probably there is an issue with the keyring provider. You could try rebuilding termscp with cargo and --no-default-features. I don't know what kind of keyring runs on your distro, but it may be not supported by the keyring library.

teto commented 3 weeks ago

that seems to be a bit better but still can't connect. For some reason, it tries to connect to another address than the one I specified I launch it as result/bin/termscp -D scp://teto@192.168.1.20:12666 and get:

2024-08-16T17:26:36.31928046Z [DEBUG] (1) termscp::ui::activities::filetransfer: Initialized view
2024-08-16T17:26:36.319307066Z [INFO] Created FileTransferActivity
2024-08-16T17:26:36.319320928Z [INFO] Client is not connected to remote; connecting to 192.168.1.20:12666

2024-08-16T17:26:36.319966151Z [DEBUG] (1) remotefs_ssh::ssh::scp: Initializing SFTP connection...
2024-08-16T17:26:36.319984133Z [TRACE] (1) remotefs_ssh::ssh::config: [/build/termscp-0.14.0-vendor.tar.gz/remotefs-ssh/src/ssh/config.rs:46] Parsing configuration at /home/teto/.ssh/config
2024-08-16T17:26:36.320056027Z [DEBUG] (1) remotefs_ssh::ssh::commons: Connecting to 'azure.redacted-website.net:12666'
2024-08-16T17:26:36.320644054Z [TRACE] (1) remotefs_ssh::ssh::commons: [/build/termscp-0.14.0-vendor.tar.gz/remotefs-ssh/src/ssh/commons.rs:39] Trying to connect to socket address '51.103.107.252:12666' (timeout: 30s)
2024-08-16T17:27:06.326676512Z [ERROR] No suitable socket address found; connection timeout

Not sure why it tries to connect to 'azure.redacted-website.net:12666' as it's a completely different website ? My config is structured like:

Match host=azure.redacted-website.net,azure1
  Port 12666
  IdentitiesOnly yes
...

Maybe it confuses its parsing library ?

EDIT: is it normal it tries SFTP when I specified scp ?