I've just upgraded Domoticz. I went to the new stable, but there were some issues (the CheckAuth issue), so I've gone to the latest Beta - v4.10705)
Previously I was using an HTTP callback and checking the result using .ok in the response object. Since the upgrade, it doesn't seem like .ok is being set, so as far as the script is concerned, all HTTP callbacks are failing (when, in fact, they aren't).
Anyone else seeing this?
How do I report this as a bug?
item.ok no longer working?
Moderator: leecollings
-
doh
- Posts: 82
- Joined: Monday 01 December 2014 13:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: London, UK
- Contact:
Re: item.ok no longer working?
A bit more digging - it appears that .statusCode isn't being set (or, rather, is always 0), which is probably why .ok isn't being set properly either.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: item.ok no longer working?
Thx for reporting !doh wrote: Wednesday 08 May 2019 14:49 A bit more digging - it appears that .statusCode isn't being set (or, rather, is always 0), which is probably why .ok isn't being set properly either.
I did a quick check on this but cannot replicate with my test-set nor with my production scripts in version V4.10692 and version V4.10706
Can you please send me your script where you have this issue ?
Your profile states that you are on Linux. Can you also please elaborate a bit on what OS and which hardware ? It might help in identifying what happens.
To give some more info to work with, please add the line
Code: Select all
domoticz.utils.dumpTable(item)Thx
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- gizmocuz
- Posts: 2712
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: item.ok no longer working?
I added the dump table as you asked on the forum this is the result:
Here is the dump when i push data to an influxDB:
Seems perfect here .... this is an internal curl error when i entered a wrong port number to connect to2019-05-09 08:12:16.215 Status: dzVents: Info: dumping item table:
2019-05-09 08:12:16.215 Status: dzVents: > ok: false
2019-05-09 08:12:16.215 Status: dzVents: > isDevice: false
2019-05-09 08:12:16.216 Status: dzVents: > protocol: HTTP/1.1
2019-05-09 08:12:16.216 Status: dzVents: > isScene: false
2019-05-09 08:12:16.216 Status: dzVents: > data:
2019-05-09 08:12:16.216 Status: dzVents: > isSecurity: false
2019-05-09 08:12:16.217 Status: dzVents: > trigger: mycallbackstring
2019-05-09 08:12:16.217 Status: dzVents: > isHTTPResponse: true
2019-05-09 08:12:16.217 Status: dzVents: > callback: mycallbackstring
2019-05-09 08:12:16.217 Status: dzVents: > isTimer: false
2019-05-09 08:12:16.217 Status: dzVents: > isGroup: false
2019-05-09 08:12:16.218 Status: dzVents: > baseType: httpResponse
2019-05-09 08:12:16.218 Status: dzVents: > isVariable: false
2019-05-09 08:12:16.218 Status: dzVents: > statusText: Couldn't connect to
2019-05-09 08:12:16.218 Status: dzVents: > statusCode: 7
2019-05-09 08:12:16.218 Status: dzVents: > headers:
2019-05-09 08:12:16.219 Status: dzVents: > _contentType:
2019-05-09 08:12:16.219 Status: dzVents: > isJSON: false
2019-05-09 08:12:16.220 Status: dzVents: Info: ------ Finished Script #1
Here is the dump when i push data to an influxDB:
2019-05-09 08:14:00.708 Status: dzVents: Info: dumping item table:
2019-05-09 08:14:00.708 Status: dzVents: > isTimer: false
2019-05-09 08:14:00.709 Status: dzVents: > data:
2019-05-09 08:14:00.709 Status: dzVents: > isScene: false
2019-05-09 08:14:00.710 Status: dzVents: > isGroup: false
2019-05-09 08:14:00.710 Status: dzVents: > isVariable: false
2019-05-09 08:14:00.711 Status: dzVents: > isDevice: false
2019-05-09 08:14:00.711 Status: dzVents: > ok: true
2019-05-09 08:14:00.712 Status: dzVents: > baseType: httpResponse
2019-05-09 08:14:00.712 Status: dzVents: > statusText: No Content
2019-05-09 08:14:00.713 Status: dzVents: > isHTTPResponse: true
2019-05-09 08:14:00.716 Status: dzVents: > _contentType: application/json
2019-05-09 08:14:00.717 Status: dzVents: > isJSON: false
2019-05-09 08:14:00.717 Status: dzVents: > isSecurity: false
2019-05-09 08:14:00.718 Status: dzVents: > trigger: mycallbackstring
2019-05-09 08:14:00.718 Status: dzVents: > callback: mycallbackstring
2019-05-09 08:14:00.719 Status: dzVents: > statusCode: 204
2019-05-09 08:14:00.719 Status: dzVents: > protocol: HTTP/1.1
2019-05-09 08:14:00.720 Status: dzVents: > headers:
2019-05-09 08:14:00.720 Status: dzVents: > X-Influxdb-Version: 1.5.3
2019-05-09 08:14:00.720 Status: dzVents: > Request-Id: a4e6275d-7221-11e9-acd7-000000000000
2019-05-09 08:14:00.721 Status: dzVents: > Content-Type: application/json
2019-05-09 08:14:00.721 Status: dzVents: > X-Request-Id: a4e6275d-7221-11e9-acd7-000000000000
2019-05-09 08:14:00.722 Status: dzVents: > Date: Thu, 09 May 2019 06:14:03 GMT
2019-05-09 08:14:00.722 Status: dzVents: > X-Influxdb-Build: OSS
2019-05-09 08:14:00.724 Status: dzVents: Info: ------ Finished Script #1
Quality outlives Quantity!
-
doh
- Posts: 82
- Joined: Monday 01 December 2014 13:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: London, UK
- Contact:
Re: item.ok no longer working?
Running on a Raspberry Pi:
Here's the output from dumptable:
Here's a snippet of code - basically the start of the callback handler for the URL call:
The final check (item.ok) never works - as you can see - statusCode is set to 0 and ok set to false in the table dump.
Code: Select all
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debianCode: Select all
Debug: TadoGetStatus: Dump table <START>
> isScene: false
> isVariable: false
> isDevice: false
> data: OBFUSCATED, BUT AS EXPECTED
> json: OBFUSCATED, BUT AS EXPECTED
> _contentType: application/json;charset=UTF-8
> ok: false
> isJSON: true
> isTimer: false
> statusCode: 0
> baseType: httpResponse
> trigger: TadoGetZonesCallback
> isGroup: false
> headers:
> Content-Encoding: gzip
> Set-Cookie: AWSALB=OBFUSCATED; Expires=Thu, 16 May 2019 09:40:02 GMT; Path=/
> Transfer-Encoding: chunked
> Content-Type: application/json;charset=UTF-8
> Strict-Transport-Security: max-age=31536000
> X-Content-Type-Options: nosniff
> Access-Control-Allow-Origin: *
> X-Application-Context: application:production
> Server: nginx
> X-XSS-Protection: 1; mode=block
> Cache-Control: no-cache, must-revalidate
> ETag: W/"f5d00bb5d2a84ce5"
> Connection: keep-alive
> Date: Thu, 09 May 2019 09:40:02 GMT
> callback: TadoGetZonesCallback
> isSecurity: false
> isHTTPResponse: true
Debug: TadoGetStatus: Dump table <END>Code: Select all
if (item.isHTTPResponse) then
domoticz.log('HTTP Response code = ' .. tostring(item.statusCode),domoticz.LOG_DEBUG)
-- Process TadoGetZonesCallback trigger event (Response to request for Zones list)
if (item.trigger == 'TadoGetZonesCallback') then
domoticz.log('Dump table <START>',domoticz.LOG_DEBUG)
domoticz.utils.dumpTable(item)
domoticz.log('Dump table <END>',domoticz.LOG_DEBUG)
if (item.ok) then -- success- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: item.ok no longer working?
Thx. From what I see here, it looks like you have a mismatch between the domoticz executable and HTTPResponse.luadoh wrote: Thursday 09 May 2019 11:49 The final check (item.ok) never works - as you can see - statusCode is set to 0 and ok set to false in the table dump.
The dzVents subdirectory must be aligned with the version of domoticz.
Could it be that you updated the domoticz binary without aligning the dzVents subdrectory ? (This could happen when you compile locally and only copy the binary to your work directory)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
doh
- Posts: 82
- Joined: Monday 01 December 2014 13:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: London, UK
- Contact:
Re: item.ok no longer working?
There was a bug that @gizmocuz has now fixed in latest Beta v4.10716
Who is online
Users browsing this forum: No registered users and 1 guest