mail-server icon indicating copy to clipboard operation
mail-server copied to clipboard

[bug]: export for upgrade from 0.7.3 to 8.0 failes / docker

Open PaddyPat opened this issue 9 months ago • 5 comments

What happened?

hi,

I'm testing Stalwart 0.73 via docker compose and would like to export mail / mailboxes to upgrade to 0.8.0.

Sometimes in your documentation the command should be for export "stalwart-cli" or "stalwart-mail".

Via stalwart-cli I can export the mailbox (looks fine - no export issues) but I cant export default stalwart-mail settings (domain,...)

The issues exist in in stalwart 073 and 080 (after new manual configuration)

After multiple export commands the core file is sometimes larger but the export files are only 0bytes)

root@21977290380d:/opt/stalwart-mail# stalwart-mail --config etc/config.toml --export /export/mail Failed to iterate over data store: Internal Error: No store configured Exporting database to /export/mail/property. Exporting database to /export/mail/fts_index. Failed to iterate over data store: Internal Error: No store configured Segmentation fault (core dumped)

root@21977290380d:/opt/stalwart-mail# stalwart-mail --config etc/config.toml --export /export/mail Failed to iterate over data storeExporting database to /export/mail/property. : Internal Error: No store configured Failed to create backup file: Permission denied (os error 13) Segmentation fault (core dumped)

root@21977290380d:/opt/stalwart-mail# stalwart-mail --config etc/config.toml --export /export/mail Failed to iterate over data store: Internal Error: No store configured Failed to iterate over data store: Internal Error: No store configured Failed to iterate over data store: Internal Error: No store configured Exporting database to /export/mail/acl. Exporting database to /export/mail/property. Exporting database to /export/mail/fts_index. Exporting database to /export/mail/blob. Failed to iterate over data store: Internal Error: No store configured Segmentation fault (core dumped)

root@21977290380d:/opt/stalwart-mail# stalwart-mail --config etc/config.toml --export /export/mail Failed to iterate over data store: Internal Error: No store configured Exporting database to /export/mail/property. Failed to iterate over data store: Internal Error: No store configured Segmentation fault (core dumped)

root@21977290380d:/opt/stalwart-mail# exit

Any hint for me?

thanks

How can we reproduce the problem?

I can reproduce the problem by doing the following steps:

Version

v0.7.x

What database are you using?

RocksDB

What blob storage are you using?

RocksDB

Where is your directory located?

Internal

What operating system are you using?

Docker

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

PaddyPat avatar May 14 '24 18:05 PaddyPat

Hi,

It looks like Stalwart is not being able to read your configuration file. Try using the full path instead.

mdecimus avatar May 15 '24 09:05 mdecimus

Sure, same issue with full path.

It creates the core file sometimes with 100 megabytes , sometimes wir 110 mb and the other files are created with 0bytes.

with stalwart-cli it creates mailbox backup files…

and I must execute the commands inside docker because your commands from upgrade.md doesn’t work in my environment:

$ docker stop stalwart-mail (works) $ docker run --rm -it stalwart-mail /opt/stalwart-mail/bin/stalwart-mail --config /opt/stalwart-mail/etc/config.toml --export /opt/stalwart-mail/export (doesn’t work, I must jump inside running docker and I can write files to export path inside docker (stalwart-cli create mailbox files in same folder)

PaddyPat avatar May 15 '24 13:05 PaddyPat

Same here. Can't export mail-server config.

tmeidinger avatar May 15 '24 14:05 tmeidinger

Sorry, just realized that the upgrading instructions are not mounting the data volume. You need to add the -v <STALWART_DIR>:/opt/stalwart-mail parameter to the docker run command.

mdecimus avatar May 15 '24 14:05 mdecimus

stalwart-mail

root@0303000f69fd:/opt/stalwart-mail# stalwart-mail --config /opt/stalwart-mail/etc/config.toml --export /export/ Exporting database to /export/property. Exporting database to /export/term_index. Failed to iterate over data store: Exporting database to /export/acl. Internal Error: No store configured Exporting database to /export/blob. Exporting database to /export/config. Exporting database to /export/queue. Exporting database to /export/directory.

--

root@0303000f69fd:/export# ls -la total 8 drwxr-xr-x 2 root root 4096 May 15 19:46 . drwxr-xr-x 1 root root 4096 May 15 19:35 .. -rw-r--r-- 1 root root 0 May 15 19:46 acl -rw-r--r-- 1 root root 0 May 15 19:46 blob -rw-r--r-- 1 root root 0 May 15 19:46 config -rw-r--r-- 1 root root 0 May 15 19:46 directory -rw-r--r-- 1 root root 0 May 15 19:46 property -rw-r--r-- 1 root root 0 May 15 19:46 queue -rw-r--r-- 1 root root 0 May 15 19:46 term_index


stalwart-cli

root@0303000f69fd:/export# stalwart-cli export account mailbox /export/ Exported 8 mailboxes. Exported 40 emails. Exported 1 sieve scripts. Exported 3 identities. Exported 0 vacation responses. Exporting 41 blobs...

root@0303000f69fd:/export/mailbox# ls -la total 40 drwxr-xr-x 3 root root 4096 May 15 19:48 . drwxr-xr-x 3 root root 4096 May 15 19:48 .. drwxr-xr-x 2 root root 4096 May 15 19:48 blobs -rw-r--r-- 1 root root 9726 May 15 19:48 emails.json -rw-r--r-- 1 root root 339 May 15 19:48 identities.json -rw-r--r-- 1 root root 757 May 15 19:48 mailboxes.json -rw-r--r-- 1 root root 120 May 15 19:48 sieve.json -rw-r--r-- 1 root root 2 May 15 19:48 vacation.json

PaddyPat avatar May 15 '24 19:05 PaddyPat

I've got the same problems here.

chrisb86 avatar May 16 '24 09:05 chrisb86

Same problem here

ENgraver666 avatar May 16 '24 14:05 ENgraver666

The upgrading instructions were missing the argument to mount the volume, try this:

$ docker stop stalwart-mail
$ docker run --rm -v <STALWART_DIR>:/opt/stalwart-mail -it stalwart-mail /opt/stalwart-mail/bin/stalwart-mail --config /opt/stalwart-mail/etc/config.toml --export /opt/stalwart-mail/export

mdecimus avatar May 16 '24 15:05 mdecimus

try:

sudo docker stop stalwart-mail sudo docker run --rm -v <STALWART_DIR>:/opt/stalwart-mail -it --entrypoint /usr/local/bin/stalwart-mail stalwartlabs/mail-server:v0.7.3 --config /opt/stalwart-mail/etc/config.toml --export /opt/stalwart-mail/export

tmeidinger avatar May 16 '24 15:05 tmeidinger

That did it for me. Thank you. In the upgrade documentation the import command for docker also uses --export. This should be corrected. These both commands now worked for me:

export:

docker run --rm -v <STALWART_DIR>:/opt/stalwart-mail -it --entrypoint /usr/local/bin/stalwart-mail stalwartlabs/mail-server:v0.7.3 --config /opt/stalwart-mail/etc/config.toml --export /opt/stalwart-mail/export

import:

docker run --rm -v <STALWART_DIR>:/opt/stalwart-mail -it --entrypoint /usr/local/bin/stalwart-mail stalwartlabs/mail-server:v0.8.0 --config /opt/stalwart-mail/etc/config.toml --import /opt/stalwart-mail/export

ENgraver666 avatar May 16 '24 16:05 ENgraver666

Thanks all for your help! <3

PaddyPat avatar May 16 '24 17:05 PaddyPat

My current version is 0.7.3, and I did the following to upgrade to 0.8.1. Thanks @tmeidinger and @ENgraver666 for the command lines. I did it on Unraid. The upgrade guide should be updated accordingly.

exporting

docker run --rm -v /mnt/user/appdata/stalwart-mail:/opt/stalwart-mail -it --entrypoint /usr/local/bin/stalwart-mail stalwartlabs/mail-server:v0.7.3 --config /opt/stalwart-mail/etc/config.toml --export /opt/stalwart-mail/export
Unable to find image 'stalwartlabs/mail-server:v0.7.3' locally
v0.7.3: Pulling from stalwartlabs/mail-server
Digest: sha256:6650bffb43504664f67f842ea48aeffdee5cd1a7b0376441c30d1f2e8899a50b
Status: Downloaded newer image for stalwartlabs/mail-server:v0.7.3
Exporting database to /opt/stalwart-mail/export/blob.
Exporting database to /opt/stalwart-mail/export/lookup.
Exporting database to /opt/stalwart-mail/export/config.
Exporting database to /opt/stalwart-mail/export/property.
Exporting database to /opt/stalwart-mail/export/acl.
Exporting database to /opt/stalwart-mail/export/term_index.
Exporting database to /opt/stalwart-mail/export/directory.
Exporting database to /opt/stalwart-mail/export/queue.
Exporting database to /opt/stalwart-mail/export/index.
Exporting database to /opt/stalwart-mail/export/bitmap.
Exporting database to /opt/stalwart-mail/export/log.

importing

docker run --rm -v /mnt/user/appdata/stalwart-mail:/opt/stalwart-mail -it --entrypoint /usr/local/bin/stalwart-mail stalwartlabs/mail-server:v0.8.1 --config /opt/stalwart-mail/etc/config.toml --import /opt/stalwart-mail/export
Unable to find image 'stalwartlabs/mail-server:v0.8.1' locally
v0.8.1: Pulling from stalwartlabs/mail-server
b0a0cf830b12: Already exists
e7741b3e31cf: Pull complete
ca012f610cab: Pull complete
72ea5dddf2ad: Pull complete
433d9b7a183b: Pull complete
a3f1fd9b7eff: Pull complete
e5ebef8c05da: Pull complete
Digest: sha256:9c8e436ad655dd5ade2d1a76bbfba166b93aed9f26c1e510d6ac1043ec7ae331
Status: Downloaded newer image for stalwartlabs/mail-server:v0.8.1
Importing database dump from /opt/stalwart-mail/export/blob.
Importing database dump from /opt/stalwart-mail/export/term_index.
Importing database dump from /opt/stalwart-mail/export/lookup.
Importing database dump from /opt/stalwart-mail/export/property.
Importing database dump from /opt/stalwart-mail/export/config.
Importing database dump from /opt/stalwart-mail/export/acl.
Importing database dump from /opt/stalwart-mail/export/directory.
Importing database dump from /opt/stalwart-mail/export/queue.
Importing database dump from /opt/stalwart-mail/export/index.
Importing database dump from /opt/stalwart-mail/export/bitmap.
Importing database dump from /opt/stalwart-mail/export/log.

europacafe avatar May 24 '24 02:05 europacafe