LAMP module--how to track down errors?

NethServer Version: 8.latest
Module: ns8-lamp

Ever since yesterday’s DST change in .us, updates to my Meteotemplate installation running under ns8-lamp are failing with a 500 status code. The only entry I see in the log for that module is:

2025-11-03T07:09:31-05:00 [1:lamp1:apache2-app] 172.69.208.133 - - [03/Nov/2025:12:09:31 +0000] "GET /template/api.php?PASS=(redacted)&U=1762171119&SW=weewx-5.1.0&T=9.67&H=88.0&P=1021.436&UGP=1020.511&W=0.00&G=0.00&RR=0.000&R=0.000&TIN=24.00&HIN=49.0&TXBAT=0 HTTP/1.1" 500 217 "-" "weewx/5.1.0"

I don’t doubt that the actual problem is somewhere in Meteotemplate, but how can I track down the cause of the 500 status code?

Looking at /var/log/ inside that container shows nothing; all the logs point to stderr.

Usually log going to stderr are also going to the lamp app log that you can inspect from the system logs page.

I found that there seems to be a debugging mode in meteotemplate, see Meteotemplate WIKI

debugging mode: this mode can be temporarly activated in the setup.php. By default you should, under normal circumstances, always leave this disabled. Only activate it if you run into problems - your template is for some reason not working as it should and I ask you to do so. It will then show all the problems on the actual site. Please also note that in addition to actual errors, this activates also the PHP Notices. It is important to distinguish between these, PHP notices are not errors and do not necessarily mean something is wrong.

…and there’s nothing there but the line I posted.

I’m wondering if that’s been removed since the wiki page was last updated–there’s no mention of “debug” anywhere on the setup.php page or in config.php.

Maybe it helps to display php errors by using a .htaccess file as explained here?

Well, kind of. If I turn that flag on, I now get this in the log:

2025-11-03T07:55:37-05:00 [1:lamp1:apache2-app] 172.69.208.133 - - [03/Nov/2025:12:55:37 +0000] "GET /template/api.php?PASS=(redacted)&U=1762174536&SW=weewx-5.1.0&T=9.83&H=88.0&P=1022.181&UGP=1021.256&W=0.00&G=0.00&RR=0.000&R=0.000&TIN=23.83&HIN=49.0&TXBAT=0 HTTP/1.1" 200 179 "-" "weewx/5.1.0"

200 status code means it’s good, right? Well, no, it’s still failing; I’m now getting an error on my WeeWx system saying, Failed to publish record 2025-11-03 07:57:53 EST (1762174673): Server returned ''.

If I turn display_errors back off, it goes back to returning 500. :man_shrugging:

Thread on the Meteotemplate forum:

1 Like

Good idea to open a thread there.

I retested if php errors are really shown in system log and it works.

This is my test.php file:

<?php
error_log("This is just a test error!", 0);
?>

Resulting line in lamp system log:

2025-11-03T14:26:56+01:00 [1:lamp2:apache2-app] [Mon Nov 03 13:26:56.941055 2025] [php:notice] [pid 219] [client 1.2.3.4] This is just a test error!
1 Like