LOAD DATA INFILE can't stat file

I have one site that consistently fails the archival job with the following error:

INFO Actions[2019-10-28 18:04:34 UTC] [7727] LOAD DATA INFILE failed... Error was:
INFO Actions[2019-10-28 18:04:34 UTC] [7727] Try #1: LOAD DATA INFILE : SQLSTATE[HY000]: General error: 13 Can't get stat of '/var/www/piwik/tmp/assets/archive_blob_2019_09-43d1f15f47e402e01ce0226405667761.csv' (Errcode: 2 "No such file or directory"),
INFO Actions[2019-10-28 18:04:34 UTC] [7727] Try #2: LOAD DATA LOCAL INFILE : SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server during query
ERROR API[2019-10-28 18:04:34 UTC] [7727] Uncaught exception in API: /var/www/piwik/core/ArchiveProcessor/PluginsArchiver.php(185): SQLSTATE[HY000]: General error: 2006 MySQL server has gone away - in plugin Actions

The DB user has FILE permission and the database settings are as follows:

wait_timeout: 28800
innodb_log_file_size: 50331648
max_allowed_packet: 1073741824

Thanks in advance for any help. Let me know what other information I can provide.

Hello, what version of mysql are you using?

what version of mysql are you using?

MariaDB 10.1.21 with galera cluster.

Hi there,

I hope you’re doing fine!

Same issue here:
mysqld log file is full of this error in various moments.

2020-04-24 10:03:41 root[root] @ localhost [127.0.0.1] ERROR 13: Can't get stat of '/var/www/html/anly/tmp/assets/matomo_archive_blob_2020_04-1aeb3e2cdbf5d7c51a6a7f3ae915e4f1.csv' (Errcode: 13 "Permission denied") : LOAD DATA INFILE
                                '/var/www/html/anly/tmp/assets/matomo_archive_blob_2020_04-1aeb3e2cdbf5d7c51a6a7f3ae915e4f1.csv'
                        REPLACE
                        INTO TABLE
                                `matomo_archive_blob_2020_04` CHARACTER SET latin1
                        FIELDS TERMINATED BY
                                '       '
                        ENCLOSED BY
                                '"'
                 ESCAPED BY '\\'
                        LINES TERMINATED BY
                                '
'
                        (idarchive,idsite,date1,date2,period,ts_archived,name,value)

Details:

[root@anly mysql]# uname -a
Linux anly 4.20.9-desktop-1.mga7 #1 SMP Fri Feb 15 08:03:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@anly mysql]# cat /etc/issue
Mageia release 7 (Cauldron) for x86_64
Kernel 4.20.9-desktop-1.mga7 on a Dual-processor x86_64 / \l
[root@anly mysql]# mysql -V
mysql Ver 15.1 Distrib 10.3.12-MariaDB, for Linux (x86_64) using readline 5.1
[root@anly mysql]# grep VERSION /var/www/html/anly/core/Version.php
const VERSION = ‘3.13.4’;
[root@anly mysql]#

What do you recommend?