Errors While Querying with midPoint Query Language

Last modified 22 Apr 2024 16:04 +02:00

While searching with midPoint Query Language you can encounter various error messages. Some of them can be quite cryptic, especially for new users.

Error messages in GUI

Error messages in GUI are displayed below the query.

Path is not present in type

Error path is not present

In this case administrator wanted to search for user with name "adam".

Midpoint says that attribute namex can’t be found in the object type UserType that is displayed in the view Users we are searching.

This is the most typical error you can encounter. It is caused by incorrect identification of property (attribute) in query. Often this error is caused by typo in the name of the attribute. In the example above it is additional "x" in name.

The {http://midpoint.evolveum.com/xml/ns/public/common/common-3} is the namespace of the type UserType. You can ignore it at this place.

Request

Find user with name "adam"

Query

namex = "adam"

Error message

Path namex is not present in type {http://midpoint.evolveum.com/xml/ns/public/common/common-3} UserType

Reason

In this case the reason for error was typo: namex vs name

Correct query

name = "adam"

Troubleshooting hints

  • Verify, that the attribute is present in the object type you are searching. You can check it at searchable items page.

  • Attribute name differs from name that is displayed in GUI (the displayName). Search is using name of the attribute. The translation between name and displayName (english) is described at searchable items page.

  • Verify, that you don’t have typo (e.g. case mismatch) in the name of the property

  • Verify, that the view is displaying the object type you want to search. You can see its name at the end of the error message.

Path is not present in type - dereferencing

Error path is not present - dereferencing

Another kind of the "path is not present in type" error can occur while searching in referenced objects.

Request

Find all users with assigned role identified by value "III" of identifier attribute.

Query

assignment/targetRef/@ matches (identifier="III")

Error message

Path identifier is not present in type {http://midpoint.evolveum.com/xml/ns/public/common/common-3}AssignmentHolderType

Reason

While using dereferencing, midPoint has to know type of the referenced object to correctly process the query.
In this query, midPoint can’t identify the type of the referenced object and incorrectly assumes it is of AssignmentHolderType.

Correct query

assignment/targetRef/@ matches (. type RoleType and identifier="III")

Troubleshooting hints

  • In this case you need to redefine the type of the referenced object. The code . type RoleType tells midPoint that type of the referenced object is RoleType. MidPoint then can find identifier attribute correctly.

  • When the type is explicitly defined, midPoint knows the actual schema of the object. It means, that you can search extension attributes as well.
    E.g. the assignment/targetRef/@ matches (. type RoleType and extension/sapType="SAP555") is valid query when the sapType extension attribute was defined in extension schema.

Definition is not property

Error definition is not property

Request

Find all users with assigned role "System user".

Query

assignment/targetRef = "System user"

Error message

Definition PRD:{…​/common/common-3} targetRef {…​/common/common-3}ObjectReferenceType[0,1],RAM is not property

Reason

The targetRef is a reference to an object. Not to a searchable property.
To search for the assigned object name you need to reference properties within the object. E.g. its name.

Correct query

assignment/targetRef/@/name = "System user"

Troubleshooting hints

  • Verify, that the attribute is present in the object type you are searching. You can check it at searchable items page.

  • Use dereferencing operator "@" for referencing attributes of the assigned object.

Additional unsupported filter specified

Error additional unsupported filter specified

Request

Find all assignments of a role.

Query

assignment/targetRef matches (name="ABC:Admin")

Error message

Additional unsupported filter specified: name="ABC:Admin"

Reason

Query should be searching in referenced objects but the dereferencing operator @ is missing.

Correct query

assignment/targetRef/@ matches (name="ABC:Admin")

Troubleshooting hints

Cannot find enum value for string

Error cannot find enum value for string

Request

Find all users with normal lockout status.

Query

activation/lockoutStatus = "Normal"

Error message

Cannot find enum value for string 'Normal' in class com.evolveum.midpoint.xml.ns._public.common.common_3.LockoutStatusType

Reason

The schema defines enumerated value for this attribute. In this case the allowed values are "normal" and "locked". All lowercase.

Correct query

activation/lockoutStatus = "normal"

Troubleshooting hints

  • Search for allowed values in schema definition. Schemas are described in SchemaDoc. Select version according your midPoint version.
    In this case search in schema "common/common-3" for "LockoutStatusType"

Couldn’t count objects

Error couldn’t count objects

This is error message telling that processing of the query failed somehow during processing.

To know why it failed you need to open the error message and see what happened in the messages below.

Unknown matching rule 'stringIgnoreCase'

Error couldn’t count objects

Request

Find all users with locality "Edinburgh" ignoring case. Find all with "edinburgh", "EDINBURGH" or "Edinbugh".

Query

locality =[stringIgnoreCase] "Edinburgh"

Error message

Couldn’t count objects
Unknown matching rule 'stringIgnoreCase'.

Reason

The matching rules relate to attribute type.
locality is of PolystringType and stringIgnoreCase matching rule is defined for strings only.
For polystring you need to use origIgnoreCase matching rule.

Correct query

locality =[origIgnoreCase] "Edinburgh"

Troubleshooting hints

  • For more information about matching rules in query see matching rules chapter in introduction to Midpoint Query Language.

  • List of all matching rules is defined in matching rules page.

Was this page helpful?
YES NO
Thanks for your feedback