Bulk Restore does nothing - Error 500

Issue #909 resolved
John Michael created an issue

Hello,

First, I apologize.. I cannot figure out how to set the assignee....

I am having an issue where bulk restore [only] does not work. I'm not sure what information to post here other than the page returns a 500 error. I used Fiddler to see what was going on, but it did not seem to give me back useful results. It seemed as though the sphinx query was showing results, but then when I selected the Bulk Restore function, the email ID's were not sent to the Piler application itself to then process the emails and create the zip to give me.

Let me know what further information you need or what config files you would like to see!

Thank you in advance, John Michael

P.S. I'm not sure if I would call this a bug, since I'm wondering if it may just a be a missing or misconfigured setting, but it is definitely troublesome issue for us due to the fact that average users/management are not able to get large numbers of related emails without command-line interaction, which they are not capable of, so it requires me to be present/at-work (using the pilerexport function, zipping, transferring).

Piler Info: piler 1.3.4, build 994, Janos SUTO sj@acts.hu

Build Date: Tue May 8 11:07:00 CDT 2018 ldd version: ldd (Debian GLIBC 2.24-11+deb9u3) 2.24 gcc version: gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) OS: Linux hostname 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1 (2018-04-29) x86_64 GNU/Linux Configure command: ./configure --localstatedir=/var --with-database=mysql --enable-tcpwrappers MySQL client library version: 10.1.26-MariaDB

Comments (11)

  1. John Michael reporter

    There is nothing out of the ordinary in /var/logs/mail.* (any of them). Are the logs under apache2 the same as "the php logs"? I'm not very familiar with working with the php logging. Anyway, this is the inside of its error log when using grep bulk:

    # scrubbed web address
    [Tue May 08 13:16:58.337271 2018] [:error] [pid 1019] [client 10.11.0.58:65227] PHP Fatal error:  Uncaught Error: Class 'ZipArchive' not found in /var/www/piler/model/message/restore.php:9\nStack trace:\n#0 /var/www/piler/controller/message/bulkrestore.php(38): ModelMessageRestore->download_files_as_zip(Array)\n#1 /var/www/piler/system/front.php(36): ControllerMessageBulkrestore->index()\n#2 /var/www/piler/system/front.php(14): Front->execute(NULL)\n#3 /var/www/piler/index.php(113): Front->dispatch(Object(Router), Object(Router))\n#4 {main}\n  thrown in /var/www/piler/model/message/restore.php on line 9, referer: https://localhost.com/
    [Tue May 08 13:50:57.956077 2018] [:error] [pid 1051] [client 10.11.0.58:49783] PHP Fatal error:  Uncaught Error: Class 'ZipArchive' not found in /var/www/piler/model/message/restore.php:9\nStack trace:\n#0 /var/www/piler/controller/message/bulkrestore.php(38): ModelMessageRestore->download_files_as_zip(Array)\n#1 /var/www/piler/system/front.php(36): ControllerMessageBulkrestore->index()\n#2 /var/www/piler/system/front.php(14): Front->execute(NULL)\n#3 /var/www/piler/index.php(113): Front->dispatch(Object(Router), Object(Router))\n#4 {main}\n  thrown in /var/www/piler/model/message/restore.php on line 9, referer: https://localhost/search.php
    [Tue May 08 13:54:33.926396 2018] [:error] [pid 1174] [client 10.11.0.58:49890] PHP Fatal error:  Uncaught Error: Class 'ZipArchive' not found in /var/www/piler/model/message/restore.php:9\nStack trace:\n#0 /var/www/piler/controller/message/bulkrestore.php(38): ModelMessageRestore->download_files_as_zip(Array)\n#1 /var/www/piler/system/front.php(36): ControllerMessageBulkrestore->index()\n#2 /var/www/piler/system/front.php(14): Front->execute(NULL)\n#3 /var/www/piler/index.php(113): Front->dispatch(Object(Router), Object(Router))\n#4 {main}\n  thrown in /var/www/piler/model/message/restore.php on line 9, referer: https://localhost.com/search.php
    

    Thank you for your timely response! JMV

  2. Janos SUTO repo owner

    You have to install the php7-zip package, and you should be fine. Btw. thanks for using the format option :-)

  3. John Michael reporter

    Ha! Of course... it bothers me when I see unformatted code/logs lol

    So, that worked! You are the MAN. I am going to mark this as resolved, but one hopefully quick question: Is there a way to use this Bulk Restore feature on ALL emails from the search instead of having to click through each page of 50 and bulk downloading? I've searched around, but found minimal discussion and no solid answer or solution.

    Thanks again! John Michael

  4. Janos SUTO repo owner

    In theory you may bulk restore or bulk download all of the search hits. However, what if you have several thousands of emails? It would take too long to complete, and may need too much resources to do so. So I've limited this option to the current page only.

    However, you may use pilerexport to perform a similar search and retrieve all matching emails to the current directory. Then you may send them to the appropriate user.

  5. John Michael reporter

    Sure that makes sense!

    pilerexport is how I retrieved the emails yesterday, but I noticed that the output titled all of the emails using the email-id rather than the nice-and-neat Message Subject naming that is used for the Bulk Restore. Am i missing a command/switch/option on the pilerexport command?

    Last question for here:

    How can you run pilerexport and have the output name all of the emails with Subject?

  6. Janos SUTO repo owner

    No, pilerexport still uses the numeric id as the filename. Your version of piler should support the -w option. You may type the exact same search query what you enter in the gui, eg. pilerexport -w 'subject: something'

  7. Log in to comment