Jump to content

Guidelines and HOWTOs/Debugging/Debugging IOSlaves/Debugging kio sftp: Difference between revisions

From KDE Community Wiki
*>Adam Porter
Mention apparently-incorrect ssh/sftp logging instructions
Sitter (talk | contribs)
No edit summary
 
(9 intermediate revisions by 4 users not shown)
Line 3: Line 3:
= Overview =
= Overview =


When you point file manager to sftp://''user''@''target'', [http://websvn.kde.org/trunk/KDE/kdebase/runtime/kioslave/sftp/kio_sftp.cpp?view=log the sftp kioslave] uses [http://www.libssh.org libssh] to open a connection to the sftp server.
When you point file manager to sftp://''user''@''target'', the sftp KIO slave uses [http://www.libssh.org libssh] to open a connection to the sftp server.


= Reporting Bugs =
= Reporting Bugs =


If this is your first bug report please read the following document:
For efficient handling of bug reports detailed information is key. Make sure to tell us:


[http://www.chiark.greenend.org.uk/~sgtatham/bugs.html How to Report Bugs Effectively]
* The KDE Frameworks, and Dolphin version you're running
 
Then got to http://bugs.kde.org/ and create a bug report. Tell us:
 
* The KDE you're running
* The libssh version installed
* The libssh version installed
* The sftp server version (e.g. the openssh version on the server)
* The type and version of the SFTP server (e.g. "openssh 7.0 on opensuse 42" or "libssh 0.8 on Windows 10")
* If you use ~/.ssh/config show us your special host config
* Provide log files (see below)
* Provide log files if possible (see below)


= Logging =
= Logging =


You may want to switch on logging for kio_sftp.
Most bug reports will require debug logs to be able to move ahead.
To get the debug log start dolphin from konsole or another terminal with this command:


In this example, we want to log the output to /tmp/kio_sftp.log. Open a konsole or run the command 'kdebugdialog --fullmode'.
{{Input|1=<nowiki>
KDE_FORK_SLAVES=1 QT_LOGGING_RULES="log_kio_sftp=true;kf.kio.workers.sftp=true;" dolphin --new-window YOUR_SFTP_URL
</nowiki>}}


In the "Debug Area" select "7120 kio_sftp". In the Information box select 'Information' as the "Output" and use '/tmp/kio_sftp.log' a the "File".
Make sure to replace YOUR_SFTP_URL with the actual URL that is giving you trouble (e.g. sftp://localhost). Then reproduce whatever issue you are experiencing. When you are done simply copy and paste the entire output from the terminal to the bug report.


To enable logging you have to reload the slave system. You can do this by calling:
= Logging with libssh debug output =


'kdeinit4'
You generally do not have to provide these unless explicitly asked for.


= Logging with libssh debut output =
To enable libssh debug messages in addition you have to set an additional environment variable:


To enable libssh debug messages in addition you have to set an environment variable before calling kdeinit.
{{Input|1=<nowiki>
KIO_SFTP_LOG_VERBOSITY=10 KDE_FORK_SLAVES=1 QT_LOGGING_RULES="log_kio_sftp=true;kf.kio.workers.sftp=true;" dolphin --new-window YOUR_SFTP_URL
</nowiki>}}


KIO_SFTP_LOG_VERBOSITY=1 kdeinit4
= Enable logging in openssh (server-side) =


= Enable logging in openssh =
You generally do not have to provide these unless explicitly asked for.


(Both of the instructions below refer to sshd, the server--these should not affect client operations, e.g. running ssh or sftp.  I don't think these instructions are correct.)
Sometimes it may be useful to enable logging on the server to get a more complete picture of what's going on.


== SSH Logging ==
== SSH Logging ==


Edit /etc/ssh/sshd_config
Edit {{Path | /etc/ssh/sshd_config }}


Look for LogLevel and set it to:
Look for LogLevel and set it to:


{{Input|1=<nowiki>
   LogLevel DEBUG
   LogLevel DEBUG
</nowiki>}}


== SFTP Logging ==
== SFTP Logging ==


Edit /etc/ssh/sshd_config
Edit {{Path | /etc/ssh/sshd_config }}


Look for the sftp subsystem and change it to:
Look for the sftp subsystem and appned <code>-l DEBUG</code> it to:


{{Input|1=<nowiki>
   Subsystem sftp /usr/lib64/ssh/sftp-server -l DEBUG
   Subsystem sftp /usr/lib64/ssh/sftp-server -l DEBUG
</nowiki>}}

Latest revision as of 17:08, 22 October 2022

This page is a starting point for debugging kio_sftp. Please also read how to debug IO slaves generically.

Overview

When you point file manager to sftp://user@target, the sftp KIO slave uses libssh to open a connection to the sftp server.

Reporting Bugs

For efficient handling of bug reports detailed information is key. Make sure to tell us:

  • The KDE Frameworks, and Dolphin version you're running
  • The libssh version installed
  • The type and version of the SFTP server (e.g. "openssh 7.0 on opensuse 42" or "libssh 0.8 on Windows 10")
  • Provide log files (see below)

Logging

Most bug reports will require debug logs to be able to move ahead. To get the debug log start dolphin from konsole or another terminal with this command:

KDE_FORK_SLAVES=1 QT_LOGGING_RULES="log_kio_sftp=true;kf.kio.workers.sftp=true;" dolphin --new-window YOUR_SFTP_URL

Make sure to replace YOUR_SFTP_URL with the actual URL that is giving you trouble (e.g. sftp://localhost). Then reproduce whatever issue you are experiencing. When you are done simply copy and paste the entire output from the terminal to the bug report.

Logging with libssh debug output

You generally do not have to provide these unless explicitly asked for.

To enable libssh debug messages in addition you have to set an additional environment variable:

KIO_SFTP_LOG_VERBOSITY=10 KDE_FORK_SLAVES=1 QT_LOGGING_RULES="log_kio_sftp=true;kf.kio.workers.sftp=true;" dolphin --new-window YOUR_SFTP_URL

Enable logging in openssh (server-side)

You generally do not have to provide these unless explicitly asked for.

Sometimes it may be useful to enable logging on the server to get a more complete picture of what's going on.

SSH Logging

Edit /etc/ssh/sshd_config

Look for LogLevel and set it to:

  LogLevel DEBUG

SFTP Logging

Edit /etc/ssh/sshd_config

Look for the sftp subsystem and appned -l DEBUG it to:

  Subsystem sftp /usr/lib64/ssh/sftp-server -l DEBUG