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

Improve user self-help by parsing the debug log for common errors #682

Closed
diginc opened this Issue Sep 12, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@diginc
Copy link
Member

commented Sep 12, 2016

Expected Behaviour:

As a pi-hole user, when I run pi-hole -d I don't want to have to scan through 100s of lines of output and have a deep understanding of linux to get some idea of what is wrong. This may help lighten the load of the support to allow more new dev work. Suggested quick fix command and links to FAQ/Knowledge bases that the user can learn to help them selves with would be awesome.

Actual Behaviour:

I get a lot of data output...which I can understand personally but I could see lots of beginners with raspberry pi (possibly their first linux system) not understanding at all.

Suggested Implementation

We need a log parser to identify common issues that come out of the debug log. Preferably ran right after the debug script is done and grabs the user's attention, then makes suggestions.

I won't make a comprehensive list of things to parse for but here is one example I just saw in a pi-hole debug output:

When pi-hole -d runs and discovers a lighttpd log with something along these lines:

#### ...snip...

lighttpd processes status:
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2016-09-12 16:25:52 CDT; 33min ago
  Process: 36284 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 36275 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 36284 (code=exited, status=255)

Sep 12 16:25:52 ubuntu001 systemd[1]: Starting Lighttpd Daemon...
Sep 12 16:25:52 ubuntu001 lighttpd[36275]: Syntax OK
Sep 12 16:25:52 ubuntu001 systemd[1]: Started Lighttpd Daemon.
Sep 12 16:25:52 ubuntu001 systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Sep 12 16:25:52 ubuntu001 systemd[1]: lighttpd.service: Unit entered failed state.
Sep 12 16:25:52 ubuntu001 systemd[1]: lighttpd.service: Failed with result 'exit-code'.

##### ...snip, cut to lighttpd section...

2016-09-12 16:25:52: (log.c.164) server started 
2016-09-12 16:25:52: (mod_fastcgi.c.1112) the fastcgi-backend /usr/bin/php-cgi failed to start: 
2016-09-12 16:25:52: (mod_fastcgi.c.1116) child exited with status 2 /usr/bin/php-cgi 
2016-09-12 16:25:52: (mod_fastcgi.c.1119) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags. 
2016-09-12 16:25:52: (mod_fastcgi.c.1406) [ERROR]: spawning fcgi failed.

#### snip

At the end I'd hope for an output along the lines of:

$ pihole -d

# ... SNIP ...

Issues discovered 2:

Issue 1:  PHP Backend Errors
 :: Issue 1 SUGGESTED FIX (Try running this command):  `sudo apt-get install php5-common php5-cgi php5 ;`
 :: Issue 1 FAQ Links: http://pi-hole.net/faq/lighttpd-php-errors

Issue 2: Lighttpd Not running
 :: Issue 2 SUGGESTED FIX: `sudo service lighttpd restart
 :: Issue 2 FAQ Links: http://pi-hole.net/faq/lighttpd-not-starting

WAIT! Before posting this issue have you tried the above suggested fixes?  Start with the first issue and work your way down.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Mcat12

This comment has been minimized.

Copy link
Member

commented Sep 13, 2016

Neat! The hard part will be parsing the output... I wish we had Python right now!

@jacobsalmela

This comment has been minimized.

Copy link
Member

commented Jul 7, 2017

@diginc do #1565 and #1585 solve this issue for you?

The new debug script will highlight errors or warnings in red or yellow and then link to an FAQ (in blue). If the user's install does not have any issues, they will still see the output, but there will be lots of green text to indicate things are fine.

@diginc

This comment has been minimized.

Copy link
Member Author

commented Jul 7, 2017

Brilliant work! This is what I had in mind.

@diginc diginc closed this Jul 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.