[ZBX-3219] User-defined scripts error if zabbix_server not running. Need a human description. Created: 2010 Nov 16  Updated: 2017 May 30  Resolved: 2012 Apr 11

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: None
Fix Version/s: 1.8.12, 1.9.8 (beta)

Type: Incident report Priority: Minor
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Fixed Votes: 2
Labels: trivial, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File 1.need_a_human_description.png    

 Description   

I propose to make a special human description. Something like:
"Zabbix server daemon probably not running. To run the script it should be run."



 Comments   
Comment by richlv [ 2011 Dec 01 ]

message should mention other possibilities like incorrect server ip/dns or security environment like selinux (very common causes)

Comment by Vjacheslav Shipillo (Inactive) [ 2011 Dec 05 ]

How you think this can be like so ?
"Zabbix server daemon not available for this time. Please check server connection availability.";
If you have other variants - I welcome for your suggestions

<zalex> I think this message for user should contain as much details as possible.
My variant:
"Cannot connect to the trapper port of zabbix server daemon, but it should be available to run the script.
Possible reasons:
1. Incorrect server IP/DNS in the "zabbix.conf.php".
2. Security environment like SELinux is blocking connection."
3. Zabbix server daemon not running."

Comment by Vjacheslav Shipillo (Inactive) [ 2011 Dec 05 ]

As i understand this should be inserted in "SCRIPT ERROR" place??

<zalex> I thinks yes.

Comment by Oleksii Zagorskyi [ 2011 Dec 05 ]

I think the line with the error description could be included in the message.
See possible errors:

(a)
IP address in the same LAN and not available:
fclose() expects parameter 1 to be resource, boolean given [api/classes/class.cscript.php:626]
[ CScript::execute ] Error Description: No route to host

(b)
Server is Localhost and daemon not running:
fclose() expects parameter 1 to be resource, boolean given [api/classes/class.cscript.php:626]
[ CScript::execute ] Error Description: Connection refused

(c)
Wrong DNS name (www.somennnname.com):
fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known [api/classes/class.cscript.php:538]
fclose() expects parameter 1 to be resource, boolean given [api/classes/class.cscript.php:626]
[ CScript::execute ] Error Description: php_network_getaddresses: getaddrinfo failed: Name or service not known

(d)
Correct DNS name "www.google.com" or IP 8.8.8.8 but unavailable outside the LAN:
fclose() expects parameter 1 to be resource, boolean given [api/classes/class.cscript.php:626]
[ CScript::execute ] Error Description: Connection timed out

Comment by Oleksii Zagorskyi [ 2011 Dec 06 ]

Dev branch rev 23787 tested.
I see nice improvement but some bugs too.
New results of previous tests:

(a)
Undefined variable: d_errorMsg [api/classes/class.cscript.php:557]
[ CScript::execute ] .
Possible reasons:
1. Incorrect server IP/DNS in the "zabbix.conf.php".
2. Security environment like SELinux is blocking connection."
3. Zabbix server daemon not running.
Error Description: No route to host
<SlaVa>Resolved
(b)
[ CScript::execute ] Server in localhost and daemon not running.
Possible reasons:
1. Incorrect server IP/DNS in the "zabbix.conf.php".
2. Security environment like SELinux is blocking connection."
3. Zabbix server daemon not running.
Error Description: Connection refused

(b) - variant with some available LAN IP
[ CScript::execute ] Server in 10.20.0.15 and daemon not running.
Possible reasons:
1. Incorrect server IP/DNS in the "zabbix.conf.php".
2. Security environment like SELinux is blocking connection."
3. Zabbix server daemon not running.
Error Description: Connection refused
<SlaVa>Resolved
(c)
fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known [api/classes/class.cscript.php:538]
Undefined variable: d_errorMsg [api/classes/class.cscript.php:557]
[ CScript::execute ] .
Possible reasons:
1. Incorrect server IP/DNS in the "zabbix.conf.php".
2. Security environment like SELinux is blocking connection."
3. Zabbix server daemon not running.
Error Description: php_network_getaddresses: getaddrinfo failed: Name or service not known
<SlaVa>Resolved
(d)
[ CScript::execute ] Correct DNS name www.google.com but unavailable outside the LAN.
Possible reasons:
1. Incorrect server IP/DNS in the "zabbix.conf.php".
2. Security environment like SELinux is blocking connection."
3. Zabbix server daemon not running.
Error Description: Connection timed out

(d) - with IP instead of DNS
[ CScript::execute ] Correct DNS name 8.8.8.8 but unavailable outside the LAN.
Possible reasons:
1. Incorrect server IP/DNS in the "zabbix.conf.php".
2. Security environment like SELinux is blocking connection."
3. Zabbix server daemon not running.
Error Description: Connection timed out

Issue will be reopened.

<SlaVa> RESOLVED

<zalex>

  • case (d) in the message "Correct DNS name or ip ..." the "ip" should be in uppercase (IP)
  • the quote symbol " at the end of line ".... is blocking connection."" should be removed
  • in the case (c) the unneeded first line still visible: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known [api/classes/class.cscript.php:538]
  • in the case (d) I would suggest to include Hostname in the quote to better readability

-> REOPENED

<zalex>
I see that all are fixed. TESTED. CLOSED

Comment by Oleksii Zagorskyi [ 2011 Dec 06 ]

(1)
Maybe this awesome message could be added to the dashboard as tool-tip for the "Zabbix server is running - No" state?
<SlaVa>May be little-bit later after current bug fixing

Comment by Pavels Jelisejevs (Inactive) [ 2011 Dec 06 ]

(4) It's a bad idea to add <pre> to CObject::show(). CObject is also used to render HTML tags.
<SlaVa>RESOLVED

<pavels> CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2011 Dec 06 ]

(5) Please, format the code according to our guidelines.
<SlaVa>RESOLVED

<pavels> Please review my formatting in r23848.
<Slava>CLOSED

Comment by Oleksii Zagorskyi [ 2011 Dec 06 ]

(6) all strings have to be reviewed by someone experienced && experienced in English

<dimir> AKA Rich :-D

<zalex> yes, because SlaVa took several strings from the description of my testing cases. They were NOT the strings for the GUI, they were only my thought

<zalex> at least the line "Server in "localhost" and daemon not running." should be reviewed. Original version (my ) was "Server is Localhost and daemon not running". is <-> in
<SlaVa>RESOLVED

<pavels> CLOSED.
<zalex> pavels, who is reviewer? all strings were reviewed? no any correction after last SlaVa's changes? REOPENED

<pavels> For some reason I've thought that you've done it already. My fault.

<pavels> Currently the PHP errors are replaced as follows:

<richlv> rewrote & fixed some of the messages - suggested to use the following

PHP: Connection refused
ZBX: Connection to Zabbix server "localhost" refused. Possible reasons: 1. Incorrect server IP/DNS in the "zabbix.conf.php"; 2. Security environment (for example, SELinux) is blocking the connection; 3. Zabbix server daemon not running; 4. Firewall is blocking the connection. Error Description: Connection refused

PHP: No route to host
ZBX: Zabbix server "localhost" can not be reached. Possible reasons: 1. Incorrect server IP/DNS in the "zabbix.conf.php"; 2. Incorrect network configuration. Error Description: No route to host

PHP: Connection timed out
ZBX: Connection to Zabbix server "localhost" timed out. Possible reasons: 1. Incorrect server IP/DNS in the "zabbix.conf.php"; 2. Firewall is blocking the connection. Error Description: Connection timed out

PHP: Name or service not known
ZBX: Connection to Zabbix server "localhost" failed. Possible reasons: 1. Incorrect server IP/DNS in the "zabbix.conf.php"; 2. Incorrect DNS server configuration; Error Description: php_network_getaddresses: getaddrinfo failed: Name or service not known

<pavels> We should probably add a default message, that doesn't cover these specific cases.

<richlv> in that case we should simply print out whatever error we got from php

<zalex> Suggested by Rich messages reviewed, excellent! Rich, are you sure in the "PHP: Connection refused -> ZBX: 4. Firewall is blocking the connection" ?
As I know "Connection refused" it's an interpretation of ICMP message from TCP/IP host stack or firewall that requested TCP port is not opened or not allowed. So, if a firewall is, then it will silently block any traffic (in most cases) and we have to see Connection timeout. Maybe it worth to add one word "TCP": Firewall is blocking TCP connection. ?

<richlv> firewalls can reject or drop packets, you will see timeout in one case and, connection refused in another. i'd omit tcp, as zabbix connections always are tcp - if we go that way, message will become very complex

<SlaVa>RESOLVED r24160 with "Firewall is blocking TCP connection" variant ...

<zalex> missing quotes for sever name %s in S_NOT_RUN. Would bu useful to see it as Rich suggested. "localhost" name hardcoded for S_TIME_OUT
<Slava>Sorry RESOLVED

<pavels> Still missing the quotes in S_NOT_RUN.
<Slava>RESOLVED r 24239

<pavels> CLOSED.

Comment by richlv [ 2011 Dec 07 ]

(7) please, add some summary on what messages we have currently settled on, as i found this issue a bit hard to follow

<pavels> Considering that we've add some specific socket errors to the code, maybe we should also use more specific errors instead of S_SCRIPT_ERROR_BIG? E.g if the socket error is "connection timed out" it hardly because the server daemon is not running.

<pavels> Done in (6). CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2011 Dec 13 ]

TESTED.

Comment by Alexander Vladishev [ 2011 Dec 19 ]

(8) when executing a script with an unaccessible server daemon:
fclose() expects parameter 1 to be resource, boolean given [api/classes/class.cscript.php:617]

<pavels> Slava, don't forget to leave a RESOLVED message when fixing an issue. Please review my commit r24090.
<SlaVa>RESOLVED

<pavels> CLOSED.

Comment by richlv [ 2011 Dec 22 ]

work on this issue happens in svn://svn.zabbix.com/branches/dev/ZBX-3219

Comment by Pavels Jelisejevs (Inactive) [ 2011 Dec 23 ]

(9) If fsockopen throws a different error, we need to display the PHP error as is, not the S_SCRIPT_ERROR_DESCRIPTION.
<Slava>RESOLVED

<pavels> My mistake, everything was ok. CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2011 Dec 27 ]

TESTED.

Please, review r24271 before merging.
<Slava>CLOSED

Comment by Vjacheslav Shipillo (Inactive) [ 2011 Dec 28 ]

fixed in 1.8 r 24351; trunk in r 24355

Comment by richlv [ 2011 Dec 28 ]

(10) looks like unused strings have been added to english locale file for trunk
... and 1.8 branch as well
<SlaVa>RESOLVED r 24385(1.8), 24386(trunk)

<richlv> there still are unused strings both in 1.8 & trunk english locales - it should be verified whether they should be removed or actually used

<Sasha> REOPENED List of unused variables:
1.8:
S_UPDATED_APPLICATION
S_TO_HOST_SMALL
S_FROM_HOST_SMALL
S_GRAPH_DELETED_FROM_HOSTS_PART1
S_GRAPH_DELETED_FROM_HOSTS_PART2
2.0:
-
<Slava> RESOLVED

<Sasha> CLOSED

Comment by richlv [ 2011 Dec 28 ]

(11) we changed one string variable in 1.8 - 'S_SCRIPT_ERROR'
we should remove it from all translations as it is different in them, compared to the english version
<SlaVa>RESOLVED r 24385(1.8), 24386(trunk)

<richlv>

> svn log -vc 24385
------------------------------------------------------------------------
r24385 | slava | 2011-12-29 09:49:53 +0200 (Thu, 29 Dec 2011) | 1 line
Changed paths:
M /branches/dev/ZBX-3219/frontends/php/include/locales/en_gb.inc.php

..F....... ZBX-3219 Fixed some bugs
------------------------------------------------------------------------

the mentioned revision does not seem to solve this problem

<Slava>

  • 'S_SCRIPT_ERROR'=> 'Cannot connect to the trapper port of zabbix server daemon, but it should be available to run the script.',
    + 'S_SCRIPT_ERROR'=> 'SCRIPT ERROR', - restore previous translation with is translated to other languages ... I don't modified other variables
Comment by richlv [ 2011 Dec 28 ]

(12) in trunk, some strings in english locale file are defined twice
<SlaVa>RESOLVED r 24385(1.8), 24386(trunk)

<richlv> trunk still has duplicate string definitions
<Slava>

  • 'S_SCRIPT_ERROR'=> _('Cannot connect to the trapper port of zabbix server daemon, but it should be available to run the script.'),
    It not solve this problem?
Comment by richlv [ 2011 Dec 28 ]

(13)

  • 'S_INCORRECT_VALUE_FOR_SETMESSAGE' => 'Incorrect value for setMessage(): "%s".',
    + 'S_INCORRECT_VALUE_FOR_SETMESSAGE' => 'Incorrect value for setMessage(): "%s%s".',
    <SlaVa>RESOLVED r 24385(1.8)
Comment by richlv [ 2011 Dec 28 ]

(14) trunk code still uses some 'S_' variables that were modified - it should not (for example S_SCRIPT_ERROR, maybe others)
<SlaVa>RESOLVED r 24385(1.8), 24386(trunk)

Comment by richlv [ 2011 Dec 29 ]

(15) 'Connection to Zabbix server "%s" faileds.
<Slava>RESOLVED r 24402(trunk), r24403(1.8)

Comment by richlv [ 2011 Dec 29 ]

erm, wait. the "resolved" messages above claim that it's resolved in 1.8 & trunk branches. looks like actual commits were to recreated development branches, which i did not spot right away. (10) - (15) above should be retested

Comment by Oleksii Zagorskyi [ 2012 Feb 10 ]

(16)
in the latest revisions ~25318 of both branches all messages arranged in a single line, but should in separate lines with indentation for the list of possible reasons.
Sort of regression during development last time.
REOPENED

<Vedmak> This not seem to be regression. Where did we have multiline error messages? This probably can be fixed but then we need newlines in translation strings and research is needed if it will work at all. CLOSED

Comment by Oleksii Zagorskyi [ 2012 Apr 03 ]

vedmak, I figured it out!

When this development was active I several times tested the dev branch.
From very begining of development the list of reasons was shown in separate lines (with lines break) <- that was really nice!

Later, the line breaks have been removed during development in rev 23848, but I forgot/miss this point, sorry.

Btw, Fix version is incorrect, should be 1.8.11 <- we should be careful in such cases (Rich has been changed it to 1.8.12 after my reopening.
and dev branch ZBX-3219 still in the SVN

*AND* the dev branch currently has some changes not merged to stable branches !
As I recall and I see those changes related to strings fixing/improvement.

Additionally do not forget to delete "ZBX-3219-trunk" SVN branch.

REOPENED

Comment by richlv [ 2012 Apr 04 ]

as discussed with pootle developer, newlines should be supported by using \n - so we could use that in these messages as well.

"the dev branch currently has some changes not merged to stable branches" <- that part i don't like at all, though... how did that happen ?

Comment by Alexey Fukalov [ 2012 Apr 11 ]

dev branch: svn://svn.zabbix.com/branches/dev/ZBX-3219

Should be tested if all gettext tools support escaped double quotes.

<zalex> frontend successfully tested, I like it. I suppose all will be fine with the Pootle as well.

Comment by Oleksii Zagorskyi [ 2012 Apr 12 ]

Just a note: a ZBX-4677 has been created because the revisions I mentioned above was not merged to stable branches on time.
To be sure you could compare changes for revs 24403 and 25455

Comment by Toms (Inactive) [ 2012 Apr 16 ]

TESTED

Comment by Alexey Fukalov [ 2012 Apr 17 ]

svn://svn.zabbix.com/trunk 26879

Generated at Sat Apr 27 08:00:26 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.