Nextcloud problem with encoding URLs

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      HTTP Agent requests fail for discovered entities when LLD macro values contain spaces and are used directly in URL paths.


      Environment

      • Zabbix Server: 8.0
      • Template: Nextcloud by HTTP
      • Nextcloud: 32.0.0
      • HTTP Agent item created from LLD prototype
      • Authentication configured correctly

      Description

      When a discovered value contains whitespace and is inserted into an HTTP Agent URL via an LLD macro, the generated request fails.

      The issue was observed with the Nextcloud template, but the behavior might be generic to HTTP Agent URL construction rather than specific to Nextcloud.

      The template discovers users and stores usernames in:
      {{

      {#NEXTCLOUD.USER}

      }}
      The item prototype then constructs the URL:
      /ocs/v1.php/cloud/users/{#NEXTCLOUD.USER}
       
      For a user without spaces:
      /ocs/v1.php/cloud/users/john
      The request succeeds.
      For a user with spaces:
      /ocs/v1.php/cloud/users/john smith
       
      The request fails.

      The username is inserted into the URL path without URL encoding.

      Expected URL:
      /ocs/v1.php/cloud/users/john%20smith
       
      Actual URL:
      /ocs/v1.php/cloud/users/john smith
       
      As a result, the master HTTP Agent item becomes unsupported and all dependent items for that user fail.

      Manually inserting '%20' fixes the item.

       

      See the side-by-side comparison of items:


      Steps to Reproduce

      1. Deploy Nextcloud and configure the official Nextcloud template.
      2. Create two users:

      john
      john smith # Configure template macros and verify data collection works.

      1. Run "Nextcloud users discovery".
      2. Wait for item prototypes to be created.
      3. Open discovered items.

      Observe:
      User "john": Get data
      works correctly.

      Observe:
      User "john smith": Get data
      fails.


      Expected Result

      Values substituted into HTTP Agent URLs should be URL-encoded automatically when used as URL path components according to the documentation.

      The generated request should be:
      /ocs/v1.php/cloud/users/john%20smith
      and data collection should succeed regardless of valid username characters.

        1. image-2026-06-10-10-52-43-655.png
          72 kB
          Kamil Florowski
        2. image-2026-06-10-10-58-23-079.png
          240 kB
          Kamil Florowski

            Assignee:
            Juris Bregis
            Reporter:
            Kamil Florowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 3h
                3h