ZABBIX BUGS AND ISSUES

inconsistency in returned resource types regarding LLD (rule, prototype, created object). no checks for allowed types for some methods.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.0.3
  • Fix Version/s: 2.0.4rc1, 2.1.0
  • Component/s: API (A)
  • Labels:
  • Environment:
    trunk rev 30757 (~2.0.3 release)
  • Zabbix ID:
    NMR

Description

(1)
Current state:
 - item.get returns all - 0, 1, 2, 4 (normal item, discovery rule, prototype, auto-created item)
 - trigger.get returns only "flags" in 0, 4 (normal trigger, auto-created trigger)
 - graph.get returns only "flags" in 0, 4 (normal graph, auto-created graph)

We have also DiscoveryRule, ItemPrototype, TriggerPrototype and GraphPrototype API classes, they all work correctly and return only appropriate types (I've just tested).

So to be consistent we have to limit the "item.get" method to return only "real" items, i.e. 0 and 4 types only.

Then in documentation:
http://www.zabbix.com/documentation/2.0/manual/appendix/api/item/definitions
need to leave description only for available types.


(2)
Maybe we also need to check how other methods (update ... delete) from Item, Trigger and Graph classes work with rules and prototypes, maybe we have also to limit there the types ?
Yes, we must - I found a bug there (at least one), nasty bug:
try to update "status":0 using "item.update" method *for* a discovery rule or a prototype or a auto-created item - its "flags" will be silently changed to "0" - i.e. to normal item :(

"trigger.update" and "graph.update" are ok in this regard and don't allow such incorrect action - "No permissions to referred object or it does not exist!"

Please consider which particular tests I could forget and skip.

Activity

Hide
Alexei Vladishev added a comment - - edited

Again, it is all about API validation. It should be part of a single issue, we already have one registered.

Oleksiy Zagorskyi ohh, I just started from another issue and probably ended up with this new report because I forgot about the registered ZBX for validation. Ok, I've added a comment there in ZBX-3783 about this issue.
Let's leave this opened as here not only validation described.

Alexei Vladishev well, if we keep reporting multiple bugs per ticket it will never be fixed. hard to read and track any progress. please stick to one ticket one bug report rule.

Show
Alexei Vladishev added a comment - - edited Again, it is all about API validation. It should be part of a single issue, we already have one registered. Oleksiy Zagorskyi ohh, I just started from another issue and probably ended up with this new report because I forgot about the registered ZBX for validation. Ok, I've added a comment there in ZBX-3783 about this issue. Let's leave this opened as here not only validation described. Alexei Vladishev well, if we keep reporting multiple bugs per ticket it will never be fixed. hard to read and track any progress. please stick to one ticket one bug report rule.
Hide
Toms added a comment -

Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5684

Show
Toms added a comment - Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5684
Hide
Eduards Samersovs added a comment - - edited

(1) Typo in popup_trexpr.php:553
$myItem = API::Item()->get(array(
'filter' => array('host' => $expr['host'], 'key_' => $expr['item']),
'output' => API_OUTPUT_EXTEND,
'webitems' => true,
'filter' => array('flags' => null)
));

Toms RESOLVED in r31712
Eduards Samersovs CLOSED

Show
Eduards Samersovs added a comment - - edited (1) Typo in popup_trexpr.php:553 $myItem = API::Item()->get(array( 'filter' => array('host' => $expr['host'], 'key_' => $expr['item']), 'output' => API_OUTPUT_EXTEND, 'webitems' => true, 'filter' => array('flags' => null) )); Toms RESOLVED in r31712 Eduards Samersovs CLOSED
Hide
Eduards Samersovs added a comment -

P.S. see also ZBXNEXT-1525

Show
Eduards Samersovs added a comment - P.S. see also ZBXNEXT-1525
Hide
Eduards Samersovs added a comment - - edited

(2) "ERROR: No permissions to referred object or it does not exist!" in item prototype configuration edit page when pressing on template link.

Toms RESOLVED in r31712
Eduards Samersovs CLOSED

Show
Eduards Samersovs added a comment - - edited (2) "ERROR: No permissions to referred object or it does not exist!" in item prototype configuration edit page when pressing on template link. Toms RESOLVED in r31712 Eduards Samersovs CLOSED
Hide
Eduards Samersovs added a comment - - edited

(3) Error in Item popup:
reset() expects parameter 1 to be array, null given [include/items.inc.php:522]

Resolved in ZBXNEXT-20, but note, same lines was modified in ZBX-5684, after synchronization must be re-tested.

Toms CLOSED

Show
Eduards Samersovs added a comment - - edited (3) Error in Item popup: reset() expects parameter 1 to be array, null given [include/items.inc.php:522] Resolved in ZBXNEXT-20, but note, same lines was modified in ZBX-5684, after synchronization must be re-tested. Toms CLOSED
Hide
Eduards Samersovs added a comment -

Tested!

Show
Eduards Samersovs added a comment - Tested!
Hide
Toms added a comment -

Fixed in 2.0.4rc1 r31754, 2.1.0 r31760

Show
Toms added a comment - Fixed in 2.0.4rc1 r31754, 2.1.0 r31760
Hide
Pavels Jelisejevs added a comment - - edited

(4) Please note this in the API changelog.

Toms RESOLVED

Pavels Jelisejevs CLOSED.

Show
Pavels Jelisejevs added a comment - - edited (4) Please note this in the API changelog. Toms RESOLVED Pavels Jelisejevs CLOSED.
Hide
Pavels Jelisejevs added a comment - - edited

(5) The itemprototype.get methods doesn't need a webitems parameter: item prototypes are not related to web items at all.

Toms Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5684-tr for trunk
and
Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5684 r31782 for 2.0

Pavels Jelisejevs CLOSED.

Show
Pavels Jelisejevs added a comment - - edited (5) The itemprototype.get methods doesn't need a webitems parameter: item prototypes are not related to web items at all. Toms Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5684-tr for trunk and Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5684 r31782 for 2.0 Pavels Jelisejevs CLOSED.
Hide
Pavels Jelisejevs added a comment - - edited

(6) API_OUTPUT_SHORTEN is used in CItemPrototype::get(). It is no longer supported in the trunk and must be removed. It should remain in 2.0 though.

Toms Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5684-tr

Pavels Jelisejevs CLOSED.

Show
Pavels Jelisejevs added a comment - - edited (6) API_OUTPUT_SHORTEN is used in CItemPrototype::get(). It is no longer supported in the trunk and must be removed. It should remain in 2.0 though. Toms Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5684-tr Pavels Jelisejevs CLOSED.
Hide
Pavels Jelisejevs added a comment -

TESTED.

Show
Pavels Jelisejevs added a comment - TESTED.
Hide
Toms added a comment - - edited

Fixed in 2.1.0 r31800, 2.0.4rc1 r32149

Show
Toms added a comment - - edited Fixed in 2.1.0 r31800, 2.0.4rc1 r32149

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: