Bug 460810 - Accessing sftp remote file system sometimes causes "Internal Error"
Summary: Accessing sftp remote file system sometimes causes "Internal Error"
Status: REPORTED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: SFTP (show other bugs)
Version: 22.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-21 14:32 UTC by Nowa Ammerlaan
Modified: 2022-10-26 10:14 UTC (History)
2 users (show)

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


Attachments
debug log (3.02 MB, text/plain)
2022-10-25 11:31 UTC, Nowa Ammerlaan
Details
sshd config (3.51 KB, text/plain)
2022-10-25 11:54 UTC, Nowa Ammerlaan
Details
sshd debug log (104.67 KB, text/plain)
2022-10-26 10:14 UTC, Nowa Ammerlaan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nowa Ammerlaan 2022-10-21 14:32:41 UTC
SUMMARY

Accessing a remote file system using sftp initially works. However, after e.g. navigating into some folders, or copying some files it randomly stops working showing only "Internal Error". Sometimes going up a couple of folders fixes it, other times the only solution is to close dolphin and restart it. This has been happening for some time now.

STEPS TO REPRODUCE
1.  Open dolphin
2.  Open a sftp remote file system
3.  Interact with the file system a bit, copy some files, open some folders

OBSERVED RESULT
kf.kio.core: "Internal Error\nPlease send a full bug report at https://bugs.kde.org\nsftp://andrew@<REDACTED>/the/folder/i/am/trying/to/access".

EXPECTED RESULT
I can reliably navigate and interact with my remote file system.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo Linux 2.9, kernel version 6.0.2
KDE Plasma Version: 5.26.1
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION

I would be willing to debug this a bit further, but so far I've not been able to get kio to tell me anything more specific than "Internal Error".

Possible related: https://bugs.kde.org/show_bug.cgi?id=295299 though this bug is ancient and marked as resolved.
Comment 2 Nowa Ammerlaan 2022-10-25 11:31:50 UTC
Created attachment 153193 [details]
debug log

(In reply to Harald Sitter from comment #1)
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/Debugging_IOSlaves/
> Debugging_kio_sftp

Thanks! These environment variables helped me get a proper log, which I attached.
Comment 3 Harald Sitter 2022-10-25 11:39:52 UTC
kf.kio.workers.sftp: [ ssh_socket_pollcallback ] ( 4 )  ssh_socket_pollcallback: Poll callback on socket 15 (POLLIN POLLOUT POLLERR), out buffer 72
kf.kio.workers.sftp: [ ssh_socket_exception_callback ] ( 1 )  ssh_socket_exception_callback: Socket exception callback: 1 (0)
kf.kio.workers.sftp: [ ssh_socket_exception_callback ] ( 1 )  ssh_socket_exception_callback: Socket error: disconnected
kf.kio.workers.sftp: ssh_channel_poll failed:  Socket error: disconnected

Sounds a bit like the server just closed the connection at some point. Any interesting configuration there?
Comment 4 Nowa Ammerlaan 2022-10-25 11:54:13 UTC
Created attachment 153194 [details]
sshd config

(In reply to Harald Sitter from comment #3)
> Sounds a bit like the server just closed the connection at some point. Any
> interesting configuration there?

It does, though I don't really understand why. The configuration is not particularly interesting, it is more or less a standard configuration allowing only user key-based login (no passwords, no root login). Some forwarding and some ClientAlive options are enabled. Some env vars are accepted. Nothing very unusual I think, I've never had similar problems with other applications.
Comment 5 Nowa Ammerlaan 2022-10-26 10:14:39 UTC
Created attachment 153213 [details]
sshd debug log

So I also checked the server side debug log, but it doesn't show any obvious failure message.

What I did notice is that kio-sftp seems to be opening a bunch of new connections regularly, on different ports. Is it supposed to do that? Can it not just use a single connection? Perhaps it runs out of ports to use and then fails to make a new connection?