[ZBX-8832] Cannot import back some of child applications, if template is linked to two or more templates Created: 2014 Sep 29  Updated: 2017 May 30  Resolved: 2014 Oct 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 2.2.7rc1, 2.4.1rc1, 2.5.0
Fix Version/s: 2.2.8rc1, 2.4.3rc1, 2.5.0

Type: Incident report Priority: Major
Reporter: Ivo Kurzemnieks Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: applications, import, templates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Steps to reproduce:

  • Create 3 templates. Let's call them T1, T2 and T3.
  • For two of them, create applications. T1:app and T2:app
  • Link T3 with T1 and T2, so that T3 inherits those two applications.
  • In list view select all 3 templates, export them and then delete them.
  • Import templates back.

Now notice that for T3 only one child application is created when importing.



 Comments   
Comment by Krists Krigers (Inactive) [ 2014 Oct 06 ]

Fixed in r49609, branch svn://svn.zabbix.com/branches/dev/ZBX-8832 (copy of branches/2.2).

Comment by Ivo Kurzemnieks [ 2014 Oct 24 ]

(1) String changes?

kristsk No string changes. RESOLVED.

iivs CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Oct 27 ]

(2) Having two applications with same name on two different templates linked to third template, now results with error:

Error in query [INSERT INTO applications (name,hostid,applicationid) VALUES ('app','100100000010747','100100000003302'),('app','100100000010747','100100000003303')] [Duplicate entry '100100000010747-app' for key 2]
SQL statement execution has failed "INSERT INTO applications (name,hostid,applicationid) VALUES ('app','100100000010747','100100000003302'),('app','100100000010747','100100000003303')"

kristsk RESOLVED in r50268, r50270.

iivs

  1. $hostApps probably should be renamed to $hostApplications, since you already renamed most of the variables in this function. Otherwise it just doesn't look good to have both "apps" and "applications" in the same function;
  2. Line 475 exeeds maximum character length;
  3. For block comments,
    /*
     * New block comment
     */

    this style should be used. Also correct "apps" in function description.

  4. Please, try to get rid of $sqlWhere variable and usage of empty() in getChildHostsFromApplications() function.

kristsk RESOLVED in r50404.

iivs I made minor corrections in r50426. Please, review.

kristsk CLOSED.

Comment by Ivo Kurzemnieks [ 2014 Nov 05 ]

TESTED,
but close (2) before merging. And don't forget API changelog.

Comment by Krists Krigers (Inactive) [ 2014 Nov 05 ]

Fixed and merged to:

  • 2.2.8rc1 in r50430,
  • 2.4.3rc1 in r50440,
  • 2.5.0 in r50444.
Comment by Krists Krigers (Inactive) [ 2014 Nov 05 ]

(3) Updated API changelogs:

sasha Seems it is fixed application.create() method instead of configuration.import()

REOPENED

kristsk Fixed documentation and updated links. RESOLVED.

sasha Thanks! CLOSED

Comment by Alexander Vladishev [ 2014 Nov 06 ]

(4) ChangeLog entry also is incorrect

kristsk
Updated changelogs:

  • for 2.2 in r50502
  • for 2.4 in r50503
  • for trunk in r50504.

RESOLVED.

sasha CLOSED Thank you.

Generated at Sat May 11 06:07:53 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.