Results 1 to 7 of 7

Thread: Reindex procedure from GUI unclear

  1. #1
    Join Date
    Sep 2007
    Posts
    48
    Rep Power
    8

    Default Reindex procedure from GUI unclear

    Is there a way to reindex a user's mailbox from the command line? If you reindex from the web GUI, it is unclear to the average user if the operations continues to run if you close your session. If it does continue to run, there is no success/failure report at completion. Is this something that is going to be changed in 5.0? Is there something I'm missing now?

    Shawn

  2. #2
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    I don't remember how it was on 4.5.6, you should try 4.5.10 because it generally seems fine to me & I don't remember what version had updates to that. (I've attached some screenshots after throwing about 80 emails into an account, browser used is firefox 2.0.0.11)
    In 5.0 there's zmprov rim user@domain.com
    For 4.5 I believe the only non-GUI method would be a soap request; I can hunt down a perl script if you really want it.
    Last edited by mmorse; 07-06-2008 at 01:03 PM.

  3. #3
    Join Date
    Sep 2007
    Posts
    48
    Rep Power
    8

    Default

    If I close the browser/session, does the index operation continue in the background?

    A perl script would be cool, and even better would be a link to a reference on Zimbra's common soap calls. Perhaps it's on the wiki...

    Thanks.

    Shawn

  4. #4
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Script is at bottom, link to soap calls is in the middle-

    On .7 request looks like:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
    <context xmlns="urn:zimbra">
    <userAgent name="ZimbraWebClient - FF2.0 (Linux)" version="undefined"/>
    <sessionId id="6950"/>
    <authToken>Long String Here
    </authToken>
    <format type="js"/>
    </context>
    </soap:Header>
    <soap:Body>
    <ReIndexRequest xmlns="urn:zimbraAdmin" action="status">
    <mbox id="STRING HERE"/>
    </ReIndexRequest>
    </soap:Body>
    </soap:Envelope>
    Response looks like:
    Body: {
    ReIndexResponse: {
    _jsns: "urn:zimbraAdmin",
    status: "started"
    }
    },
    Header: {
    context: {
    _jsns: "urn:zimbra",
    change: {
    token: 7699
    },
    sessionId: [
    0: {
    _content: "6950",
    id: "6950",
    type: "admin"
    }
    ]
    }
    },
    _jsns: "urn:zimbraSoap"
    ----
    Cleanly that's:
    <ReIndexRequest action="start|status|cancel">
    <mbox id="{account-id}" [types={types} | ids={ids}]/>
    </ReIndexRequest>

    <ReIndexResponse status="started" | "running" | "cancelled">
    [<progress numSucceeded="SUCCEEDED" numFailed="FAILED" numRemaining="REMAINING">]
    </ReIndexResponse>
    -- Progress data is currently ONLY returned by the "status" and "cancelled" calls

    -types -ids are optional, however at most ONE may be specified:
    {ids] = comma-separated list of IDs to re-index.
    {types} = comma-separated list. Legal values are:
    conversation|message|contact|appointment|task|note |wiki|document
    Access: domain admin sufficient
    See soap-admin.txt here: SourceForge.net Repository - [zimbra] Index of /trunk/ZimbraServer/docs
    ----

    Anyways the script:
    run usage is ./reindex.pl -u USER -m MAILBOXID -a ACTION [-p PASSWD] [-h HOST] [-t TYPES] [-ids IDS]

    UserID is system wide
    MailboxID is per server store

    To get those:
    zmprov ga user@domain.com| grep -i zimbraId

    If your on the appropriate mailserver:
    zmprov getMailboxInfo user@domain.com
    or globally:
    /opt/zimbra/bin/mysql -e "use zimbra; select id from mailbox where account_id = 'UserID HERE including the leading 0'"
    I believe you leave those quotes as is ("''")

    I haven't really dug through your post history to check yet - but if you can quickly fill me in - there a reason your not upgrading?

    reindex.pl:
    Code:
    #!/usr/bin/perl -w
    # 
    # ***** BEGIN LICENSE BLOCK *****
    # Zimbra Collaboration Suite Server
    # Copyright (C) 2005, 2006 Zimbra, Inc.
    # 
    # The contents of this file are subject to the Yahoo! Public License
    # Version 1.0 ("License"); you may not use this file except in
    # compliance with the License.  You may obtain a copy of the License at
    # http://www.zimbra.com/license.
    # 
    # Software distributed under the License is distributed on an "AS IS"
    # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
    # ***** END LICENSE BLOCK *****
    # 
    
    use Time::HiRes qw ( time );
    use strict;
    
    use lib '.';
    
    use LWP::UserAgent;
    use Getopt::Long;
    use XmlElement;
    use XmlDoc;
    use Soap;
    use ZimbraSoapTest;
    
    my $ACCTNS = "urn:zimbraAdmin";
    my $MAILNS = "urn:zimbraAdmin";
    
    # If you're using ActivePerl, you'll need to go and install the Crypt::SSLeay
    # module for htps: to work...
    #
    #         ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
    #
    
    # app-specific options
    my ($mbox, $action, $types, $ids);
    
    #standard options
    my ($user, $pw, $host, $help);  #standard
    GetOptions("u|user=s" => \$user,
               "p|port=s" => \$pw,
               "h|host=s" => \$host,
               "m|mbox=s" => \$mbox,
               "a|action=s" => \$action,
               "t|types=s" => \$types,
               "ids=s" => \$ids,
               "help|?" => \$help);
    
    if (!defined($user)) {
      die "USAGE: $0 -u USER -m MAILBOXID -a ACTION [-p PASSWD] [-h HOST] [-t TYPES] [-ids IDS]";
    }
    
    my $z = ZimbraSoapTest->new($user, $host, $pw);
    $z->doAdminAuth();
    
    my %args = ( 'action' => $action );
    
    
    my $d = new XmlDoc;
    $d = new XmlDoc;
    $d->start('ReIndexRequest', $MAILNS, \%args); {
      my %mbxArgs = ( 'id' => $mbox );
      if (defined $ids) {
        $mbxArgs{'ids'} = $ids;
      }
      if (defined $types) {
        $mbxArgs{'types'} = $types;
      }
      $d->add('mbox', $MAILNS, \%mbxArgs);
    } $d->end();
    
    print "\nOUTGOING XML:\n-------------\n";
    my $out =  $d->to_string("pretty");
    $out =~ s/ns0\://g;
    print $out."\n";
    
    my $start = time;
    my $firstStart = time;
    
    my $response = $z->invokeAdmin($d->root());
    
    print "\nRESPONSE:\n--------------\n";
    $out =  $response->to_string("pretty");
    $out =~ s/ns0\://g;
    print $out."\n";
    Last edited by mmorse; 07-06-2008 at 12:29 PM.

  5. #5
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    21

    Default

    It keeps going in the back ground. We have a soap call that starts a java thread.

    Here's the soap-admin docs for 5.0

    It will be in our public p4 cache once it's running. Still hitting bugs.
    Attached Files Attached Files

  6. #6
    Join Date
    Sep 2007
    Posts
    48
    Rep Power
    8

    Default

    Thanks for the prompt response as usual, mmorse and jholder.
    Last edited by shawnlhood; 12-07-2007 at 02:31 PM. Reason: forgot jholder :)

  7. #7
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Don't know if you saw the link in my edit, see soap txt files here: SourceForge.net Repository - [zimbra] Index of /trunk/ZimbraServer/docs
    ----
    Thread update with new command after Bug 15348 - zmprov should be able to control reindexing from the command line
    zmprov reIndexMailbox(rim) {name@domain|id} {action} [{reindex-by} {value1} [value2...]]
    Last edited by mmorse; 01-19-2008 at 05:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •