Unable to export the mails with pilerexport command.
In our environment we had version (piler 1.4.4, build 1001) with master branch package installed. We tried to export particular date mail for the particular user from cli with the below command. But we can’t export the mails and in mail log we got the below error. Please assist us to fix this error.
COMMAND: pilerexport --start-date 2023.07.27 --stop-date 2023.07.27 -f testuser1@example.com
ERROR: pilerexport[2277]: 500000006513b4251809a5fc003d38613896: error: mysql_stmt_prepare() Unknown column 'attachments' in 'field list' => sql: SELECT DISTINCT id
, piler_id
, digest
, bodydigest
, attachments
FROM v_messages WHERE deleted=0 AND from
IN ('testuser1@example.com') AND sent
>= 1690396200 AND sent
<= 1690482599 ORDER BY id ASC
Comments (5)
-
repo owner -
reporter I am checked in v_messages view has no attachment column, So i dropped the v_messages view. And i tried to recreate with the following command after i entered the password and i got the below mentioned error. We missing anything please let us know.
Drop Query: MariaDB [piler]> DROP VIEW v_messages;
Recreate command: mysql -u piler -p piler < /var/mailpiler_packages/piler_master_branch/jsuto-piler-73e56cd16213/util/db-mysql.sqlError: ERROR 1061 (42000) at line 51: Duplicate key name 'metadata_idx'
-
repo owner This is not what I asked. Run only the v_messages creating sql statement.
-
repo owner - changed status to closed
-
reporter Sorry for the misunderstanding and i got the query for recreate the v_messages view from db-mysql.sql and execute it. And now am able to export the particular date mail for the particular user from cli. Thanks for your assistance.
- Log in to comment
Check if the v_message view has the attachments column. If not, then drop it, and recreate it with the template in util/db-mysql.sql