Lesson 4.4: Troubleshooting in class
Something always breaks in a hands-on course. A trainer who knows the five most common causes and where the logs are can fix most problems in minutes. This lesson prepares trainers with the troubleshooting chapter of the installation guide and the log viewer.
At a glance
| Course | Train the trainer |
| Module | Module 4: Delivering a course |
| Duration | 50 minutes (15 presenting, 35 exercise) |
| Level | Intermediate |
| Audience | Trainers and their helpers |
| Prerequisites | Module 2 |
Learning objectives
After this lesson, learners can:
- follow the five steps of "Start here" in the troubleshooting chapter;
- find an error in
var/log/error.logby its reference, on the command line and in Setup > Log files; - fix the common lab problems: file ownership, maintenance mode, stale caches, a lost password;
- decide when to give a learner a fresh installation instead.
Trainer's notes
How to present it
The five steps (5 minutes, from Troubleshooting, 12.1): read the message exactly; read
var/log/error.log(an error page shows a reference such asERR-1A2B3C4D5E, and the same reference is in the log); turn on debug output for yourself only; change one thing and clear the smallest cache that covers it; on the command line, run as the installation's owner.The common lab problems (10 minutes):
Symptom Fix Errors after a command was run as root chown -R <web user>:<web group> var; run scripts as the ownerA maintenance page after a failed install php bin/php/maintenance.php status, thenoffA change does not show clear the smallest cache: php bin/php/ezcache.php --clear-tag=template,--clear-tag=ini, or--clear-allLost administrator password php bin/php/resetuserpassword.php -u admin -g --allow-root-user(as root)Generated password unknown var/log/initial-admin-password(until it was deleted)
Common questions
When do I give up and reinstall? When the fix takes longer than a reinstall (a few minutes with SQLite). Keep the learner's notes; reinstall; let them catch up with a neighbour.
Can learners read the logs in the browser? Administrators can: Setup > Log files shows the logs with masking of private values; editors cannot.
Pitfalls
- Five changes at once. Change one thing, then test.
- Sharing logs with personal data. Mask or remove e-mail addresses and IP addresses before posting logs anywhere.
Hands-on exercise
On your training installation:
- Open Setup > Log files (
/setup/logsin the admin siteaccess, for example/admin/setup/logs) and openerror.log. Find the headings Controls, Lines of error.log and Actions. - On the command line, run
tail -n 20 var/log/error.log. - Simulate a maintenance window (only on your training installation):
php bin/php/maintenance.php on --until=5m, open the site and see the maintenance page, thenphp bin/php/maintenance.php offandphp bin/php/maintenance.php status. - Clear one cache tag with
php bin/php/ezcache.php --clear-tag=templateand read the output. - List the cache tags and ids:
php bin/php/ezcache.php --list-tagsand--list-ids. - Write a one-page "lab fixes" card with the table from the trainer's notes for your helpers.
Expected result
- The learner found
error.login the browser and on the command line. - The maintenance page appeared and disappeared again.
- A "lab fixes" card exists for the helpers.
Quiz
- An error page shows
ERR-1A2B3C4D5E. Where do you look? - Pages broke after a learner ran a script as root. What is the likely cause and fix?
- Which command clears every cache?
- Which command resets a lost administrator password?
Answers
- In
var/log/error.log(and its rotationserror.log.1...), or in Setup > Log files by searching the reference (Finding an error by its reference). - Root-owned cache or storage files;
chown -R <web user>:<web group> var. php bin/php/ezcache.php --clear-all.php bin/php/resetuserpassword.php -u admin -g --allow-root-user(as root), see Reset a user password.
Further reading
Related pages
- Module 4: Delivering a course
- Train the trainer: course overview
- Trainers: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.