docker icon indicating copy to clipboard operation
docker copied to clipboard

The 4.8.0 tag image seems still running a 4.7.1 version of matomo

Open idrissneumann opened this issue 2 years ago • 6 comments

Hi.

I upgraded the docker images we're running for our on premise instance from 4.7.1 to 4.8.0 :

Screenshot 2022-03-18 at 08 32 10

However, the web application seems still running on the 4.7.1 version:

Screenshot 2022-03-18 at 08 31 44

Of course, this has been tested on a private navigation window.

I also inspect inside the container:

Screenshot 2022-03-18 at 08 40 04

Thanks in advance.

idrissneumann avatar Mar 18 '22 07:03 idrissneumann

This is because the /var/www/html is a volume in order to keep the config.ini.php. I'll try to remove this volume and make a template of the config.ini.php file injected at every deployments in order to make this image as stateless as possible. It would be more "cloud native friendly" if it was an image with environment variables based config.

idrissneumann avatar Mar 18 '22 08:03 idrissneumann

So here's my workaround :

1/ Do not mount /var/www/html as a volume

2/ Templatise your config.php.ini and inject it in the container newly created with a volume (the path inside the container: /var/www/html/config/config.php.ini).

With that you'll be able to consider your container as "stateless" and evict and recreate it.

Here you'll find an example of template and injection of this file as a volume with this ansible role: https://gitlab.comwork.io/oss/ansible-iac/ansible-matomo

On K8S, you can achieve the same thing with a configmap.

I'll let this issue open if you want to use it for create "cloud native friendly" and stateless images with only environment variables to configure. But no problem if you prefer to close it and move on to something else, it's not a critical issue at all :)

Thanks

idrissneumann avatar Mar 18 '22 09:03 idrissneumann

It is good to know that there is a workaround! But I would like to know how the "official" way is to deal with this; e.g. the way how the developers of Matomo get rid of these false upgrade notifications in the web application.

Maybe by doing an additional upgrade in the web application after updating the image and container? Or just ignoring the false upgrade notification in the web application (that's what I do at the moment)?

Would be nice to know how this is originally meant to be done!

ontheair81 avatar Apr 05 '22 05:04 ontheair81

See related https://github.com/matomo-org/docker/issues/161 Just experienced the same thing! Upgraded the image, restarted the container, and still on the old version, because the mounted /var/www/html/ hasn't updated at all.

There needs to be a check on start up to copy the files over or so! (without replacing important things in the state, like config.ini.php)

ghnp5 avatar Apr 14 '22 07:04 ghnp5

So I just wipe the /var/ww/html on upgrade postactions and overwrite config.ini.php

Does it sounds enough to you ?

freechelmi avatar Apr 14 '22 14:04 freechelmi

What I did was:

  1. upgrade Docker image
  2. restart
  3. upgrade through the Matomo dashboard (from the button at the top that says there's a new version)

ghnp5 avatar Apr 14 '22 16:04 ghnp5

duplicate of https://github.com/matomo-org/docker/issues/248

J0WI avatar Nov 26 '22 14:11 J0WI