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

How to debug/troubleshoot #538

Merged
merged 12 commits into from
Jul 14, 2020
Merged

How to debug/troubleshoot #538

merged 12 commits into from
Jul 14, 2020

Conversation

adswa
Copy link
Contributor

@adswa adswa commented Jun 25, 2020

Fixes #536.
Feedback welcome. At the moment, this is an overview of logging and a hint on how to get into the debugger, and a collection of funny comics to make reading the section less dreadful 😉
Also, I found datalad/datalad#4661 while at it.

@glatard
Copy link
Contributor

glatard commented Jun 26, 2020

Hi @adswa, this would be very useful!

Here is a bit of text that you might consider adapting and adding somewhere to this section (not sure what the right place is):

File doesn't get downloaded by datalad get <file_name>, no error message is returned

It is common for datalad get errors to originate in git-annex, the software used by DataLad to transfer data. Here are a few suggestions to debug them:

  • Take a deep breath, or preferably a walk in a nice park :)
  • Check that you are using a recent version of git-annex
    • git-annex version returns the version of git-annex on the first line of its input
    • The version number contains the release date of the version in use. For instance, git-annex version: 8.20200330-g971791563 was released on 30 March 2020.
    • If the version that you are using is older than a few months, consider updating using the instructions here
  • Try to download the file using git-annex get -v -d <file_name>
    • If this doesn't succeed, the DataLad command may not succeed.
    • Options -d and -v are here to provide as much verbosity in error messages as possible
  • Read the output of git-annex, identify the error, breathe again, and solve the issue!
  • Examples of possible issues:
git-annex error A solution that worked once
Last exception was: Could not find a suitable TLS CA certificate bundle, invalid path: /etc/pki/tls/certs/ca-bundle.crt [adapters.py:cert_verify:227] unset environment variable CURL_CA_BUNDLE
Permission denied when writing file Download to a writeable file system

@adswa
Copy link
Contributor Author

adswa commented Jun 27, 2020

That's fantastic @glatard, thank you!

@adswa
Copy link
Contributor Author

adswa commented Jun 27, 2020

I've added your suggestion to this PR - thanks! I might integrate the "common error messages and what they mean" section into the table format. I like it a lot!

@adswa
Copy link
Contributor Author

adswa commented Jun 27, 2020

ah, and before I forget: @all-contributors please add @glatard for content

@allcontributors
Copy link
Contributor

@adswa

I've put up a pull request to add @glatard! 🎉

@adswa
Copy link
Contributor Author

adswa commented Jul 13, 2020

@mih, can you take a look at this if you get a chance? not urgent

Copy link
Collaborator

@mih mih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thx! I made a few remarks, but feel free to ignore them.

docs/basics/101-135-help.rst Outdated Show resolved Hide resolved
- **info**: This log level will include reports by the program that indicate normal behavior and serve to keep you up to date about the current state of things, in additions to warning and error logging messages.
- **debug**: This log level is the most useful to troubleshoot a problem, and results in DataLad telling you *absolutely everything* it possibly can.

By default, the log level is set to ``warning``. Raising the log level (e.g, to ``error``) will decrease the amount of information and output you will receive, while lowering it (e.g., to ``info``) will increase it.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? I though I still see INFO messages by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumption is based on https://github.com/datalad/datalad/blob/dd09e4dfd7014438305daf398b833f9e03e03273/datalad/cmdline/common_args.py#L41, but I may be mistaken:

_log_level_names = ['critical', 'error', 'warning', 'info', 'debug']
log_level = (
    'log-level', ('-l', '--log-level'),
    dict(action=LogLevelAction,
         choices=_log_level_names + [str(x) for x in range(1, 10)],
         metavar="LEVEL",
         default='warning',
         help="""set logging verbosity level.  Choose among %s.  Also you can
         specify an integer <10 to provide even more debugging information"""
              % ', '.join(_log_level_names))
)

docs/basics/101-135-help.rst Outdated Show resolved Hide resolved
@adswa
Copy link
Contributor Author

adswa commented Jul 14, 2020

I'll merge this, I have removed any mention of default log levels.

@adswa adswa merged commit c131bd9 into master Jul 14, 2020
@adswa adswa deleted the debug branch July 14, 2020 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Needed: A troubleshooting section
3 participants