[ZBX-8791] Import map with triggers fails Created: 2014 Sep 19  Updated: 2017 May 30  Resolved: 2014 Nov 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.4.0
Fix Version/s: 2.4.2rc1, 2.5.0

Type: Incident report Priority: Major
Reporter: Ronny Pettersen Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: xml
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: XML File 1.8_zbx_maps_export.xml     XML File 2.0_zbx_export_maps.xml    

 Description   

Steps to reproduce:
1. Add map with two hosts
2. Create link between the two hosts
3. Assign trigger to the link (I added "HTTPS service is down on

{HOST.NAME}") and save map
4. Export map
5. Import map

The import map fails with an error like this:
Cannot find trigger "HTTPS service is down on {HOST.NAME}

" used in map "Test MAP".

If I remove the trigger on the link; save; export; import; Then import succeeds.



 Comments   
Comment by Krists Krigers (Inactive) [ 2014 Sep 26 ]

Fixed and committed import from >=2.0 in r49390 and import from 1.8 in r49400, branch svn://svn.zabbix.com/branches/dev/ZBX-8791 (copy of branches/2.4).

Comment by Ivo Kurzemnieks [ 2014 Sep 30 ]

(1) String changes?

No string changes.

kristsk RESOLVED.

iivs CLOSED.

<richlv> looks like at least two strings have been changed/removed - could you please check ?

$ svn diff -c 49889 | grep "Cannot \(add\|update\)"
-                                       throw new Exception(_('Cannot add image.'));
-                                       throw new Exception(_('Cannot update image.'));

iivs You're right. Translation strings removed:

  • 'Cannot add image.'
  • 'Cannot update image.'
    RESOLVED.

<richlv> thanks; (but also see the comment by jelisejev above) - this subissue is CLOSED

Comment by Ivo Kurzemnieks [ 2014 Sep 30 ]

(2) Map importer does not convert older trigger expressions for example 2.0 -> 2.4 import .last(0) -> .last()

kristsk After discussing with sasha this is intended behavior as uniqueness of a trigger is determined by string values of description and expression. WONTFIX.

iivs Ok, understood.
CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Sep 30 ]

(3) "Images" checkboxes are missing from import form

kristsk RESOLVED in r49528.

iivs Only one checkbox is now displayed. Both update and create are required. "Images" checkboxes should be present there by default and not owerriden, and both should be disabled by default. I removed the code, it was not actually required. I was probably testing on non-superadmin to see if permissions work and forgot that simple admin users don't have those checkboxes. See r49686

kristsk CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Oct 08 ]

(6) Minor coding style fix. Please review r49689

kristsk CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Oct 08 ]

(7) Attached two XMLs, 1.8 import fails to import second time due to image update, 2.0 import fails without error description. Seems like it will not even go to processMaps(). Note all checkboxes for maps and images are checked.

kristsk Fixed problems with imported image create/update. RESOLVED in r49698.

iivs Looks much better now. But let's re-factor the code a bit, it looks very outdated and inconsistent 1.8 import and 2.0+ import.
For 1.8 import API image.get happens inside a loop with limit=1, we should select images all at once. And 2.0+ import uses SQL instead of API. Also let's use camelCase and rename $images_to_add to $imagesToCreate

REOPENED.

kristsk RESOLVED in r49748.

iivs CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Oct 15 ]

TESTED

Comment by Krists Krigers (Inactive) [ 2014 Oct 15 ]

Fixed and merged to:

  • 2.4.2rc1 in r49889,
  • 2.5.0 (trunk) in r49891.
Comment by Pavels Jelisejevs (Inactive) [ 2014 Oct 16 ]

(7) This needs to be noted in the 2.4 API changelog.

kristsk API changelog updated https://www.zabbix.com/documentation/2.4/manual/api/changes_2.2_-_2.4#configuration. RESOLVED.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Oct 23 ]

Ivo, please have a look at (1).

Comment by Pavels Jelisejevs (Inactive) [ 2014 Oct 27 ]

Krists, please respond to the first comment.

kristsk Responded.

Generated at Tue Apr 23 23:20:43 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.