Unable to map attributeID

Matthieu Patou mat at matws.net
Sat Aug 22 07:12:02 MDT 2009


Looks like a bug somewhere as if I remove the transaction I am able to 
add some objects and when the addition is OK I do not have strange 
trailing chars.

dn:CN=ACS-Max-Peak-Bandwidth,CN=Schema,CN=Configuration,DC=smb4,DC=tst 
<-- this object was causing problems before and now it's OK
objectClass:top
objectClass:attributeSchema
cn:ACS-Max-Peak-Bandwidth
instanceType:4
attributeID:1.2.840.113556.1.4.767
attributeSyntax:2.5.5.16
isSingleValued:TRUE
oMSyntax:65
searchFlags:0
lDAPDisplayName:aCSMaxPeakBandwidth
cn:ACS-Max-Peak-Bandwidth
schemaIDGUID:7f561284-5301-11d1-a9c5-0000f80367c1
systemOnly:FALSE
systemFlags:16

schema_fsmo_add: added to map attributeID[1.2.840.113556.1.4.767]: WERR_OK
dn:CN=ACS-Max-Peak-Bandwidth-Per-Flow,CN=Schema,CN=Configuration,DC=smb4,DC=tst
objectClass:top
objectClass:attributeSchema
cn:ACS-Max-Peak-Bandwidth-Per-Flow
instanceType:4
attributeID:1.2.840.113556.1.4.759
attributeSyntax:2.5.5.16
isSingleValued:TRUE
oMSyntax:65
searchFlags:0
lDAPDisplayName:aCSMaxPeakBandwidthPerFlow
cn:ACS-Max-Peak-Bandwidth-Per-Flow
schemaIDGUID:7f56127c-5301-11d1-a9c5-0000f80367c1
systemOnly:FALSE
systemFlags:16
  <snip 6 insertions OK>
WERR_OK
dn:CN=ACS-Minimum-Latency,CN=Schema,CN=Configuration,DC=smb4,DC=tst
objectClass:top
objectClass:attributeSchema
cn:ACS-Minimum-Latency
instanceType:4
attributeID:1.2.840.113556.1.4.1316
attributeSyntax:2.5.5.16
isSingleValued:TRUE
oMSyntax:65
searchFlags:0
lDAPDisplayName:aCSMinimumLatency
cn:ACS-Minimum-Latency
schemaIDGUID:9517fefb-3b90-11d2-90cc-00c04fd91ab1
systemOnly:FALSE
systemFlags:16

schema_fsmo_add: failed to map attributeID[1.2.840.113556.1.4.1316nP]: 
WERR_INVALID_PARAM

Traceback (most recent call last):
   File "/usr/local/src/samba4/source4/scripting/bin/upgradeschema.py", 
line 415, in <module>
     check_diff(newpaths,paths,creds,session,names)
   File "/usr/local/src/samba4/source4/scripting/bin/upgradeschema.py", 
line 402, in check_diff
     check_diff_name(newpaths,paths,creds,session,name,names)
   File "/usr/local/src/samba4/source4/scripting/bin/upgradeschema.py", 
line 395, in check_diff_name
     sam_ldb.add(m)
_ldb.LdbError: (53, 'schema_fsmo_add: failed to map 
attributeID[1.2.840.113556.1.4.1316nP]: WERR_INVALID_PARAM\n')

Any explanations ?

Matthieu.



On 08/22/2009 03:42 PM, Matthieu Patou wrote:
> Hello all,
>
> in my tries to create an script to upgrade provision I am a blocked when
> I try to create missing attributes in the schema.ldb:
>
> I am trying to create this object (the @@@ are added during the display
> to be sure that no trailing chars are present):
>
> dn:CN=ACS-Max-Peak-Bandwidth,CN=Schema,CN=Configuration,DC=smb4,DC=tst@@@
> objectClass:top@@@
> objectClass:attributeSchema@@@
> cn:ACS-Max-Peak-Bandwidth@@@
> instanceType:4@@@
> attributeID:1.2.840.113556.1.4.767@@@
> attributeSyntax:2.5.5.16@@@
> isSingleValued:TRUE@@@
> oMSyntax:65@@@
> searchFlags:0@@@
> lDAPDisplayName:aCSMaxPeakBandwidth@@@
> cn:ACS-Max-Peak-Bandwidth@@@
> schemaIDGUID:7f561284-5301-11d1-a9c5-0000f80367c1@@@
> systemOnly:FALSE@@@
> systemFlags:16@@@
>
> I get this message:
>
> schema_fsmo_add: failed to map attributeID[1.2.840.113556.1.4.767-FP]:
> WERR_INVALID_PARAM
>
> Traceback (most recent call last):
> File "/usr/local/src/samba4/source4/scripting/bin/upgradeschema.py",
> line 415, in <module>
> check_diff(newpaths,paths,creds,session,names)
> File "/usr/local/src/samba4/source4/scripting/bin/upgradeschema.py",
> line 402, in check_diff
> check_diff_name(newpaths,paths,creds,session,name,names)
> File "/usr/local/src/samba4/source4/scripting/bin/upgradeschema.py",
> line 395, in check_diff_name
> sam_ldb.add(m)
> _ldb.LdbError: (53, 'schema_fsmo_add: failed to map
> attributeID[1.2.840.113556.1.4.767-FP]: WERR_INVALID_PARAM\n')
> A transaction is still active in ldb context [0xb25f4f8]
>
> I am a bit puzzled to see trailing chars at the end of the attributeID
> (here -FP).
> But I'm not sure that it's the case of my problem.
>
> Here is the part of the code
>
>
> # Reopen schema ldb ... doing like the provision script
> sam_ldb = Ldb(session_info=session, credentials=creds, lp=lp)
> schema = Schema(setup_path, schemadn=names.schemadn,
> serverdn=names.serverdn)
> # Load the schema from the one we computed earlier
> sam_ldb.set_schema_from_ldb(schema.ldb)
>
> # And now we can connect to the DB - the schema won't be loaded from the DB
> sam_ldb.connect(paths.samdb)
> sam_ldb.transaction_start()
> sam_ldb.set_schema_from_ldb(schema.ldb)
> #print >>sys.stderr,schema.schema_data
> for e in listMissing:
> res3= newsam_ldb.search(expression="dn=%s"%e,base=name,
> scope=SCOPE_SUBTREE)
> ldif = ""
> m = ldb.Message()
> m.dn = ldb.Dn(sam_ldb, str(res3[0]["dn"]))
> #m["dn"] = ldb.MessageElement( str(res3[0]["dn"]), ldb.CHANGETYPE_ADD,
> "dn")
> ldif += "dn:%s"%(res3[0]["dn"])+"\n"
> for attr in res3[0]:
> found=0
> sAtt=str(attr)
> for invalidAtt in attrNotCopied:
> if(not cmp(sAtt,invalidAtt)):
> found=1
> break
> if not found:
> val = []
> if not cmp(sAtt,"name"):
> sAtt = "cn"
> #print >>sys.stderr,sAtt
> for v in res3[0][attr]:
> if hashGUID.has_key(sAtt):
> v = str(ndr_unpack( misc.GUID,v))
> if hashNTDesc.has_key(sAtt):
> v = str(ndr_unpack( security.descriptor,v))
> #print >>sys.stderr," "+str(v)
> val.append(str(v))
> ldif += "%s:%s"%(sAtt,v)+"\n"
> m[sAtt] = ldb.MessageElement(val, ldb.CHANGETYPE_ADD, sAtt)
> print >>sys.stderr,ldif
> sam_ldb.add(m)
>
>
> Any idea welcomed !
>
> Matthieu.



More information about the samba-technical mailing list