Docker update from 1.3.x not possible

Issue #1261 resolved
simatec iobroker created an issue

Docker Container update from 1.3.x to 1.4.2 is not possible.

With the following error the container goes into an error:

sed: can't read /etc/piler/manticore.conf: No such file or directory
sed: can't read /etc/piler/manticore.conf: No such file or directory
sed: can't read /etc/piler/manticore.conf: No such file or directory
sed: can't read /etc/piler/manticore.conf: No such file or directory
sed: can't read /etc/piler/manticore.conf: No such file or directory
sed: can't read /etc/piler/manticore.conf: No such file or directory
sed: can't read /etc/piler/manticore.conf: No such file or directory

Comments (27)

  1. simatec iobroker reporter

    root@ubuntu-xxxx:/var/lib/docker/volumes/piler-docker_piler_etc/_data# ls -lah

    total 76K

    drwxr-xr-x 3 root root 4.0K Dec 18 12:34 .

    drwx-----x 3 root root 4.0K Dec 18 12:34 ..

    -rw-r--r-- 1 root 1000  379 Feb 23  2021 config-site.dist.php

    -rw-r--r-- 1 root root 2.9K Dec 18 12:34 config-site.php

    -rw-r--r-- 1 root root  762 Dec 18 12:34 config-site.php.bak

    -rw------- 1 1000 1000  111 Dec 18 12:34 .my.cnf

    -rw------- 1 1000 1000 1.2K Dec 18 12:34 piler.conf

    -rw------- 1 root root 1.2K Dec 18 12:34 piler.conf.bak

    -rw-r----- 1 root 1000 1.2K Feb 23  2021 piler.conf.dist

    -rw------- 1 1000 1000   56 Dec 18 12:34 piler.key

    -rw-r--r-- 1 root root 2.6K Dec 18 12:34 piler-nginx.conf

    -rw-r--r-- 1 root root 2.5K Feb 23  2021 piler-nginx.conf.dist

    -rw------- 1 1000 1000 5.2K Dec 18 12:34 piler.pem

    drwxr-xr-x 2 1000 1000 4.0K Dec 18 12:34 sites

    -rwxr-xr-x 1 root root 7.4K Dec 18 12:34 sphinx.conf

    -rwxr-xr-x 1 root 1000 7.4K Feb 23  2021 sphinx.conf.dist

  2. Janos SUTO repo owner

    You are right. I recommend you to create your dockerfile featuring sphinxsearch. The 1.4.2 tagged image now defaults to manticore.

  3. simatec iobroker reporter

    Is it not possible to upgrade from 1.3.x here and switch to manticore on upgrade?

  4. Janos SUTO repo owner

    I don’t follow these 2 updates. The current 1.4.2 image ships manticore and is wired to use it. You already have the index data managed by sphinx, so it makes sense to keep using it. To do that you need a different dockerfile that ships with sphinxsearch. If you decided to switch from sphinx to manticore, then you can use the 1.4.2 image as it is, just be sure to get manticore.conf, and reindex everything.

  5. simatec iobroker reporter

    What would be the best way to backup all data from 1.3.12, completely rebuild the container with 1.4.2 and import the backed up data from 1.3.12 again.

    I think it eight in the long run no sense to pursue Sphinx further.

    Can you please explain how I get the data imported?

  6. Janos SUTO repo owner

    In this case you may use the current 1.4.2 image. Create /etc/piler/manticore.conf file. Stop sphinxsearch. Create the initial index files using su -c ‘/usr/bin/indexer --all --config /etc/piler/manticore.conf' piler. Start manticore searchd, then reindex everything. It’s wise to create backups of the 2 piler related volumes.

  7. simatec iobroker reporter

    I don't quite understand how to implement this.
    Currently running 1.3.12 in Docker.
    An update is not possible, because the 1.4.2 does not start afterwards.

    I would like to backup all data from the 1.3.12 container and then delete the container.
    I also want to delete all volumes and then completely rebuild the 1.4.2.

    What data do I need to backup in the volumes so that no archived mails are lost and what is the best way to backup for this?

  8. simatec iobroker reporter

    After the container update from 1.3.12 to 1.4.2 I also tried to create a manticore.conf.

    Here is the Log from the crash when starting the container

    piler              | Database
    piler              | information_schema
    piler              | piler
    piler              | DEBUG: mysql is ready
    piler              | rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
    piler              | rsyslogd: activation of module imklog failed [v8.2112.0 try https://www.rsyslog.com/e/2145 ]
    piler              |  * Starting periodic command scheduler cron
    piler              |    ...done.
    piler              |  * Starting nginx nginx
    piler              |    ...done.
    piler              | DEBUG: main1.spp does not exist, creating index files
    piler              | Manticore 5.0.2 348514c86@220530 dev (columnar 1.15.4 2fef34e@220522) (secondary 1.15.4 2fef34e@220522)
    piler              | Copyright (c) 2001-2016, Andrew Aksyonoff
    piler              | Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
    piler              | Copyright (c) 2017-2022, Manticore Software LTD (https://manticoresearch.com)
    piler              | 
    piler              | using config file '/etc/piler/manticore.conf'...
    piler              | indexing index 'main1'...
    piler              | FATAL: failed to open /var/piler/manticore/main1.spl: No such file or directory, will not index. Try --rotate option.
    piler exited with code 1
    

    The manticore.conf and the file MANTICORE I created manually and inserted the content according to the source code.
    Shouldn't the creation of the files be done when creating the container?

    Maybe you can fix something here with a version 1.4.3, so that the files are created correctly.

    Even with an update from 1.3.12 this should not be a problem in a Conatiner or. The volumes exit already all and existing files could be patched with the container start automatically.

  9. Janos SUTO repo owner

    No need to fix 1.4.2, you need to create /var/piler/manticore dir on the volume manually (pay attention to ownership and permissions). Then try again.

  10. simatec iobroker reporter

    And the other Error with rsyslogd?

    piler              | rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
    piler              | rsyslogd: activation of module imklog failed [v8.2112.0 try https://www.rsyslog.com/e/2145 ]
    

  11. simatec iobroker reporter

    I have now tested the following:

    • manticore.conf created in etc
    • MANTICORE created in etc
    • manticore directory created in var

    The container starts, but the webinterface is not reachable (404 Not Found)

    What else can I do?

    Enclosed the log

    piler            | Database
    piler            | information_schema
    piler            | piler
    piler            | DEBUG: mysql is ready
    piler            | DEBUG: metadata table exists
    piler            | rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
    piler            | rsyslogd: activation of module imklog failed [v8.2112.0 try https://www.rsyslog.com/e/2145 ]
    piler            |  * Starting periodic command scheduler cron
    piler            |    ...done.
    piler            |  * Starting nginx nginx
    piler            |    ...done.
    piler            | starting searchd . . .
    piler            | [Mon Dec 19 08:24:17.667 2022] [57] using config file '/etc/piler/manticore.conf' (10645 chars)...
    piler            | Manticore 5.0.2 348514c86@220530 dev (columnar 1.15.4 2fef34e@220522) (secondary 1.15.4 2fef34e@220522)
    piler            | Copyright (c) 2001-2016, Andrew Aksyonoff
    piler            | Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
    piler            | Copyright (c) 2017-2022, Manticore Software LTD (https://manticoresearch.com)
    piler            |
    piler            | starting daemon version '5.0.2 348514c86@220530 dev (columnar 1.15.4 2fef34e@220522) (secondary 1.15.4 2fef34e@220522)' ...
    piler            | listening on 127.0.0.1:9312 for sphinx and http(s)
    piler            | listening on 127.0.0.1:9306 for mysql
    piler            | Manticore 5.0.2 348514c86@220530 dev (columnar 1.15.4 2fef34e@220522) (secondary 1.15.4 2fef34e@220522)
    piler            | Copyright (c) 2001-2016, Andrew Aksyonoff
    piler            | Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
    piler            | Copyright (c) 2017-2022, Manticore Software LTD (https://manticoresearch.com)
    piler            |
    piler            | precaching index 'main1'
    piler            | precaching index 'main2'
    piler            | precaching index 'main3'
    piler            | precaching index 'main4'
    piler            | precaching index 'dailydelta1'
    piler            | precaching index 'delta1'
    piler            | precaching index 'tag1'
    piler            | precaching index 'note1'
    piler            | Manticore 5.0.2 348514c86@220530 dev (columnar 1.15.4 2fef34e@220522) (secondary 1.15.4 2fef34e@220522)
    piler            | Copyright (c) 2001-2016, Andrew Aksyonoff
    piler            | Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
    piler            | Copyright (c) 2017-2022, Manticore Software LTD (https://manticoresearch.com)
    piler            |
    piler            | starting piler-smtp . . .
    piler            | starting piler . . .
    

  12. simatec iobroker reporter

    I have now found a solution.
    Not nice, but this way I could update the container

    docker-compose down
    
    rm -rf /var/lib/docker/volumes/piler-docker_piler_var/_data/www
    mkdir -p /var/lib/docker/volumes/piler-docker_piler_var/_data/manticore
    chown 1000:1000 /var/lib/docker/volumes/piler-docker_piler_var/_data/manticore
    
    docker volume rm piler-docker_piler_etc
    docker-compose up --force-recreate --build -d
    

    Furthermore I created a volume for "/var/lib/www" and restored the user settings in etc after the upgrade

    It would be awesome if you could make an update to the Docker container that takes these things into account during the build.

    As it currently is with the 1.4.2, no one gets a container update to run

  13. simatec iobroker reporter

    I would even go so far with the volumes that all data such as store etc. is packed into its own volumes.

    Think that increases the data security during upgrades.
    So you can quickly delete a volume and recreate it with a build.

  14. simatec iobroker reporter

    Don't other directories in /var/piler need to be persistent?

    What about the imap, manticore, sphinx, and stat directories?
    Won't data be lost there on a reboot?

    root@ubuntu-22-test:/var/lib/docker/volumes/piler-docker_piler_var/_data# ls -lah
    total 40K
    drwxr-xr-x 10 root root 4.0K Dec 20 13:34 .
    drwx-----x  3 root root 4.0K Dec 20 10:53 ..
    drwx--x--x  2 1000 1000 4.0K Feb 23  2021 error
    drwx------  2 1000 1000 4.0K Feb 23  2021 imap
    drwxr-xr-x  2 1000 1000 4.0K Dec 20 15:35 manticore
    drwx------  2 1000 1000 4.0K Dec 20 10:53 sphinx
    drwxr-xr-x  2 1000 1000 4.0K Dec 20 11:05 stat
    drwx------  3 1000 1000 4.0K Dec 20 10:53 store
    drwx--x--x  4 1000 1000 4.0K Dec 20 10:53 tmp
    drwxr-xr-x  2 root root 4.0K Dec 20 13:34 www
    

  15. simatec iobroker reporter

    Also in "/etc/piler" the question would be if you need the complete folder persistent, or maybe you just create volumes for single config files?

    I think the less you bind in persistent directories, the less problems arise with updates

  16. Janos SUTO repo owner

    You are right. The manticore dir should be persistent as well. The error dir holds received, but failed to processed emails. The tmp dir contains temp files waiting to be processed.

  17. simatec iobroker reporter

    My approach would be to create the following volumes to make the container flexible for future update.

    for var/piler:

    imap ???
    manticore
    stat ???
    store
    

    and for /etc/piler only files on a Volume

    config-site.php
    manticore.conf
    .my.cnf ???
    piler.conf
    

    What do you think about this? Did I forget something that also needs to be persistent?
    Or do I have possibly too much in it?

  18. Leszek Piatek

    I think also nginx, cron and other services should be separate containers and run with compose + there should be an example docker-compose.yml - @Janos SUTO I’ll try to make an PR…

  19. Janos SUTO repo owner

    The docker stuff in the source tree is meant as a starting point, a guideline how to run piler in a container. I’m not sure why you want to move the cron stuff to a dedicated container, I’d rather move manticore and the related cron scripts to a separate container. Anyway, feel free to optimize it to your needs.

  20. Leszek Piatek

    Hm… support for bind-mount volumes also is broken - as I can see You are assuming that volume is copied what is not the case with bind-mount’ed volumes.

  21. Janos SUTO repo owner

    The /var/piler/store and /var/piler/manticore dirs are empty, so you should be able to bind mount them just fine.

  22. Log in to comment