Troubleshooting/es

El objetivo de esta página es brindar a los usuarios, en particular a los nuevos, un conjunto de técnicas y herramientas para permitirles diagnosticar y resolver problemas en sus instalaciones de Gentoo con sus propios medios. Adicionalmente, para aquellos problemas que son más complicados, este artículo busca proveer a los usuarios de la habilidad de recolectar información que los ayudará, tanto a ellos como a quienes les den soporte, a resolver sus problemas con mayor facilidad.

Este artículo asume que Gentoo Handbook ha sido leído y que se posee una comprensión básica del uso de Gentoo.

Dónde conseguir ayuda
Gentoo tiene unas cuantas wikis, las cuales poseen una gran cantidad de información. Hay que tener en cuenta que algunos artículos pueden contener información vieja o desactualizada, sin embargo la lectura de los artículos de la wiki es siempre un paso crítico cuando usamos Gentoo.


 * La Wiki Oficial de Gentoo
 * Archivo de los artículos del viejo Gentoo-Wiki.com
 * Base de conocimientos, para prácticas y problemas comunes

En IRC, es el canal recomendado para problemas generales. Es probablemente el camino más rápido para obtener una respuesta.

Teniendo en cuenta que los canales de IRC requieren de una presencia activa, algunos usuarios prefieren dejar mensajes en los foros o en las listas de correo. Cuando nos responden, una notificación (usualmente por email) nos es enviada.

Cuando todo lo demás falla, y parece haber algo roto con Gentoo, el Gentoo's bug tracker es una gran herramienta para ver si algo ha sido ya reportado, o para crear nuevos reportes de error si es necesario. Es una manera muy efectiva de llegar a los Desarrolladores de Gentoo, quienes pueden utilizar el reporte para mejorar la situación problemática y resolver el problema.

Programas
Esta es una lista de herramientas que son "altamente" recomendadas:

Primeros pasos
En función de solucionar un problema, primero es necesario tener una buena comprensión del mismo. Si el problema no es claro, entonces será difícil, sino imposible, obtener una solución. Una descripción detallada y acertada del mismo es más apta para obtener la mejor solución posible.

Identificando el problema
Esta parte puede parecer muy obvia, pero sin ella, cualquier resolución de problemas será casi imposible.

Toma nota de algunas cosas:
 * 1) ¿Es un problema relacionado con el hardware o con el software?
 * 2) ¿Que se realizó o cambió recientemente, que pueda ser la causa de este problema?
 * 3) ¿Se puede recolectar información adicional sobre el problema?

Storing any form of detail, logs, other people experiencing it and more can be valuable and gives a good overview.

Drivers
Driver issues for hardware is one of the more common issues that are reported on IRC.

First and foremost, identify what the hardware is that is causing problems. and are great tools for this purpose. For demonstration purposes, we'll be looking at an Ethernet card as the troublesome device.

Determining the proper driver
First look with and find the device information:

It is also possible to use the  option to give a short-hand notation (which might be easier to search for on the Internet):

The model name and vendor/model  can be used to look up the device on a place like WikiDevi or Debian HCL to find the right driver to use in Linux.

Verifying the driver is loaded
Getting the driver is less than half of the battle. Most of the trouble with drivers is making sure that they are loaded and operating correctly.

Relying on our friend again, run:

Note that here, an indicator is given that a driver is in use. If not, then no driver has claimed responsibility over this hardware. Assuming the driver was built as a module rather than built-in, try to attempt loading the right module. If the driver was built-in, consider making it a module, because modules can be loaded with and unloaded with  which saves on number reboots while debugging the issue.

Troubleshooting a driver
Compile the driver as a module, then capture the output it generates when the module is loaded. Make sure to first remove all modules that depend on the driver (see ).

The following command will compare the output after removing the module (in this example,  ) with the output after adding the module again, effectively showing the messages that were added (lines starting with +).

The most common issue is missing firmware. If a message shows up that informs the administrator about missing firmware, grab either or a specific firmware package from Portage and install it. After the firmware installation, unload and load the kernel module again to see if this fixes the situation.

Dependency graph slot conflicts
Occasionally, messages like this occur when trying to emerge a package:

Generally, this means that the packages listed have multiple requested versions in the dependency graph. And fortunately most, if not all, cases allow to resolve it by manually upgrading to the highest requested version. So assuming that the following message was received:

The most recent version desired is 20120520, so:

Often, it's advantageous to one-shot ( or  ) all of the conflicts at once because they sometimes depend on one another (see also World set).

Here is another example of a block:

There should be no problem changing poppler versions. Note that luatex and cups-filters don't require a specific version of poppler, but they need to be rebuild with whatever version is used:

Collecting additional information
When seeking help, more times than never additional information will be asked, such as the output of a command. Some of these produce dozens or hundreds of lines of text - too much to be suitable for pasting into IRC chat rooms, such as the Gentoo support channel on Freenode. That's where comes in handy - it allows users to post short links that contain long output.

Make sure that is installed:

For instance, to show the contents of, using is as simple as:

Or let's say that someone needs the detailed output of an command is:

Sometimes it is necessary to redirect stderr to stdout so that error messages can be pasted as well. That can be done like this:

These return a link to a pastebin site page that can be easily shared with someone to get help.

Things to consider pasting:


 * In case of hardware problems or kernel issues:


 * In case of portage issues:


 * In case of package installation failures:


 * In case of Xorg issues:


 * In case all installed packages on the system needs to be provided:

Wrapping things together
Below is a shell function that can be used to have several commands executed and their output processed by a single command so that only one URL needs to be provided to the user or developer that wants to help out:

Please do not use pastebin services on the gentoo-user mailing list
Most pastebin services expire old pastes periodically (not to mention that pastebin services are hardly profitable, and close down all the time) whereas mailing list messages are archived in multiple places and are referenced for years. If the relevant output is short, or can be trimmed, then copy and paste it into the body of the email - longer output can be directed into a text file and added as a plain attachment.

Forming a solution
With a good description of the problem, a complete history of actions and all sorts of debugging data (problem details, hardware / software information, logs, backtraces and more) a good set of useful data is available to look for a solution.

In general, repeat the following steps to come to a solution:


 * Get an idea where the problem might be, think about possible causes.
 * If there are no obvious areas to look into, become more acquainted with the related areas or ask an expert more about it.
 * Sometimes it is necessary to make assumptions to proceed. When assumptions are made, put it to the test: false assumptions should not make users and developers blind of other causes.
 * Obtain additional debugging information in the area of a problem, or perform tests.

Often this will lead to multiple possible causes. It is important to test them (to verify it is the actual cause or not) and therefore test them individually; this is also known as "divide and conquer".

Let's say a problem like "my browser sometimes displays white pages when I boot" comes up and a lot of details are already known about it, then there may be number of possible causes:


 * Is this because the browser was improperly closed when the system rebooted?
 * Verify this by killing the process and pulling the plug several times, each time checking if the pages are white after booting again. If this is a cause, is it the actual cause or are there other causes?


 * Is this the result of a specific browser version being broken?
 * Try older or newer versions for a few days or reboots and see if they are broken as well.

And so on...

With the additional information, dare to think about more specific causes:


 * Does a certain pinned tab X that loads plugin Y break the system?
 * Unpin the tab so it doesn't open on launch anymore or disable the plugin, see if this keeps the problem away.


 * Graphical issues were reported as well, might this maybe mean this is caused by the video drivers?
 * Try a different version for those drivers, or alternative drivers if available.

As each possible cause is investigated, the actual cause of the problem might come closer and closer.

And in the end, if the cause is still not found, the Where to get help resources at the top of this article yield a multitude of places with people that are looking forward to help; make them happy with a careful problem description and mentioning what has already been tried so far, it'll help them help out.