I211 Debugging and Shortcuts

TL;DR Review Sheets

Many chapters end with a “Too Long; Didn’t Read” or “TL;DR” guide which should be reviewed frequently:

Inspecting Code in the Browser

Command = Mac, Control = PC

  • Chrome:

    • View > Developer > Developer Tools (using the menus)
    • Option + Command or Control + i (keyboard shortcut, toggle)
  • Firefox:

    • Tools > Web Developer > Inspector (using the menus)
    • Command or Control + c (keyboard shortcut)

Or, right click and:

  • “Inspect” (Chrome)
  • “Inspect Element” (Firefox)

Debugging

My web app does not appear in the browser

Make sure Flask is running. Double check.

Are you on Chrome?

If macOS is giving an “Access Deined” error on the web page, try going to this page: chrome://net-internals/#sockets and clicking the “Flush Sockets” button. Restart Flask and refresh the page in the browser.

My web app in the browser is not updating

Web browsers often cache pages. A “hard refresh” clears the cache and requests a fresh copy of a page from a server.

  • Mac: ⌘ Cmd + ⇧ Shift + R
  • Windows/Linux: ^ Ctrl + ⇧ Shift + R

Troubleshooting Flask Errors on Silo

Having trouble with the dreaded “Internal Server Error” when you host your application on the Burrow/Silo server?

Open the CGI debugger: https://cgi.luddy.indiana.edu/~hayesall/cgi-production-debugger

… and search for your username. Refresh the page as needed.

Inspecting Apache error logs

ssh USERNAME@cgi.luddy.indiana.edu
tail -f /var/log/apache2/error.log | grep USERNAME

Inspecting Apache suexec logs

A suexec violation usually occurs when file file permissions have been corrupted: for example, if one clones a git repository to the Windows File System instead of a WSL file system.

ssh USERNAME@cgi.luddy.indiana.edu
tail -f /var/log/apache2/suexec.log | grep USERNAME