[ZBX-19968] importing older version discovery rules can result in error Created: 2021 Sep 16  Updated: 2024 Jul 17

Status: Confirmed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 5.0.15, 6.0.31, 6.4.16, 7.0.0
Fix Version/s: None

Type: Problem report Priority: Minor
Reporter: Ivo Kurzemnieks Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 16
Labels: import
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBX-24770 Error 'the tag "formulaid" is missing... Closed
Team: Team B

 Description   

1. Create a discovery rule in version 2.2. Create all kinds of types and fill all kinds of fields, just to be sure.
2. Import into 5.0
Result:

Invalid tag "/zabbix_export/hosts/host(1)/discovery_rules/discovery_rule(1)/filter/conditions/condition(1)": the tag "formulaid" is missing.

Issue was found during ZBX-19815 and needs to be looked at. Possible that one of the previous converters is not adding the field during conversion.



 Comments   
Comment by Kim Jongkwon [ 2022 Apr 22 ]

Zabbix version 4.0-> 5.0 LLD import also has a similar issue.
And removed "formulaid" tag from 2.2 XML will occur this same error, so this issue should be considered.

Invalid parameter "/1/lld_macro_paths": cannot update property for templated discovery rule.
Comment by Konstantīns Ošmjans [ 2024 Jul 03 ]

ZBX-24770 was closed as a duplicate, but it describes a similar problem in the Zabbix v7 already.
It's nonsense: the official Zabbix template could not be imported by the officially supported version of Zabbix server. Either template or import mechanism must be fixed, the priority of this problem should not be "minor".

Comment by Alexander Fischer [ 2024 Jul 04 ]

I experience the same behaviour on Zabbix v7 with the official templates.

Comment by Pax [ 2024 Jul 04 ]

Same issue with recent template releases for 7.0

Comment by Tammy T [ 2024 Jul 08 ]

Experiencing the same issue when trying to import any official template in Zabbix v7. Tried with multiple ones, including ones that are only available starting in 7.0 like the azure templates, with no success

Comment by Aleksey Saltykov [ 2024 Jul 08 ]

The same problem updating templates on version 7 LTS after upgrading from 6.4.
On version 6.4 I did not observe any problems with updates after updating from 5 LTS.

Comment by Darrell Enns [ 2024 Jul 09 ]

 Same issue here trying to import official v7 templates into v7.

Steps:

  • Upgrade from 6.0 to 7.4
  • Download official v7 templates from git repo (release/7.0 branch)
  • Attempt to import any of the official  templates - fails with error

Here is an example error (in this case when importing template_cloud_azure_http.yaml):

Invalid tag "/zabbix_export/templates/template(1)/discovery_rules/discovery_rule(1)/filter/conditions/condition(1)": the tag "formulaid" is missing.

I've done official template imports after upgrades before (on 6.0 and earlier releases). The 7.0 release is the first time I've seen this issue.

Comment by Karl Buckland [ 2024 Jul 10 ]

I too have the same issue, trying to import templates for 7.0 (such as the proxmox template).

Is there any sort of workaround?

Comment by Konstantīns Ošmjans [ 2024 Jul 10 ]

Is there any sort of workaround?

Yes, the workaround is to fix every problems template, adding the "formulaid: 'A'" line for every filter condition. For example, for the template APC Smart-UPS 3000 XLM by SNMP it should be done at 3 places:

  • after line 774:
              filter:
                evaltype: AND
                conditions:
                  - macro: '{#CARTRIDGE_STATUS}'
                    value: ^$
                    operator: NOT_MATCHES_REGEX
                    formulaid: 'A'    <--- add this line
    
  • in 2 overrides (near lines 1040 and 1150):
                  filter:
                    conditions:
                      - macro: '{#EXTERNAL_SENSOR1_NAME}'
                        value: Temp
                        formulaid: 'A'
    

    and

                  filter:
                    conditions:
                      - macro: '{#EXTERNAL_SENSOR2_NAME}'
                        value: Temp
                        formulaid: 'A'
    

Then this template can be imported successfully.

The same procedure could help with other templates, too.

I think that it should be done by the template supporters, so I opened the ZBX-24770; however that ticket has been just closed as a duplicate.

Comment by Karl Buckland [ 2024 Jul 10 ]

Further update:

Even if the correct items are added to the YAML (unique formulaid strings for discovery rule filter conditions and parameters on item_prototype preprocessing items) the imports then pass validation, but fail on another step with errors similar to:

Invalid parameter "/2/trends": value must be 0.

I received errors similar to this importing the proxmox template and the systemd template.

A datastructure similar to this is not present in the YAML - so I can only assume there are further issues deeper in the import process.

It looks like updates have been made to these structures, but the import logic has not been updated to handle optional parameters? 

Comment by Karl Buckland [ 2024 Jul 10 ]

constantin.oshmyan The two templates I updated similar to your instructions did not import even after passing validation - so I don't think this is always something that can be solved by the template supporters. It looks like there is an issue with the import process itself

Comment by Konstantīns Ošmjans [ 2024 Jul 12 ]

The version 7.0.1rc1 contains fix for a similar topic (link). It's interesting if the problem described here is affected by that fix. If it is still present – it's strange for me why the current ticket has priority "Minor"; it should be at least "Normal".

Comment by Evert Meulie [ 2024 Jul 12 ]

I'm on 7.0.2 now and the issue is still there. Quite annoying...

Comment by Konstantīns Ošmjans [ 2024 Jul 12 ]

I'm on 7.0.2 now...

evert, are you from the future? The last version available is 7.0.1rc1...

Comment by Evert Meulie [ 2024 Jul 12 ]

constantin.oshmyan No, not from the future, but perhaps in need of glasses 🤓

I'm on 7.0-2+debian12 , not 7.0.2 🤦🏻‍♂️

Comment by mc flurry flurryson [ 2024 Jul 17 ]

I'm too facing this issue with 7.0 importing 7.0 templates.

Just discovered updating zabbix doesn't update templates, so after updating from 6.0 to 7.0 tried to update vmware templates and faced this.

Comment by Alexander Fischer [ 2024 Jul 17 ]

I have upgraded my Zabbix installation to 7.0.1RC1 (mainly due to the memory leak bug present in 7.0.0) and I can confirm that uploading templates works again!

Generated at Tue Jul 08 07:37:16 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.