RHDS - Error message "value #0 invalid per syntax" while trying to add an entry.

Solution Verified - Updated -

Environment

Red Hat Directory Server 10
Red Hat Enterprise Linux 7.x
Red Hat Directory Server 11
Red Hat Enterprise Linux 8.x

Issue

RHDS rejects an entry during an import with the following messages:

[26/Oct/2020:11:28:22.398709935 +0000] - ERR - slapi_entry_syntax_check - "uid=tmorris,ou=People,dc=example,dc=com": (<ATTRIBUTE>) value #0 invalid per syntax
[26/Oct/2020:11:28:22.404782861 +0000] - WARN - import_producer - import <BACKEND>: Skipping entry "uid=tmorris,ou=People,dc=example,dc=com" which violates attribute syntax, ending line <XXX> of file "<FILE_NAME>"

Resolution

The error message "value #0 invalid per syntax" means that the value of the attribute is not valid.
This typically happens when the value doesn't conform to the schema.
Therefore the value should be adjusted to obey to its schema syntax.

Root Cause

The value of the attribute is invalid ( not conform to the schema ).

Diagnostic Steps

Example for the attribute passwordExpirationTime with an incorrect value:

passwordExpirationTime: 203212235959Z

The attribute passwordExpirationTime uses the syntax GeneralizedTime:

This syntax is defined in this RFC:
https://tools.ietf.org/html/rfc4517#section-3.3.13

...
      century = 2(%x30-39) ; "00" to "99"
      year    = 2(%x30-39) ; "00" to "99"
      month   =   ( %x30 %x31-39 ) ; "01" (January) to "09"
                / ( %x31 %x30-32 ) ; "10" to "12"
      day     =   ( %x30 %x31-39 )    ; "01" to "09"
                / ( %x31-32 %x30-39 ) ; "10" to "29"
                / ( %x33 %x30-31 )    ; "30" to "31"
      hour    = ( %x30-31 %x30-39 ) / ( %x32 %x30-33 ) ; "00" to "23"
      minute  = %x30-35 %x30-39                        ; "00" to "59"
...

The value 203212235959Z can be split as below:
- century: 20
- year: 32
- month: 12
- day: 23
- hour: 59
- minute: 59
- g-time-zone: Z

Here the issue is with the hour. It is set at 59 while its range is obviously from "00" to "23".

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments