Google Analytics Import keeps getting killed, nothing in logs

I’ve been trying to get a Google Analytics import working, but it keeps getting killed just a minute or two in. I can’t find any logs that have any info as to why it’s getting killed, either, so I’m not sure what’s going wrong. I’ve tried:

  • Increasing PHP max_execution_time to 0 (no limit) on server
  • Checking “enable verbose logging” on the import itself
  • Checking the general matomo error.log (had errors, but nothing related to the import or during the import time frame)
  • Checking the import log matomo/tmp/logs/gaimportlog.59.log. It’s practically empty, this is the only line in it:
#!/usr/bin/env php

Any ideas on what could be happening? Any other logs I should be checking? Where would I find this kind of error?

Thanks for your help.

Hi there,
could you post the command you typed and the output?
also what’s the output when you type /usr/bin/env php -v ?

Hi,

Sorry for not being clearer earlier, I am using the Google Analytics Importer plugin UI, not the command line. For a few minutes the status is “ongoing,” and then it changes to “killed.” Although perhaps trying the command line would be more verbose/help figure out the problem?

Here is the output when I type that:

$ /usr/bin/env php -v
PHP 7.2.29 (cli) (built: Mar 19 2020 07:10:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with the ionCube PHP Loader + ionCube24 v10.3.9, Copyright (c) 2002-2019, by ionCube Ltd.

As an update, I tried running the import from the command line, and it actually finished! Weird. I wonder if there was a lag in adopting the new max_execution_time.

Now I at least have an error:

INFO [2020-04-16 22:59:59] 22141  Importing data for GA View [redacted] for date 2020-03-10...
INFO [2020-04-16 23:00:15] 22141  LOAD DATA INFILE failed... Error was:
  Try #1: LOAD DATA INFILE : SQLSTATE[28000]: Invalid authorization specification: 1045 Access denied for user '[redacted]'@'localhost' (using password: YES)[28000],
  Try #2: LOAD DATA LOCAL INFILE : SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with thisMariaDB version[42000]

Edit: am looking into this post: How do I get LOAD DATA INFILE to work on my server? FAQ - Analytics Platform - Matomo

Edit2: Will the import still work if I can’t get LOAD DATA INFILE to work? Looks like our hosting doesn’t allow us to edit MySQL config files.

Hi @mikky-cecil
you do need to grant your mysql user the FILE privilege.
see: Matomo Requirements User Guide - Analytics Platform - Matomo

This got it working for me.