Error in V122 - failed to load resource

44 views
Skip to first unread message

CuriousCorn

unread,
Jan 7, 2022, 1:08:21 AM1/7/22
to measureit
Hi, I just installed V122 from the image file, added some price data and collected some data. When I try to enter the 'costs' section, to see the statistics over time, I get a "failed to load resource" error when trying to expand the dates (I captured using the Web Inspector - about the limit of what I can do, given my lack knowledge!). Copying that URL below into my browser also produces the same error. Everything else works fine, just not the sensor_statistic part. Any ideas?

Thanks in advance,
Chris

"Failed to load resource: http://192.168.1.122/php/measureit_functions.php?do=sensor_statistic&sensor_position=1&sensor=0&table=measure_watt_hourly&timeframe=position&range_from=2020-12-20&order=hour_id&turn=desc the server responded with a status of 500 (Internal Server Error)"

Summary
URL: http://192.168.1.122/php/measureit_functions.php?do=sensor_statistic&sensor_position=1&sensor=0&table=measure_watt_hourly&timeframe=position&range_from=2020-12-20&order=hour_id&turn=desc
Status: 500 Internal Server Error
Source: Network
Address: 192.168.1.122:80
Initiator:
jquery-1.7.1.min.js:4:16798

Request
GET /php/measureit_functions.php HTTP/1.1
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-GB,en;q=0.9
Host: 192.168.1.122
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15
Referer: http://192.168.1.122/
Accept-Encoding: gzip, deflate
Connection: keep-alive
X-Requested-With: XMLHttpRequest

Response
HTTP/1.1 500 Internal Server Error
Transfer-Encoding: Identity
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Date: Fri, 07 Jan 2022 05:59:48 GMT
Server: nginx/1.14.2

Query String Parameters
do: sensor_statistic
sensor_position: 1
sensor: 0
table: measure_watt_hourly
timeframe: position
range_from: 2020-12-20
order: hour_id
turn: desc

Thomas

unread,
Jan 16, 2022, 3:57:06 AM1/16/22
to measureit
Error 500 indicates a error in php. Do you get a error message in the php logfile in /var/log?

CuriousCorn

unread,
Jan 21, 2022, 12:36:35 AM1/21/22
to measureit
Hi Thomas,

I get this in /var/log/nginx/error.log:

2022/01/17 21:38:26 [error] 454#454: *2 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Cannot use string offset as an array in /web/measureit/measureit_public_html/php/measureit_functions.php:554

Stack trace:

#0 /web/measureit/measureit_public_html/php/measureit_functions.php(526): sensor_statistic_get(Array)

#1 /web/measureit/measureit_public_html/php/measureit_functions.php(32): sensor_statistic(Array)

#2 {main}

  thrown in /web/measureit/measureit_public_html/php/measureit_functions.php on line 554" while reading response header from upstream, client: ::ffff:192.168.1.118, server: *, request: "GET /php/measureit_functions.php?do=sensor_statistic&sensor_position=2&sensor=0&table=measure_watt_hourly&timeframe=position&range_from=2021-12-21&order=hour_id&turn=desc HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "192.168.1.122", referrer: "http://192.168.1.122/"

Thomas

unread,
Jan 27, 2022, 7:17:46 AM1/27/22
to measureit
Sorry for the late answer. google claims the mail from the list as spam…

It seems you do not use a numeric value for the price and someone TM (me) does not proper check the data before insert it in the db :D

The price must match this format. it is a dot and not a colon

0.2218

This should resolve the problem
Reply all
Reply to author
Forward
0 new messages