Re: nsDirectoryServerTask objectClass

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Juan Asensio Sánchez wrote:
Well

I have found the errors. When I execute the script db2index.pl, i was
using the server instance instead the database instance for the -n
parameter.With the LDAP file i forgot to include the nsInstance
attribue, as Rich said.

Now the tasks for reindexing are created OK, but i use a script that
creates lots of tasks to update the indexes of the database, so the
first task for the database runs ok, but the others don't run because
of this error. The attributes of the tasks are for nstasklog and
nstaskstatus "Index failed (error -1)", and in the error log i get
"ldbm: 'userRoot' is already in the middle of another task and cannot
be disturbed.". Is there any way to run the tasks in order, starting
one when other finishes?
Yes. Using the task interface, you simply do a search of the index task entry. When the entry has the nsTaskExitCode, the task is completed. The value of that attribute will be 0 if the task was successful, or some error code if not. The server will remove the entry automatically after a certain period of time, so if the entry does not exist (err=32) then the task is completed, but you will not be able to get the exit code.
Regards.

2009/8/17 Rich Megginson <rmeggins@xxxxxxxxxx>:
Juan Asensio Sánchez wrote:
Hi

I can't get this to work. Even with the script db2index.pl, i get an
error:


===============================================================================
[root@server11 slapd-center1]# ./db2index.pl  -D "cn=Directory
Manager" -w - -v -n center1 -t cn:eq
Bind Password:

ldapmodify: started Mon Aug 17 11:49:52 2009

ldap_init( server11.center1.xxxxxxxx.local, 389 )
add objectclass:
       top
       extensibleObject
add cn:
       db2index_2009_8_17_11_49_52
add nsInstance:
       center1
add nsIndexAttribute:
       cn:eq
adding new entry cn=db2index_2009_8_17_11_49_52, cn=index, cn=tasks,
cn=config
ldap_add: No such object

look in /var/log/dirsrv/slapd-instance/access - find the ADD operation
corresponding to this - which entry does it complain about?
===============================================================================


With an LDIF file:


===============================================================================
[root@server11 ~]# cat index_cn.ldif
dn : cn=cn_index_task, cn=index, cn=tasks, cn=config
objectClass: top
objectClass: extensibleObject
cn: cn_index_task
nsIndexAttribute: eq:pres
[root@server11 ~]# ldapadd -H ldap://localhost -D "cn=Directory
Manager" -W -x -f index_cn.ldif
Enter LDAP Password:
adding new entry "cn=cn_index_task, cn=index, cn=tasks, cn=config"
ldapadd: Object class violation (65)

You are missing
nsInstance: center1
===============================================================================

Any idea?

Thanks in advance.


2009/8/14 Rich Megginson <rmeggins@xxxxxxxxxx>:

Juan Asensio Sánchez wrote:

Hi

I am trying to create a task to update the index database, according
to the instructions described here:

-

http://www.redhat.com/docs/manuals/dir-server/8.1/admin/applying-indexes.html
-
http://directory.fedoraproject.org/wiki/Task_Invocation_Via_LDAP_Design

But when I create the task from a Perl script, i get an error about
unknown object class:

my $entry = Net::LDAP::Entry->new();
$tmp_index_name = 'cn';
my $cn = "$tmp_index_name index task";
$entry->dn("cn=$cn, cn=index, cn=tasks, cn=config");
$entry->add('objectClass' => ['nsDirectoryServerTask']);
$entry->add('cn' => $cn);
$entry->add('nsindexattribute' => "\"eq:pres\"");
my $res = $entry->update($ldap_conn);

The error is 'unknown object class "nsDirectoryServerTask"'. Where is
that objectClass defined?


It is not defined.  The documentation is wrong.  Just use
extensibleObject
as the objectclass.  For more information and examples, see the various
perl
scripts created for each instance in /usr/lib/dirsrv/slapd-instance -
db2ldif.pl, ldif2db.pl, db2index.pl, etc.

And please file a bug to correct that documentation.

# rpm -qa | grep -i fedora
fedora-ds-admin-1.1.1-1.fc6
fedora-ds-1.1.0-3.fc6
fedora-ds-base-1.1.0-3.fc6
fedora-admin-console-1.1.0-4.fc6
fedora-idm-console-1.1.0-5.fc6
fedora-ds-console-1.1.0-5.fc6
# uname -a
Linux grsgscbulp0301.sacyl.es 2.6.18-128.1.10.el5.centos.plusPAE #1
SMP Mon May 11 07:51:33 EDT 2009 i686 i686 i386 GNU/Linux

Regards and thanks in advance.

--
389 users mailing list
389-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-users


--
389 users mailing list
389-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-users



--
389 users mailing list
389-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-users


--
389 users mailing list
389-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-users



--
389 users mailing list
389-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-users


<<attachment: smime.p7s>>

--
389 users mailing list
389-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-users

[Index of Archives]     [Fedora Directory Users]     [Fedora Directory Devel]     [Fedora Announce]     [Fedora Legacy Announce]     [Kernel]     [Fedora Legacy]     [Share Photos]     [Fedora Desktop]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite News]

  Powered by Linux