15

The need for this question arose out of this answer. To save everyone the trouble of reading the entire page, I will summarize:

We get a lot of questions here (such as "Why won't my wireless work?") that lack basic diagnostic information. We can easily post a comment asking the user to provide certain debug logs, etc. but then we get replies like "I don't know how to do that."

We need a simple GUI tool that is:

  • Easy to install and use.
  • Depends only on packages included on the Live CDs/DVDs.
  • Determines which debug logs and commands to run to gather the necessary information for inclusion in the question.
  • Uploads the logs to a pastebin for bonus points.

This GUI tool does not:

  • Automatically fix problems.
  • Compose the question for the user.

I started a project on Launchpad for this purpose - it's a Qt4 application (the binary will run without any dependencies that aren't included on the Live CDs/DVDs). Basically this tool asks the user what type of problem they are having and then grabs the appropriate logs.

Now, here's why I have asked this question here: we need to clearly define exactly what this tool's scope is as far as problems and commands go.

Each answer below lists a specific category or type of problem. Below that is a list of commands to be run to obtain diagnostic information and the location of log files that pertain to the problem. All of these answers are community wiki so y'all can edit them and help ensure as much information as possible is included.

Please also include a very brief sentence indicating how the command / file relates to the problem.


Edit: I have a screenshot!

enter image description here


Edit: I have created a special area on my website where users can create and submit "recipes" that run a series of commands for obtaining program output, etc.:

http://quickmediasolutions.com/autroubleshooter

I will be (hopefully) finalizing the syntax for the scripts soon.

6
  • 1
    I've almost got a working prototype here... hopefully I'll have something to share in a day or two. Commented Jan 10, 2013 at 5:58
  • Some of these might be useful, askubuntu.com/questions/14008/…
    – Mateo
    Commented Jan 11, 2013 at 20:36
  • Do you have one in native GTK?
    – Amith KK
    Commented Jan 12, 2013 at 16:00
  • @AmithKK: Um, no... my current plans for the application would be extremely difficult to implement with GTK. But... there's no reason someone couldn't write one :) Commented Jan 22, 2013 at 3:59
  • @GeorgeEdison I do not think Qt is part of the LiveCD
    – Amith KK
    Commented Jan 23, 2013 at 13:18
  • 2
    @AmithKK: releases.ubuntu.com/quantal/ubuntu-12.10-desktop-i386.manifest <--- libqtcore4 is there. Commented Jan 25, 2013 at 2:42

11 Answers 11

12

I couldn't sensibly fit this in a comment so here you go... I've been thinking about something like this for a while but there are some problems in your approach that have blocked me:

  • If they don't have network:

    • They can't install the app with a sudo apt-get install ...
    • It would either need to be completely portable (chucked on a USB stick and run) or included in the default install.
    • How do they then share the results? The application would need to write its report back to local storage (eg USB) so it can be exported to a networked computer for upload.
  • If they have graphics problems

    • They might not be able to see a graphical UI.
    • Needs to be something that is as functional from a simple command prompt.
      • In this case, it should explain to the user how to select options, like telling the user to look at the bottom row of text which will include something like [Space] to continue, [Escape] to go back, [Delete] to exit, arrow keys to select option
    • Also consider that the graphical environment handles network connections and the automounting of USB disks. Documentation needs to deal with these extra-hostile conditions.
11
  • 1
    +1 for running without seeing a GUI. As for the USB thing, the OP should know how to move a file from the desktop onto a flash drive.
    – Seth
    Commented Jan 10, 2013 at 17:20
  • 3
    But I don't think it's reasonable to expect them to know how to mount a USB drive from init1 and then run the application
    – Oli Mod
    Commented Jan 10, 2013 at 17:25
  • 2
    That's true. If you don't have internet and don't have a GUI, your stuck.
    – Seth
    Commented Jan 10, 2013 at 17:27
  • 2
    @Oli: I'm glad you asked. First of all, this is going to be a single binary / .deb file that only depends on packages included by default with Ubuntu / Kubuntu. The next problem is uploading the information without an active network connection - but I've got that one covered too. After the wizard completes, if it detects that there is no active Internet connection, it will offer to store the results on a flash drive or other storage. In fact, this is a cross-platform app so there can be two parts to this - the troubleshooting binary & a cross-platform app that uploads the logs to a pastebin. Commented Jan 11, 2013 at 4:17
  • 2
    Or even better, I'll add a page to my website where the user can upload the special file and it will take care of processing it by creating pastes for each of the log files inside and generating the markdown. The only problem left is the question of running a GUI app when X won't start. And really - that's not a problem if you think about it. If the user is left with a terminal anyway, they either are completely lost or they can run the log commands directly. Commented Jan 11, 2013 at 4:18
  • 2
    Last but not least (this really should have been another answer :P), I would love to eventually see this get included on the Ubuntu DVD by default since Ask Ubuntu is a support channel mentioned in the installer. I've even been dreaming of creating a Firefox extension that adds a button to the editing toolbar to launch the application if it is installed locally. We could even take this a step further and create a URI scheme for launching the troubleshooter - allowing us to give a "link" to the OP that runs a diagnostic test on their machine. I am so excited about this. Commented Jan 11, 2013 at 4:22
  • @GeorgeEdison "allowing us to give a "link" to the OP that runs a diagnostic test on their machine." <-- That is plain shell injection you're proposing there. Please, don't do this. Serious security threat. Have to downvote for this idea. You may call me a security monkey or a party pooper, but this will certainly kill it. see chat here
    – gertvdijk
    Commented Jan 11, 2013 at 10:12
  • @iSeth Can we possibly create a minimal live CD that can start a troubleshooter in text/ncurses mode, and chroot into the Ubuntu installation as needed?
    – nanofarad
    Commented Jan 11, 2013 at 12:22
  • @ObsessiveSSOℲ George Edison is the one to talk to not me :P (I'm supposing you meant him)
    – Seth
    Commented Jan 11, 2013 at 16:21
  • All right then @gertvdijk , lets put this discussion towards progress, and clean up Oli's answer that has not much to do with this, meta.askubuntu.com/a/5760/47291 I think most of the security points brought up were covered, If you think there are more we would be glad for the input.
    – Mateo
    Commented Jan 12, 2013 at 0:22
  • 3
    Whoah wait a minute - no commands are going to get run without prompting the user first. For example, if you click a link with the URI scheme for the troubleshooter in Firefox, first you will be asked by Firefox if you want to launch the default application for the URI. Secondly, the app will display the exact command that will be executed and confirm that you want it run. I don't see how this is any worse than telling people to copy-and-paste a command? Commented Jan 12, 2013 at 2:37
4

Inclusion of URI scheme

The basics of @GerogeEdison's idea from comment:

...create a URI scheme for launching the troubleshooter - allowing us to give a "link" to the OP that runs a diagnostic test on their machine.

Now, I propose we edit in the security requirements needed to implement this idea, Instead of down-voting or disregarding the entire project on a proposed feature, we want the feature to be on a similar level of security as "Paste this command in terminal" or better.

  • It must not run commands from website

  • Hard-coded recipes http://chat.stackexchange.com/transcript/message/7625674#7625674

  • PGP signed commands.

  • You are about to run AskUbuntu Troublshooter with the following option "Foo". The command that will be run is "/bin/foo --bar /var/foo.conf". 8 people trust this recipe. [OK] [Cancel]

    The "X people trust this recipe" should be a link to the list of trusters.

  • Will not progress without user consent.

  • Should have parameters that can be given, but cannot be exploited, perhaps using some sort of escapeshellcmd or something. If a command can be exploited with a plaintext parameter, check it even more within the recipe.

  • If the package of the command being run can be determined, change the message to:

    You are about to run AskUbuntu Troublshooter with the following option "Foo". The command that will be run is "/bin/foo --bar /var/foo.conf", from package foo-dev. 8 people trust this recipe. [OK] [Cancel]

    This may want to see some discussion.

3

Package / apt-get Problems

  • dpkg --get-selections - returns a list of all currently installed packages
  • dpkg --yet-to-unpack can help get a list of packages that for some reason didn't unpack successfully.
  • dpkg --no-act --foo foo.deb if it looks like the user is trying to blame a package file. Note from manpage:

    --no-act usually gives less information than might be helpful.

3

Wireless Connection Problems

  • ifconfig - returns current network interfaces and IP addresses

  • lspci -nnk | grep -iA3 Network - returns network controllers along with subsystems and kernel modules in use. possibly trailing lines (due to A3) if not all details are known/available.

  • lsusb - returns network adapters connected via USB (no reliable way of matching network devices?)

  • rfkill list - list of radio kill switches and their states

  • jockey-text -l - list what Jockey ("Additional Drivers") thinks about the current state of devices and its drivers (how to filter network-related?)

  • The hosts file.

1
  • Just as a note: We might want all of lspci, though lspci | grep Network works on my machine.
    – Seth
    Commented Jan 10, 2013 at 2:46
3

Graphics / Display Problems

  • lspci -nn - returns a list of display adapters on the computer
  • xrandr state of outputs and modes (screen size problems)
  • Read Xorg.conf and alternate Xorg config files to get configuration information.
  • jockey-text -l, for checking of available, recommended, and installed drivers.
3

Audio Problems

Source: https://askubuntu.com/a/14126/47291

  • cat /proc/asound/cards Audio devices detected
  • cat /proc/asound/card0/codec#0 replace card0 (codec#0 is different as well on systems) with further number for more devices,

    Will contain information about the first sound card, including information about the input/output ports connected to it. If you have a problem with plugging in a microphone, headsets, or external speakers, include this.

  • pulseaudio --dump-conf pulseaudio configuration file, includes information such as default-sample-rate, default-channel-map (useful for surround setups).

6
  • With /proc/asound/cards, can we somehow recursively cat the files?
    – nanofarad
    Commented Jan 15, 2013 at 0:19
  • @ObsessiveSSOℲ: Now that I have decided that the recipes are going to be written in JavaScript, sure - there's no limit on the logic that can be used in the scripts / recipes. Commented Jan 20, 2013 at 20:21
  • @ObsessiveSSOℲ: JavaScript is merely a scripting language - it only has access to what the environment the interpreter is running in provides. In the context of a web browser, obviously that environment is very restricted. QtScript allows me to expose any QObject-derived class to the scripting engine, so the sky is the limit here. Classes for running commands and accessing files are going to be a critical part. Commented Jan 20, 2013 at 21:10
  • @ObsessiveSSOℲ: You might be interested to see this. Commented Jan 20, 2013 at 22:04
  • Oh, you're using JS on QT. Translarency and PGP signing will still be respected, right?
    – nanofarad
    Commented Jan 20, 2013 at 22:10
  • @ObsessiveSSOℲ: Everyone will always be able to see whatever they are about to run. I'm still working on the GPG side of things - as it stands now, I'll be hand reviewing everything before it reaches "trusted" status on the website. Eventually, I hope to implement a GPG-based solution. Commented Jan 21, 2013 at 0:24
2

Version of Ubuntu Installed

May be of use to automatically include basic version information.

  • lsb_release -a
  • cat /etc/issue
  • uname -a

Information from How can I find the version of Ubuntu that is installed?

1
  • 1
    Perhaps recipes could be written in a hierarchy - where one recipe depends on others. This one, for example, would be used by many others. After all... no sense duplicating a bunch of stuff. Commented Jan 20, 2013 at 20:20
2

BIOS and CPU troubles

such as boot and compatibility:

  • dmidecode to get BIOS and CPU info from SMBios.
  • /proc/cpuinfo
2

Hard-drive Problems

  • fdisk -l List partitions
  • /proc/mdstat for RAID
  • mdadm with any combination of --query and --detail
  • mdadm.conf for RAID misconfiguration
  • df -h , du -hs ~ , du -hs ~/* space on hard-drive Why is Ubuntu telling me my drive is full?
2

User transparency

  • Present an unfoldable terminal so the user can see everything that is going on.

  • Allow the user to review the information to be sent before it is sent.

  • Provide a message like:

    You are about to run recipe 'Get hardware info', which will run 'lspci', which is in package 'foo'. This recipe has been created by George Edison, and is signed as trusted by 8 users.

    Clicking on [8 users] will provide a list of signatures.

  • Include options with recipes to check if the user wants part of the output sent(for example, the user may not want portions of lspci sent).

Possibly try to use SELinux sandboxes, with the sandbox settings requested as part of each recipe. When the recipe is run, it will first prompt that X, Y, and Z are going to be done, in accordance with X, Y, and Z being allowed by SELinux.

3
  • 2
    Excellent suggestions. I can incorporate all of these. I really like the suggestion of prompting the user before uploading anything. Commented Jan 16, 2013 at 1:47
  • @GeorgeEdison Would the SELinux idea work, or will it be hard to implement securely?
    – nanofarad
    Commented Jan 16, 2013 at 21:16
  • I'll look into it when I get a chance. Commented Jan 17, 2013 at 7:10
1

General

  • dmesg

[Needs expansion]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .