Troubleshooting issues - is there/why isn't there a "toolkit" for it?

I quite enjoy poking my nose into other peoples issues as it gives me some insight into the problems that they have, what tools are available to extract the relevant information and also gets me digging around the man pages and websites looking for how to fix some of these issues when I invariably cause them on my own machine.

It strikes me that the same toolset is invariably used time and time again (inxi, lsusb and its bretheren, journalctl -b -1 and so forth). Has there ever been any consideration into building a toolkit which a user can run on their machine and have the thing gather all the output, and either present it to them in obviously cut and paste’able sections or even just upload the entire thing into a pastebin.

I often feel like a bit of a broken record (run this to show us what you really have as hardware, run this to show the logs, etc, etc.) so having it ran as one gathering process might well speed things up a bit.

Given the number of people who post screenshots of text, I’d argue that the searchability of the forum might well go up if you give the end user a way of mass uploading much of the relevant information, even if some of it has go via pastebin due to length restrictions on posts.

Speaking of which, what ARE the length restrictions on a post?

3 Likes

I think fpaste is sort of trying to be that (though without journal logs, as far as I can see from a quick look at the source) -

2 Likes

I hadn’t actually realised it could run logging and squirt it up to a pastebin - I assumed it just pasted a file and returned the URL. Handy!

There is another way to use fpaste too, by putting it at the end of say an inxi command - piping it to fpaste I guess (Im on my phine or Id look it up)

We should rejig the fpaste post by Ankur to include that.

Great ideas Steve! Maybe if you write a post with the basic commands you said, we can replace or edit Ankur’s pinned post? What do you think @ankursinha ?

1 Like

Shall do.

man fpaste

(link removes as Grumpey pointed out it is outdated)

That man page is a little out of date.

FPASTE(1)                                                                                          User Commands                                                                                          FPASTE(1)

NAME
       fpaste - manual page for fpaste 0.5.0.0

SYNOPSIS
       fpaste [OPTION]... [FILE]...

DESCRIPTION
              Send text file(s), stdin, or clipboard to the Fedora community pastebin at https://paste.centos.org and return the URL.

              It  is often useful to be able to easily paste text to the Fedora Pastebin at http://paste.fedoraproject.org and this simple utility will do that and return the resulting URL so that people may ex‐
              amine the output. This can hopefully help folks who are for some reason stuck without a graphical interface, working remotely, or any other reason they may be unable to  paste  something  into  the
              pastebin using a web browser.

              Examples: fpaste file1.txt file2.txt dmesg | fpaste (prog1; prog2; prog3) | fpaste fpaste --sysinfo --confirm fpaste -t "debug output" -l python foo.py

OPTIONS
       --version
              show program's version number and exit

       -h, --help
              show this help message and exit

              paste.fedoraproject.org Options:

       -t "TITLE", --title="TITLE"
              title of paste; defaults to UNTITLED

       -a "AUTHOR", --author="AUTHOR"
              author name; empty by default

       -r PRIVATE, --private=PRIVATE
              make paste private; defaults to 1

       -l "LANGUAGE"
              language of content for syntax highlighting; default is "text"; use "list" to show all 239 supported langs

       -x LIFE
              life of paste in minutes; default is 1 day (maximum)

              Input/Output Options:

       -i, --clipin
              read paste text from current X clipboard selection [requires: xsel]

       -w, --wayland-clipin
              read paste text from Wayland selection [requires the wl-clipboard package]

       -o, --clipout
              save returned paste URL to all available clipboards

       --input-selection=CLIP
              specify which X clipboard to use. valid options: "primary" (default; middle-mouse-button paste), "secondary" (uncommon), or "clipboard" (ctrl-v paste)

       --fullpath
              use pathname VS basename for file description(s)

       --pasteself
              paste this script itself

       --sysinfo
              paste system information

       --sysinfo-short
              paste shortened system information

       --audioinfo, --sysinfo-audio
              paste general audio information

       --videoinfo, --sysinfo-video
              paste general video information

       --diskinfo, --sysinfo-disk
              paste general disk information

       --netinfo, --sysinfo-net
              paste general network information

       --dnfinfo, --sysinfo-dnf
              paste repository and package information

       --pci-verbose, --sysinfo-pci-verbose
              paste verbose pci information

       --usb-verbose, --sysinfo-usb-verbose
              paste verbose usb information

       --btrfsinfo, --sysinfo-btrfs
              paste btrfs related system information

       --printonly
              print paste, but do not send

       --confirm
              print paste, and prompt for confirmation before sending

       --raw-url
              print raw url

EXAMPLES
       Paste file foo.txt at paste.fedoraproject.org

              fpaste foo.txt

       Paste output of ifconfig to paste.fedoraproject.org with description "my network config"

              ifconfig | fpaste

       Paste mycode.py to paste.fedoraproject.org with description as "problem with foo" and language "python"

              fpaste -l python mycode.py

       Paste mouse-selected text from the primary X selection clipboard, and then overwrite the same clipboard with the returned fpaste URL

              fpaste -io

       To manually paste clipboard contents, run fpaste without file arguments so that it waits for input, then paste using mouse middle-click, <Ctrl-V>, or other, then press <Enter> followed by <Ctrl-D> to fin‐
       ish (EOF).

       To paste the output of more than one program and/or file at a time, use the following example forms:

              (lsusb ; lspci) | fpaste
              fpaste <(lsusb) <(lspci)

              fpaste <(fdisk -l) /etc/grub.conf
              (fdisk -l ; cat /etc/grub.conf) | fpaste

              (uname -a ; yum repolist) | fpaste

       Gather and paste various information about the running system. The info collected should be practically anonymous, and you may use the --printonly or --confirm options to preview what would be sent.
       paste.fedoraproject.org URLs are also practically anonymous ([a-zA-Z0-9]**4 == 14,776,336 combinations), so you may also preview it instead before giving the link out.

              fpaste --sysinfo
              fpaste --sysinfo --confirm
              fpaste --sysinfo --printonly | less

BUGS
       Report bugs to: https://pagure.io/fpaste/new_issue
       or to: Jason 'zcat' Farrell <farrellj AT gmail DOT com> and Ankur Sinha 'FranciscoD' <ankursinha AT fedoraproject DOT org>.

AUTHOR
       Fedora Unity

fpaste 0.5.0.0                                                                                      August 2024                                                                                           FPASTE(1)
2 Likes

You know, I had a feeling that I’d read something which basically stated it was a tool to easily send stuff to a pastebin… which was evidently me reading the description and then entirely failing to read the rest of the man page.

I’ll ignore the fact that there’s a blindingly obvious pinned post all about fpaste and what it does because… bloke, something, something, never read instructions, etc.

I’ve pulled together a small list of ā€œstuff I’ve found usefulā€ but there’s overlap between some of those utilities so I need to stick it all in a matrix and work out what’s the best version for each piece of information so that the overlap is minimised.

1 Like

Well, this is escalating.

All I actually wanted to do was to fork fpaste, update the man page and fire in a pull request.

I’ve now been into pagure, I’ve created ssh keys and all kinds of faffing about trying to work out why git push refused all attempts at authentication before I read the packaging documents and realised there’s way more to this than I realised. I now have fedpkg, mock and a load of other stuff I’ve never heard of to learn.

On the plus side, if I ever get it working building packages working I’ve updated the stuff I found which was out of date in the manpage…

No need to learn all that now :slight_smile: You can file a bug with the fpaste developers and they can do that (hopefully). Find out where the upstream fpaste lives, and file the bug there.

If you put the updated info into a txt doc for them it will make it easy.

2 Likes

The man page is built from docstrings in the python and a page of examples in manpage markup, so I changed the python.

As I was going to add a few more entries like powertop I was reading the python anyway.

Kinda used it as s learning exercise for myself.

Nothing stopping me from sending the python script to the owners as is though.

3 Likes

Sure, all improvements are always welcome. I merged the PR on GitHub now. I can cut a minor release, or if people have more improvements planned, I can wait to include those too.

(We’ll probably move off Pagure to Forgejo if that’s an option. Otherwise, the GitHub mirror will continue to exist for contributors and I’ll keep it in sync.)

2 Likes

Aha! The author himself!

I was going to add a section for powertop reporting, but it requires sudo/run0 access to execute it seems. Wasn’t sure if calling sudo binaries from within the script was discouraged or whether there was a preferred way to do it, so I’ve been in decision paralysis for a few days thinking about it.

Do we care about sudo binaries being called or is it a case of elevation if needed and warn the user about it

I’m simply the current maintainer, the original script predates me by a number of years
:slight_smile:

We can include those commands with a separate flag perhaps and document that they need fpaste to be run as sudo—we could even include a check where if it wasn’t run as sudo, we’d print out a message to the user informing them?

(Generally, we don’t want to run it as sudo because it may worry users—who are not expected to read the script to confirm that we’re not doing anything malicious. So the main functionality should perhaps run without sudo—it also ensures that users that may not have sudo access can also generally use it.)

1 Like

In

Aye - this was why I was in a state of indecision. I’ll add in the powertop stuff alongside some text to inform the user and given them a chance to bail out if they want.

2 Likes

Move, move! :slight_smile: Embrace Forgejo.

I’d prefer encouraging users to find a filter that isolates relevant journal entries (messages?). It can be useful to add your own messages (# echo MESSAGE > /dev/kmsg) to the journal, e.g., to note that some problematic USB device is about to be connected so you can jump to the time of interest.

It is clear that requests for inxi and journalctl output will be the first encounter with the command line for some users, and that reading man pages or other documentation is also a novel experience.

In workshops introducing participants with no previous Linux experience to some specialized software written for POSIX command-line environments, we found it important to spend an afternoon with the LinuxCommand book. These days I suspect many users would find YouTube videos helpful, but I haven’t looked for good examples.

I should also note that the number of mistakes made by users can be greatly reduced if they adopt a ā€œbuddy systemā€ where the buddy checks the commands for typos before they are run.

Instead of building something to collect errors, I’d rather efforts be put towards fixing errors to not happen :stuck_out_tongue:

But I’ve generally found dmesg to be a good starting point!

In an Ideal world, me too. Sadly, it’s not an ideal world, and thus the next best thing is to re-write it all in rust. Failing that, make error collection better.

Then make error collection better again because it’s always crap.

Then train all the LLM’s that users trust implicitly to be only trained on the correct answers to collections of questions posed by other users.

May have had a bottle or two of wine. It should still all be re-written in rust though…