HTTP poller issue with version 8153

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
rodice
Posts: 3
Joined: Friday 04 August 2017 14:00
Target OS: Raspberry Pi
Domoticz version:
Contact:

HTTP poller issue with version 8153

Post by rodice » Friday 04 August 2017 14:10

Hi all

Here is an issue I've found with 8153

Version: 8153
Platform: Raspbian
Plugin/Hardware: raspberry pi 3
Description: HTTP/HTTPS poller issues

When creating a http/https poller, I can see this error within the logs

2017-08-04 14:03:38.781 Error: CLuaHandler: cannot read /home/pi/domoticz/scripts/lua_parsers/: Is a directory
2017-08-04 14:03:43.820 Error: CLuaHandler: cannot read /home/pi/domoticz/scripts/lua_parsers/: Is a directory
2017-08-04 14:03:48.855 Error: CLuaHandler: cannot read /home/pi/domoticz/scripts/lua_parsers/: Is a directory


My config is very very simple
URL is: http://192.168.0.253/solar_api/v1/GetPo ... eData.fcgi
script is: script_fronius3.lua

I've tried to change the location of the lua parser file without success: script_fronius3.lua, ../script_fronius3.lua...

any ideas?
Many Thanks

ps: here is the LUA_parser script called script_fronius3.lua

-- Retrieve the request content
s = request['content'];

-- Update some devices (index are here for this example)
local id = 4
local s = domoticz_applyJsonPath(s,'.P_PV')
domoticz_updateDevice(4,'2','1000','3', '4')

ajay100
Posts: 32
Joined: Monday 07 August 2017 15:01
Target OS: Raspberry Pi
Domoticz version: 3.9560
Location: Victoria, Australia
Contact:

Re: HTTP poller issue with version 8153

Post by ajay100 » Monday 07 August 2017 15:09

Thanks to the devs, really appreciate what you do.

I can confirm this behaviour in 8153. Logs:
2017-08-07 22:57:17.873 Error: CLuaHandler: cannot read /home/pi/domoticz/scripts/lua_parsers/: Is a directory
2017-08-07 22:59:47.895 Error: CLuaHandler: cannot read /home/pi/domoticz/scripts/lua_parsers/: Is a directory
2017-08-07 23:02:17.920 Error: CLuaHandler: cannot read /home/pi/domoticz/scripts/lua_parsers/: Is a directory

Was working fine prior to the upgrade.

Using this feature for weewx, with weewx_json_thb.lua in the lua_parsers directory.

When I viewed the command parameter in hardware, it was 'd2Vld3hfanNvbl90aGIubHVh'. I've tried changing this to weewx_json_thb.lua, etc.

The hardware URL gets the correct data from weewx and weewx is updating it's own web site.

Cheers - Andrew

ajay100
Posts: 32
Joined: Monday 07 August 2017 15:01
Target OS: Raspberry Pi
Domoticz version: 3.9560
Location: Victoria, Australia
Contact:

Re: HTTP poller issue with version 8153

Post by ajay100 » Friday 11 August 2017 8:13

Any thoughts on the error in this post? Is it connected with the Events system problem mentioned by others, causing Domoticz to stop? Is it a permissions problem?

Error: CLuaHandler: cannot read /home/pi/domoticz/scripts/lua_parsers/: Is a directory

Thanks - Andrew

ajay100
Posts: 32
Joined: Monday 07 August 2017 15:01
Target OS: Raspberry Pi
Domoticz version: 3.9560
Location: Victoria, Australia
Contact:

Re: HTTP poller issue with version 8153

Post by ajay100 » Friday 08 June 2018 10:05

Raising this issue again as I upgraded to v3.9560 and still getting the error:
2018-06-08 16:42:59.779 Error: CLuaHandler: cannot read /home/pi/domoticz/scripts/lua_parsers/: Is a directory

I don't have any experience with C but looking at the source code in LuaHandler.cpp, line 211, the 'script' variable seems to be missing or empty, thus the error above.
std::string fullfilename = lua_Dir + script;

I think the 'script' variable would be the name of the lua handler in /home/pi/domoticz/scripts/lua_parsers, which in my case would be weewx_json_thb.lua. It must be pulled from the database at some stage but that is where I get lost.

My hardware setting for the http poller are shown in the attachment.
http_poller_settings.jpg
http_poller_settings.jpg (28.45 KiB) Viewed 711 times
I am parsing weather station data from weewx and have checked it is being generated and the weewx server is working and the current.json file shows the correct data in a browser (example below)

current.json in browser:
title "Current Weather"
time "08/06/18 18:00:00"
alt "250 meters"
hardware "WH1080"
uptime "1 day, 10 hours, 44 minutes"
serverUptime "1 day, 9 hours, 59 minutes"
weewxVersion "3.6.2"
stats
current
outTemp "10.4"
windchill "10.4"
heatIndex "10.4"
dewpoint "9.2"
humidity "92"
insideHumidity "83"
barometer "1022.7"
windSpeed "1"
windDir "346"
windDirText "NNW"
windGust "4"
windGustDir "315"
rainRate "0.0"
insideTemp "12.2"
almanac
sun
sunrise "07:27:58"
sunset "17:02:28"
moon
phase "Last quarter"
fullness "31%"

I hope this helps someone to track down this bug.

Cheers - Andrew

User avatar
gizmocuz
Posts: 8699
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: HTTP poller issue with version 8153

Post by gizmocuz » Sunday 10 June 2018 8:42

@ajay100, send you a private message for a debug request
Quality outlives Quantity!

ajay100
Posts: 32
Joined: Monday 07 August 2017 15:01
Target OS: Raspberry Pi
Domoticz version: 3.9560
Location: Victoria, Australia
Contact:

Re: HTTP poller issue with version 8153 [resolved]

Post by ajay100 » Monday 11 June 2018 9:53

This issue has been resolved - it wasn't a bug, it was a browser cache issue. I should have picked this up by trying another browser or using private mode in Firefox. Lesson learnt!

TheCub3
Posts: 35
Joined: Saturday 24 February 2018 19:42
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: HTTP poller issue with version 8153 [resolved]

Post by TheCub3 » Tuesday 12 June 2018 19:23

ajay100 wrote:
Monday 11 June 2018 9:53
This issue has been resolved - it wasn't a bug, it was a browser cache issue. I should have picked this up by trying another browser or using private mode in Firefox. Lesson learnt!
same problem here but also when i clear the cache in the browser, what did you do to fix this ?

ajay100
Posts: 32
Joined: Monday 07 August 2017 15:01
Target OS: Raspberry Pi
Domoticz version: 3.9560
Location: Victoria, Australia
Contact:

Re: HTTP poller issue with version 8153

Post by ajay100 » Wednesday 13 June 2018 2:12

I couldn't fix it by clearing the cache in firefox. I opened domoticz in another browser (chrome) and could see the script was missing in the hardware settings there, even though it was showing in firefox. I entered the script in chrome, which fixed the problem once I refreshed the page in firefox.

Cheers - Andrew

TheCub3
Posts: 35
Joined: Saturday 24 February 2018 19:42
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: HTTP poller issue with version 8153

Post by TheCub3 » Wednesday 13 June 2018 13:52

he Andrew

tnx, i set the Cach option off in firefox,
type in the address bar about:config

then press the button i'l be careful i promise

then type in the bar browser.cache.disk.enable

then double click on it, to make it false

exit firefox and restart-it.

do the same with browser.cache.memory.enable
that fix the problem for now, later i will check why Domoticz has this cache issues... for now i can test with Domoticz

Kind regards,
-A

amitpawar
Posts: 1
Joined: Wednesday 27 June 2018 8:08
Target OS: OS X
Domoticz version:
Contact:

Re: HTTP poller issue with version 8153

Post by amitpawar » Wednesday 27 June 2018 8:21

well i am having the same issue!
When using 'add_field' in the http_poller input plugin of a Logstash configuration, the field is lost when the plugin returns an error on the test URL.

See example input block below. The Links LINK_1 and LINK_3 for example may return a success (http 200) and the added field 'environment' will be part of the resulting document.
But in a case were LINK_2_DOWN and LINK_3_UNREACHABLE return an error response (http <> 200) then the added field 'environment' is NOT part of the result document.

Version: 2.4.x, 5.x
Operating System: Linux
Config File: (input block of the Logstash configuration file)
input {
# ITT Polling.
http_poller {
urls => {
LINK_1 => "http://xxx-it.html"
LINK_2_DOWN => "http://xxx-down.html"
}
request_timeout => 10
interval => 300
codec => plain
metadata_target => "http_poller_metadata"
add_field => { "environment" => "I" }
}
# UAT Polling.
http_poller {
urls => {
LINK_3 => "http://xxx-uat.html"
LINK_4_UNREACHABLE => "http://xxx-unreachable.html"
}
request_timeout => 10
interval => 300
codec => plain
metadata_target => "http_poller_metadata"
add_field => { "environment" => "A" }
}
}

Post Reply

Who is online

Users browsing this forum: waaren and 7 guests