-
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:
{{
}}
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
- Deploy Nextcloud and configure the official Nextcloud template.
- Create two users:
john
john smith # Configure template macros and verify data collection works.
- Run "Nextcloud users discovery".
- Wait for item prototypes to be created.
- 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.