[ZBXNEXT-9966] Invalid parameter "/1/uuid": UUIDv4 is expected. Created: 2025 Apr 05  Updated: 2025 May 09

Status: Reopened
Project: ZABBIX FEATURE REQUESTS
Component/s: API (A)
Affects Version/s: None
Fix Version/s: None

Type: Change Request Priority: Trivial
Reporter: Simon Jackson Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Zabbix Server v.7.0.4 (docker), custom YAML template


Issue Links:
Duplicate
Related
related to ZBXNEXT-9774 API error message improvements READY TO DEVELOP

 Description   

Steps to reproduce:

  1. Import a non-compliant YAML template
  2. Navigate to the data-collection/templates section
  3. Click import > choose the yaml file 
  4. Click import again > click OK
  5. Read the following error `Invalid parameter "/1/uuid": UUIDv4 is expected.`

Result:
Why would anyone consider this error message useful?  I see two issues with it.
1. The "/1/uuid` path... is nonesense. what does 1 stand for? First nested element, or first object, first tab index.  It's not clear.
2. the fact it reads "UUIDv4". A UUIDv4 value would look something like this `36a4c36e-15a8-43dc-9287-99780609f339`, not the required 32-hex-character string, like `36a4c36e15a843dc928799780609f339`.

If you are going to put time into writing error messages into the code, at least make them helpful.

with logLevel=4, i've got millions of lines per minut in my `docker logs zabbix-server-1` console output. I coud waste hours and hours dumping to file-system, grepping through the files... i'd rather find the code that throws this stupid error message and fix it.

Expected:
 - either mention the line-number (raw or parsed), line-text, adjacent-line-text (error near x string), absolute-path (/templates/template(1)...) or or even report on the invalid UUID value that it's complaining about.



 Comments   
Comment by Simon Jackson [ 2025 Apr 05 ]

Questions:

  • Is this reporting a problem with the UUID value in use? Maybe a checksum validation failed.
  • Is this reporting a missing uuid value altogether?
  • Is this reporting that a UUID key/value pair is required, when one is not used in the template? As I understand it, zabbix creates unique UUID values for every item, prototype, graph etc automatically. Or is that old information?
Comment by Filip Pawlicki [ 2025 Apr 07 ]

Dear Simon,

I've tried both modifying and importing a template without uuid - both produced different errors. I'm wondering if you could share the template that you've tried to import, i'd like to see whats the difference between a compliant and non compliant template. That answers one of the questions - it is not reporting a missing uuid value. 

Is this reporting that a UUID key/value pair is required, when one is not used in the template? - Looking at how almost every part of a template has its own uuid, reporting is required. I'll try to find some info on how are they generated. Meanwhile, could you send us the problematic template please. 

Kind regards,

Filip

Comment by beaufort12 [ 2025 Apr 07 ]

zabbix_export: 
  version: '7.0'
  template_groups:
    - uuid: "b8a393919007480099d2917f4757fd80"
      name: Templates/Applications
  templates:
    - uuid: "b8a393919007480099d2917f4757fd81"
      template: 'Template_Packages'
      name: 'Template Packages'
      description: |
        Template to monitor installed packages using dpkg.
        Contains one item that retrieves a list of installed packages in short format.
      vendor:
        name: YourVendorName
        version: 7.0-0
      groups:
        - name: Templates/Applications
      items:
        - uuid: "f5e6d7c8b9a0e1f2d3c4b5a697887660"
          name: 'Installed Packages'
          key: 'system.sw.packages[mini,dpkg,short]'
          delay: 60s
          history: 90d
          trends: '0'
          value_type: TEXT
          description: |
            Retrieves a list of installed packages in short format using dpkg.
          tags:
            - tag: component
              value: packages

Import failed

  • Invalid parameter "/1/uuid": UUIDv4 is expected.
Comment by Alexander Vladishev [ 2025 Apr 08 ]

The UUIDv4 identifiers in your example are not valid. Octets 6 and 8 must contain the correct version and variant bits.
Please refer to RFC 9652 for the proper format.

The "/1/uuid` path... is nonesense. what does 1 stand for? First nested element, or first object, first tab index.  It's not clear.

We are continuously working on improving input validation and error handling. For example, some enhancements in this area are being implemented in ZBXNEXT-9774.

the fact it reads "UUIDv4". A UUIDv4 value would look something like this `36a4c36e-15a8-43dc-9287-99780609f339`, not the required 32-hex-character string, like `36a4c36e15a843dc928799780609f339`.

Although the commonly accepted UUID format includes hyphens (8-4-4-4-12), other formats are also valid — for example, enclosing the UUID in curly braces or writing it without hyphens.

We’ve chosen the latter format (without hyphens).
See: https://en.wikipedia.org/wiki/Universally_unique_identifier#Textual_representation

Comment by Simon Jackson [ 2025 Apr 22 ]

sasha You closed this ticket with a "Won’t Fix." status.

I raised this issue to highlight the ambiguity of the error message Invalid parameter "/1/uuid": UUIDv4 is expected. and to suggest improvements to its clarity.

Your premature closure of this ticket without adequate justification or consultation is a problem.

Supporting a community-driven project requires collaboration, and dismissing feedback without thorough discussion undermines trust and respect. Closing any ticket without addressing the core of the issue requested (in this case: poor error handling) sends a discouraging signal to the wider community.

As engineers, we rely on collaborative feedback to resolve issues efficiently. Dismissive responses erode confidence in the support process and reflect poorly on the broader Zabbix team.

 

You closed my ticket with no related evidence or detailed analysis to support your closure statements. To clarify:

1. I did not share my YAML initially because it was under active development.

  • I systematically replaced all 98 UUIDs in the file to rule out formatting issues. You claim i provided an example (when/where?).
  • The UUIDs were all replace programmatically, via a Python script I wrote here
  • Through extensive trial-and-error (reviewing 1,800+ lines of code), I identified the root cause: two UUIDs mistakenly used em-dashes () instead of hyphens/en-dash (-).

If you want to look at my YAML now, i've published it here.

2. The template import routine, produces an error message that is misleading and led to hours of unnecessary debugging.

  • The current message does not distinguish between formatting errors (like invalid characters) and structural issues (like malformed UUIDs).
  • My goal in raising this ticket was to improve error handling for all users, not to report a bug in my template.

 

I respectfully request that you:

  • Reopen this ticket for further review.
  • Collaborate on improving the error-handling mechanism to better serve the community.
  • Ensure future engagements are handled with transparency and respect.

 

Thank you,

Simon

Comment by Alexander Vladishev [ 2025 Apr 22 ]

1. I did not share my YAML initially

My apologies — I mistakenly took the example from user beaufort12 in the comment above as your own.

2. The template import routine, produces an error message that is misleading

I explained in my comment above that similar improvements are already being implemented as part of another ticket. That’s why I wanted to expedite resolving this by closing the current one and leaving a restricted comment for developers in the ticket that’s already in progress.

I’ll move this ticket to a more appropriate project — ZBXNEXT — since the issue you described cannot be considered a bug.

Comment by Jim [ 2025 May 09 ]

In the meantime, what is the solution to get around this error?

  • Using double quotes doesn't work.
  • Single quotes doesn't work.
  • Curly braces doesn't work.
  • Brackets doesn't work.
  • Hyphen's don't work.
  • Copying the UUID's from a working template doesn't work.
  • Using a UUID generator tool doesn't work.
    • example 1:  f7f26ea3-0e35-4926-ba9a-e4c1297b927c 
    • example 2: 70ebf0442d0911f09cd20242ac120002

DetailsImport failed

  • Invalid parameter "/1/uuid": UUIDv4 is expected.

???

Please enlighten me.

   ---
zabbix_export:
  version: "7.2"
  template_groups:
    - uuid: 70ebe04a2d0911f09cd20242ac120002
      name: 'Templates/WMI'
  templates:
    - uuid: 70ebe2a22d0911f09cd20242ac120002
      template: Template WMI Class Timing
      name: Template WMI Class Timing
      groups:
        - name: Templates/WMI
      items:
        - uuid: 70ebe36a2d0911f09cd20242ac120002
          name: "WMI Query Time: Win32_Service (WMI)"
          key: system.run["powershell -command \"(Measure-Command

{ Get-WmiObject             Win32_Service }

).TotalMilliseconds\"]"
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi.class
              value: Win32_Service
        - uuid: 70ebe4142d0911f09cd20242ac120002
          name: "WMI Query Time: Win32_Service (CIM)"
          key: system.run["powershell -command \"(Measure-Command

{ Get-CimInstance             Win32_Service }

).TotalMilliseconds\"]"
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi.class
              value: Win32_Service
        - uuid: 70ebe4e62d0911f09cd20242ac120002
          name: "WMI Query Time: Win32_ComputerSystem (WMI)"
          key: system.run["powershell -command \"(Measure-Command

{ Get-WmiObject             Win32_ComputerSystem }

).TotalMilliseconds\"]"
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi.class
              value: Win32_ComputerSystem
        - uuid: 70ebe5fe2d0911f09cd20242ac120002
          name: "WMI Query Time: Win32_ComputerSystem (CIM)"
          key: system.run["powershell -command \"(Measure-Command

{ Get-CimInstance             Win32_ComputerSystem }

).TotalMilliseconds\"]"
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi.class
              value: Win32_ComputerSystem
        - uuid: 70ebe69e2d0911f09cd20242ac120002
          name: "WMI Query Time: Win32_OperatingSystem (WMI)"
          key: system.run["powershell -command \"(Measure-Command

{ Get-WmiObject             Win32_OperatingSystem }

).TotalMilliseconds\"]"
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi.class
              value: Win32_OperatingSystem
        - uuid: 70ebe7482d0911f09cd20242ac120002
          name: "WMI Query Time: Win32_OperatingSystem (CIM)"
          key: system.run["powershell -command \"(Measure-Command

{ Get-CimInstance             Win32_OperatingSystem }

).TotalMilliseconds\"]"
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi.class
              value: Win32_OperatingSystem
        - uuid: 70ebe8562d0911f09cd20242ac120002
          name: "WMI Query Time: Win32_NetworkAdapter (WMI)"
          key: system.run["powershell -command \"(Measure-Command

{ Get-WmiObject             Win32_NetworkAdapter }

).TotalMilliseconds\"]"
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi.class
              value: Win32_NetworkAdapter
        - uuid: 70ebe9002d0911f09cd20242ac120002
          name: "WMI Query Time: Win32_NetworkAdapter (CIM)"
          key: system.run["powershell -command \"(Measure-Command

{ Get-CimInstance             Win32_NetworkAdapter }

).TotalMilliseconds\"]"
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi.class
              value: Win32_NetworkAdapter
        - uuid: 70ebe9e62d0911f09cd20242ac120002
          name: Top 5 Slow WMI Classes
          key: system.run["powershell -ExecutionPolicy Bypass -File
            C:\\Zabbix\\Scripts
WmiTop5.ps1"]
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: TEXT
          tags:
            - tag: wmi
              value: fallback
        - uuid: 70ebeaf42d0911f09cd20242ac120002
          name: WMI Fallback Timing (Get-WmiObject > Get-CimInstance)
          key: system.run["powershell -command \"try

{ $wmi=(Measure-Command             \{Get-WmiObject Win32_OperatingSystem}

).TotalMilliseconds;
            $cim=(Measure-Command

{Get-CimInstance             Win32_OperatingSystem}

).TotalMilliseconds; ($wmi - $cim) } catch

{             9999 }

\""]
          type: ZABBIX_ACTIVE
          delay: 10m
          value_type: FLOAT
          units: ms
          tags:
            - tag: wmi
              value: fallback
              
          triggers:
            - uuid: 70ebeb8a2d0911f09cd20242ac120002
              name: 🔥 WMI query for {HOST.NAME} > 750 ms
              expression: '{Template WMI Class Timing:system.run["powershell -command
                \"(Measure-Command

{ Get-WmiObject Win32_Service                 }).TotalMilliseconds\"].last()} > 750'
              priority: HIGH
            - uuid: 70ebec2a2d0911f09cd20242ac120002
              name: 💀 WMI query for {HOST.NAME} > 1000 ms
              expression: '{Template WMI Class Timing:system.run["powershell -command
                \"(Measure-Command { Get-WmiObject Win32_Service                 }

).TotalMilliseconds\"].last()} > 1000'
              priority: DISASTER
            - uuid: 70ebed382d0911f09cd20242ac120002
              name: ⚠️ WMI query for {HOST.NAME} > 500 ms
              expression: '{Template WMI Class Timing:system.run["powershell -command
                \"(Measure-Command

{ Get-WmiObject Win32_Service                 }

).TotalMilliseconds\"].last()} > 500'
              priority: WARNING
      discovery_rules:
        - uuid: 70ebedd82d0911f09cd20242ac120002
          name: Discovered Slow WMI Classes
          key: system.run["powershell -ExecutionPolicy Bypass -File
            C:\Zabbix\Scripts\WmiTop5.ps1"]
          type: ZABBIX_ACTIVE
          delay: 1h
          lifetime: 1d
          item_prototypes:
            - uuid: 70ebef0e2d0911f09cd20242ac120002
              name: "WMI Slowpoke Time: {#CLASS}"
              key: system.run["powershell -command \"(Measure-Command { Get-WmiObject

{#CLASS}

                }).TotalMilliseconds\""]
              type: ZABBIX_ACTIVE
              delay: 10m
              value_type: FLOAT
              units: ms
              tags:
                - tag: wmi.slowpoke
                  value: "{#CLASS}"
              trigger_prototypes:
                - uuid: 70ebefa42d0911f09cd20242ac120002
                  name: ❌ {#CLASS} query is too slow
                  expression: 'last(/Template WMI Class Timing/system.run"powershell -command \"(Measure-Command { Get-WmiObject {#CLASS}}).TotalMilliseconds\"") > 750'
                  priority: HIGH
  graphs:
    - uuid: 70ebf0442d0911f09cd20242ac120002
      name: WMI Query Time per Class
      graph_items:
        - drawtype: BOLD_LINE
          item:
            host: Template WMI Class Timing
            key: system.run["powershell -command \"(Measure-Command

{ Get-WmiObject               Win32_Service }

).TotalMilliseconds\"]
        - drawtype: BOLD_LINE
          item:
            host: Template WMI Class Timing
            key: system.run["powershell -command \"(Measure-Command

{ Get-CimInstance               Win32_Service }

).TotalMilliseconds\"]
        - drawtype: BOLD_LINE
          item:
            host: Template WMI Class Timing
            key: system.run["powershell -command \"(Measure-Command

{ Get-WmiObject               Win32_ComputerSystem }

).TotalMilliseconds\"]
        - drawtype: BOLD_LINE
          item:
            host: Template WMI Class Timing
            key: system.run["powershell -command \"(Measure-Command

{ Get-CimInstance               Win32_ComputerSystem }

).TotalMilliseconds\"]
        - drawtype: BOLD_LINE
          item:
            host: Template WMI Class Timing
            key: system.run["powershell -command \"(Measure-Command

{ Get-WmiObject               Win32_OperatingSystem }

).TotalMilliseconds\"]
        - drawtype: BOLD_LINE
          item:
            host: Template WMI Class Timing
            key: system.run["powershell -command \"(Measure-Command

{ Get-CimInstance               Win32_OperatingSystem }

).TotalMilliseconds\"]
        - drawtype: BOLD_LINE
          item:
            host: Template WMI Class Timing
            key: system.run["powershell -command \"(Measure-Command

{ Get-WmiObject               Win32_NetworkAdapter }

).TotalMilliseconds\"]
        - drawtype: BOLD_LINE
          item:
            host: Template WMI Class Timing
            key: system.run["powershell -command \"(Measure-Command

{ Get-CimInstance               Win32_NetworkAdapter }

).TotalMilliseconds\"]

Generated at Sat Jun 14 17:40:22 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.