Actions
Bug #18170
openLDAP search error with directive creation API when no id is provided
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
Description
Trying to reproduce #14934, I got:
In curl:
{"action":"createDirective","id":"","result":"error","errorDetails":"Could not create Directive <- Could not save Directive <- Can't execute LDAP request"}
In webapp console:
com.unboundid.ldap.sdk.LDAPSearchException: invalid DN at com.unboundid.ldap.sdk.LDAPConnection.search(LDAPConnection.java:3772) at com.unboundid.ldap.sdk.LDAPConnection.getEntry(LDAPConnection.java:1803) at com.unboundid.ldap.sdk.LDAPConnection.getEntry(LDAPConnection.java:1770) at com.normation.ldap.sdk.RoLDAPConnection.get(LDAPConnection.scala:312) at com.normation.ldap.sdk.RwLDAPConnection.save(LDAPConnection.scala:580) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository.$anonfun$internalSaveDirective$10(LDAPDirectiveRepository.scala:595) at com.normation.rudder.repository.ldap.ScalaLock.$anonfun$apply$1(Lock.scala:46) at com.normation.rudder.repository.ldap.ScalaLock.map(Lock.scala:36) at com.normation.rudder.repository.ldap.ScalaLock.map$(Lock.scala:33) at com.normation.rudder.repository.ldap.ScalaLock$$anon$1.map(Lock.scala:60) at com.normation.rudder.repository.ldap.ScalaLock.apply(Lock.scala:46) at com.normation.rudder.repository.ldap.ScalaLock.apply$(Lock.scala:46) at com.normation.rudder.repository.ldap.ScalaLock$$anon$1.apply(Lock.scala:60) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository.$anonfun$internalSaveDirective$9(LDAPDirectiveRepository.scala:595) at net.liftweb.common.Full.flatMap(Box.scala:856) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository.$anonfun$internalSaveDirective$7(LDAPDirectiveRepository.scala:590) at net.liftweb.common.Full.flatMap(Box.scala:856) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository.$anonfun$internalSaveDirective$3(LDAPDirectiveRepository.scala:560) at net.liftweb.common.Full.flatMap(Box.scala:856) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository.$anonfun$internalSaveDirective$1(LDAPDirectiveRepository.scala:559) at com.normation.ldap.sdk.LDAPConnectionProvider.$anonfun$flatMap$1(LDAPConnectionProvider.scala:117) at com.normation.ldap.sdk.LDAPConnectionProvider.withCon(LDAPConnectionProvider.scala:154) at com.normation.ldap.sdk.LDAPConnectionProvider.withCon$(LDAPConnectionProvider.scala:143) at com.normation.ldap.sdk.RWPooledSimpleAuthConnectionProvider.withCon(LDAPConnectionProvider.scala:395) at com.normation.ldap.sdk.LDAPConnectionProvider.flatMap(LDAPConnectionProvider.scala:116) at com.normation.ldap.sdk.LDAPConnectionProvider.flatMap$(LDAPConnectionProvider.scala:115) at com.normation.ldap.sdk.RWPooledSimpleAuthConnectionProvider.flatMap(LDAPConnectionProvider.scala:395) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository.internalSaveDirective(LDAPDirectiveRepository.scala:558) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository.saveDirective(LDAPDirectiveRepository.scala:639) at com.normation.rudder.rest.lift.DirectiveAPIService2.$anonfun$actualDirectiveCreation$6(DirectiveApi.scala:283) at net.liftweb.common.Full.flatMap(Box.scala:856) at com.normation.rudder.rest.lift.DirectiveAPIService2.$anonfun$actualDirectiveCreation$1(DirectiveApi.scala:276) at net.liftweb.common.Full.flatMap(Box.scala:856) at com.normation.rudder.rest.lift.DirectiveAPIService2.actualDirectiveCreation(DirectiveApi.scala:270) at com.normation.rudder.rest.lift.DirectiveAPIService2.$anonfun$createDirective$8(DirectiveApi.scala:312) at com.normation.rudder.rest.RestUtils$.$anonfun$actionResponse2$3(RestUtils.scala:170) at net.liftweb.common.Full.flatMap(Box.scala:856) at com.normation.rudder.rest.RestUtils$.$anonfun$actionResponse2$2(RestUtils.scala:170) at net.liftweb.common.Full.flatMap(Box.scala:856) at com.normation.rudder.rest.RestUtils$.actionResponse2(RestUtils.scala:168) at com.normation.rudder.rest.lift.DirectiveApi.actionResponse(DirectiveApi.scala:96)
WORKAROUND: provide an uuid in JSNO:
{ "displayName": "My Directive", "enabled": true, "id": "66b962cb-a039-4bf9-8e52-4ff10aeb6542", "longDescription": "", "parameters": { ....
Updated by François ARMAND about 4 years ago
- Related to Bug #14934: Rudder directive API seem to take key-value order into account in json POST request added
Updated by François ARMAND about 4 years ago
- Subject changed from LDAP search error with directive creation API to LDAP search error with directive creation API when no id is provided
The problem is that in the example JSON, no id is defined. And we don't generate one, so we try to save directive:
directiveId=,activeTechniqueId=1734858c-dd66-4fe4-8c29-266f4bc79622,techniqueCategoryId=userManagement,techniqueCategoryId=systemSettings,techniqueCategoryId=Active Techniques,ou=Rudder,cn=rudder-configuration
If we add a generated ID in the corresponding JSON field, save is OK.
Updated by Vincent MEMBRÉ about 4 years ago
- Target version changed from 5.0.20 to 797
Updated by Benoît PECCATTE over 3 years ago
- Target version changed from 797 to 6.1.14
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.1.14 to 6.1.15
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.1.15 to 6.1.16
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 6.1.16 to 6.1.17
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 6.1.17 to 6.1.18
Updated by Vincent MEMBRÉ almost 3 years ago
- Target version changed from 6.1.18 to 6.1.19
Updated by Vincent MEMBRÉ over 2 years ago
- Target version changed from 6.1.19 to 6.1.20
Updated by Vincent MEMBRÉ over 2 years ago
- Target version changed from 6.1.20 to 6.1.21
Updated by Vincent MEMBRÉ over 2 years ago
- Target version changed from 6.1.21 to old 6.1 issues to relocate
Updated by Alexis Mousset almost 2 years ago
- Target version changed from old 6.1 issues to relocate to old 6.2 issues to relocate
Updated by Alexis Mousset over 1 year ago
- Target version changed from old 6.2 issues to relocate to 7.2.11
Updated by Vincent MEMBRÉ about 1 year ago
- Target version changed from 7.2.11 to 1046
Updated by Alexis Mousset about 1 year ago
- Target version changed from 1046 to 7.3.8
Updated by Vincent MEMBRÉ about 1 year ago
- Target version changed from 7.3.8 to 7.3.9
Updated by Vincent MEMBRÉ about 1 year ago
- Target version changed from 7.3.9 to 7.3.10
Updated by Vincent MEMBRÉ 12 months ago
- Target version changed from 7.3.10 to 7.3.11
Updated by Vincent MEMBRÉ 10 months ago
- Target version changed from 7.3.11 to 7.3.12
Updated by Vincent MEMBRÉ 9 months ago
- Target version changed from 7.3.12 to 7.3.13
Updated by Vincent MEMBRÉ 9 months ago
- Target version changed from 7.3.13 to 7.3.14
Updated by Vincent MEMBRÉ 7 months ago
- Target version changed from 7.3.14 to 7.3.15
Updated by Vincent MEMBRÉ 6 months ago
- Target version changed from 7.3.15 to 7.3.16
Updated by Vincent MEMBRÉ 5 months ago
- Target version changed from 7.3.16 to 7.3.17
Actions