Bug 495801 - Cannot reconnect after server restart (Internal Error)
Summary: Cannot reconnect after server restart (Internal Error)
Status: RESOLVED FIXED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: SFTP (show other bugs)
Version: 24.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-04 20:33 UTC by Grósz Dániel
Modified: 2024-11-21 12:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grósz Dániel 2024-11-04 20:33:40 UTC
SUMMARY
If, after connecting to an SFTP server, the server is restarted, KDE apps subsequently cannot connect to that server again for a few minutes. Even trying Refresh actions, or switching to a local folder and then back to the remote server, don't resolve it.

Typical use case: editing config files on a server, rebooting so they take effect, and then continuing working on them.

STEPS TO REPRODUCE
1. Open an SFTP remote folder in Dolphin.
2. Reboot the server. (I guess restarting the SSH server may also trigger it, but I haven't checked.
3. Refresh the folder in Dolphin, perhaps multiple times.

OBSERVED RESULT
"Internal Error
Please send a full bug report at https://bugs.kde.org"

After a few minutes it works again. (I guess the connection or the kio_sftp process is dropped if it's unused for a few minutes?)

EXPECTED RESULT
After realizing that the current connection doesn't work anymore, it attempts to reconnect once. Or at least the current connection is dropped, so a subsequent refresh or other operation starts a new, working connection.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20241102
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.5-1-default (64-bit)
Comment 1 Grósz Dániel 2024-11-04 20:39:42 UTC
Related: Bug 395739. At that point Dolphin hung; it was closed automatically after the reporter didn't confirm that it was still reproducible. Perhaps the underlying problem is the same, it just now throws an error message.

I now checked, restarting sshd alone doesn't trigger the bug because existing sessions are preserved, but killing the sshd-session and sftpserver processes does.
Comment 2 Bug Janitor Service 2024-11-05 14:52:13 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/379
Comment 3 Harald Sitter 2024-11-21 11:55:35 UTC
Git commit 9d624e7c388a3b32c49783e0bfb4e8fd5845a475 by Harald Sitter.
Committed on 21/11/2024 at 11:46.
Pushed by sitter into branch 'master'.

sftp: close connection on fatal errors

might require future refactoring to route more errors through
reportError to cover all cases but looking through the code the most
relevant points already do so while most other errors are of an
recoverable nature

M  +17   -1    sftp/kio_sftp.cpp

https://invent.kde.org/network/kio-extras/-/commit/9d624e7c388a3b32c49783e0bfb4e8fd5845a475
Comment 4 Harald Sitter 2024-11-21 12:08:33 UTC
Git commit f2496118fedb81d25e527bfa60fc7501f4209c7b by Harald Sitter.
Committed on 21/11/2024 at 11:56.
Pushed by sitter into branch 'release/24.12'.

sftp: close connection on fatal errors

might require future refactoring to route more errors through
reportError to cover all cases but looking through the code the most
relevant points already do so while most other errors are of an
recoverable nature


(cherry picked from commit 9d624e7c388a3b32c49783e0bfb4e8fd5845a475)

Co-authored-by: Harald Sitter <sitter@kde.org>

M  +17   -1    sftp/kio_sftp.cpp

https://invent.kde.org/network/kio-extras/-/commit/f2496118fedb81d25e527bfa60fc7501f4209c7b