Help with warning messages in new server

Hi people, I’m new at this world of Matomo, and I wish you could help me with some messages that I can’t mark as green
In my admin area in the check system (sorry, I figure out what the English text is, because I set the language in Spanish) I get

  • Required Private Directories (My server uses apache, and the .htaccess files seems to be ok, I also tried this solution, but didn’t work, so I don’t know what else to do)
  • Setup Cron (faster report loading) (I followed the tutorial in this link but now this message remains and just got the new one below)
  • Browser and Auto-archiving enabled
  • Database capabilities (when I hover the cursor, the pop up shows “UTF8mb4 charset”, I have no idea what’s wrong with that or how to fix it)

More details about my server are:
Matomo: 4.3.1
MySQL: 8.0.25-0ubuntu0.21.04.1
PHP: 7.4.16

Thank you in advance for any help

Hi,

Some Matomo files should not be public to everyone on the internet. Because of this Matomo generates .htaccess files so your webserver denies access. You can check if the files are protected by accessing the URLs in the browser.
If the protection doesn’t work, then you might have set up Apache to not respect .htaccess files. I don’t know Apache at all, but I think the solution has to do with AllowOverride All (Required Private Directories - #12 by kdmail001).

Have you checked if the cronjob actually runs successfully. Maybe run the command once and look at the output (or check the file where you redirect the output to /home/example/matomo-archive.log)

Once you have fixed the above and the cronjob generates the reports correctly, you can disable browser-archiving so that Matomo doesn’t generate reports when you access them, but only displays the ones generated by the last cronjob run.
This can speed up Matomo by a lot

I assume you used Matomo before Matomo 4 and upgraded later.
In Matomo 3, the database tables were stored in MySQL using what MySQL calls utf8, but is in practice a broken subset of UTF-8 that e.g. doesn’t allow storing emoji. So in Matomo 4, now utf8mb is used, which works correctly.
But the conversion can take a long time for huge databases, so it is something you need to start manually. You can look at https://matomo.org/faq/how-to-update/how-to-convert-the-database-to-utf8mb4-charset/ for more information about this.

Thank you for your prompt response!!

Well, there was a file that I didn’t expected, there was a -le-ssl.conf file in my /etc/apache2/sites-available and I added

<Directory "/var/www/html/">
AllowOverride All
</Directory>

Inside the VirtualHost section, reloaded apache and the message was gone. Also the files are now out of reach using the browser… something tricky just in case anyone has the same issue

About this one. Yes, the cron is active and running. If I run it manually it writes a log without errors; but the message is still there in the admin area

I thought I would check this once the previous message was checked; but guess what… if you disable it in the general settings, both messages would be gone!! (Well, because there are indeed a cron working, so I think they are crashing each other while the system was checking itself, if you take away one, there won’t be warnings)

Well, no, it is a fresh server, never used before, and I didn’t write the tracking script in the website code until the process was completed. I checked the log of commands and I used the most recent version from the beginning

cd /var/www/html && wget https://builds.piwik.org/piwik.zip && unzip /var/www/html/piwik.zip

By the way, if I follow your link, and I run the command, I get a message

Command “core:convert-to-utf8mb4” is not defined.

According with the FAQ it is due to

(Note: if the command returns then your database should already be using utf8mb4 and you don’t need to run the command.)

I don’t know if this message is worthy to worry about, since all of the rest are gone. What do you suggest @Lukas?

Hi,

The first one seems like the exact solution that was needed here.

Honestly I have no explanation for the second and third one (I thought it would check if any cronjob ran successfully recently, but am not sure)

For the last one maybe I misinterpreted the error message. Could you post the exact error message (I don’t mind if it is in Spanish).

utf8mb4
Thank you for your help, this is the message that I have in my admin panel

Can you try to go to the detailed system check page? There the error message should be more detailed.

I don’t understand this message, the user has full granted privileges and the password is correct

Capacidades de la base de datos UTF8mb4 charset
LOAD DATA INFILE
Utilizando LOAD DATA INFILE acelerará gratamente el proceso de archivado de Matomo. Para hacerlo efectivo en Matomo, trate de actualizar su software PHP & MySQL y asegurar que el usuario de esta base de datos posea los privilegios de FILE.
Si su servidor Matomo rastrea sitios con alto tráfico (por ejemplo: > 100,000 páginas por mes), recomendamos que trate de arreglar este problema.
Error: LOAD DATA INFILE failed… Error was:
Try #1: LOAD DATA INFILE : SQLSTATE[28000]: Invalid authorization specification: 1045 Access denied for user ‘matomouser’@‘localhost’ (using password: YES)[28000],
Try #2: LOAD DATA LOCAL INFILE : SQLSTATE[42000]: Syntax error or access violation: 3948 Loading local data is disabled; this must be enabled on both the client and server sides[42000]
Troubleshooting: FAQ on matomo.org
CREATE TEMPORARY TABLES
Changing transaction isolation level

Hi,

This is a different “issue” than the one I thought before (utf8mb):

Matomo is able to work a lot faster if it is able to make LOAD DATA INFILE requests in MySQL. But this needs a seperate permission that sometimes is not given to the MySQL user Matomo uses.
The 1045 Access denied for user ‘matomouser’@‘localhost’ (using password: YES)[28000], message is a bit misleading by MySQL. It’s not that there is no user with those credentials (after all Matomo wouldn’t work otherwise), but instead just that your user doesn’t have this permission.
See https://matomo.org/faq/troubleshooting/faq_194/

I couldn’t make the message get green check, but now it’s different (The text in bold has gone)
LOAD DATA INFILE
Utilizando LOAD DATA INFILE acelerará gratamente el proceso de archivado de Matomo. Para hacerlo efectivo en Matomo, trate de actualizar su software PHP & MySQL y asegurar que el usuario de esta base de datos posea los privilegios de FILE.
Si su servidor Matomo rastrea sitios con alto tráfico (por ejemplo: > 100,000 páginas por mes), recomendamos que trate de arreglar este problema.
Error: LOAD DATA INFILE failed… Error was:
Try #1: LOAD DATA INFILE : SQLSTATE[28000]: Invalid authorization specification: 1045 Access denied for user ‘matomouser’@‘localhost’ (using password: YES)[28000],
Try #2: LOAD DATA LOCAL INFILE : SQLSTATE[42000]: Syntax error or access violation: 3948 Loading local data is disabled; this must be enabled on both the client and server sides[42000]
Troubleshooting: FAQ on matomo.org

The only thing that made some success was to add the

adapter="MYSQLI"

in the config.ini.php file in the section [database]

Everything else did nothing, the last part, the most insecure according with the FAQ itself, that is

change the permission for your Mysql user to allow the user to import the files: GRANT FILE on *.* to piwik@localhost

prompted this message

ERROR 1144 (42000): Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used

Of course, I edited it to my user

Finally got it!

In file /etc/mysql/conf.d/myslq.cnf the FAQ suggested to add local-infile; but it doesn’t tell us the value, it should be this way

[mysql]
local-infile = 1
[mysqld]
local-infile = 1

And then restart with

/etc/init.d/mysql restart

Thank you @Lukas for your help in this process, everything is checked in green now

2 Likes