Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importer failing - claiming site does not exist #453

Open
edoswald opened this issue Sep 13, 2023 · 27 comments
Open

Importer failing - claiming site does not exist #453

edoswald opened this issue Sep 13, 2023 · 27 comments

Comments

@edoswald
Copy link

I cannot get the importer working, looking at logs this is what I keep getting for every site I try to import (same error, different site number)

ERROR [2023-09-12 23:58:03] 86422 Uncaught exception: /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php(331): Site ID 4 does not exist. [Query: , CLI mode: 1]

[Exception]
Site ID 4 does not exist.

Exception trace:
() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php:331
Piwik\Plugins\GoogleAnalyticsImporter\Commands\ImportGA4Reports->getIdSite() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php:81
Piwik\Plugins\GoogleAnalyticsImporter\Commands\ImportGA4Reports->executeImpl() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php:57
Piwik\Plugins\GoogleAnalyticsImporter\Commands\ImportGA4Reports->execute() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
Symfony\Component\Console\Command\Command->run() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/core/Console.php:108
Piwik\Console->originDoRun() at n/a:n/a
call_user_func() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/core/Console.php:147
Piwik\Console->Piwik{closure}() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/core/Access.php:670
Piwik\Access::doAsSuperUser() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/core/Console.php:148
Piwik\Console->doRunImpl() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/core/Console.php:87
Piwik\Console->doRun() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /var/www/vhosts/missioncontrol.ozmediaservices.com/httpdocs/matomo/console:32

googleanalyticsimporter:import-ga4-reports [--property="..."] [--dates="..."] [--idsite="..."] [--cvar-count="..."] [--skip-archiving] [--mobile-app] [--timezone="..."] [--extra-custom-dimension="..."]

@AltamashShaikh
Copy link
Contributor

@edoswald How are you trying to import the data? are you trying to pass --idsite=4 in the command ?
If you are trying to import via command, can you paste the command here ?

@edoswald
Copy link
Author

@AltamashShaikh Via the web interface.

@AltamashShaikh
Copy link
Contributor

@edoswald That's strange!, do you have idSite:4 created and do you have access to console of your Matomo instance ?
Also have you set instance_id in config.ini.php ?

@edoswald
Copy link
Author

@AltamashShaikh I don't see an instance_id, and yes, it's a self hosted install. The site ids seem to match with the ones created by the import.

@snake14
Copy link
Contributor

snake14 commented Sep 13, 2023

@edoswald What version of Matomo and the plugin do you have installed? PHP version? Do you see a row in your site table with the same idSite as the error message?

@edoswald
Copy link
Author

edoswald commented Sep 13, 2023

@snake14 sorry this should have all been in the report, my bad. Sites exist (see phpmyadmin screenshot)

From System Summary

Matomo version: 4.15.1
MySQL version: 10.6.12-MariaDB-0ubuntu0.22.04.1
PHP version: 8.2.10
Screenshot 2023-09-13 at 7 16 16 PM

@snake14
Copy link
Contributor

snake14 commented Sep 13, 2023

Thank you @edoswald. It's really odd that the site gets created, but it fails to look it up during the import process. I'm guessing that you're running the latest version of the GA Importer plugin (4.6.11)?

@edoswald
Copy link
Author

@snake14 yessir.. weird thing is i was able to import without a problem on my last server, this one fails every time.

@snake14
Copy link
Contributor

snake14 commented Sep 14, 2023

@edoswald What if you log out of Matomo and log back in? As far as I can tell, the only reason that it would fail to load the site is if it doesn't exist or if there's a permission issue.

@AltamashShaikh
Copy link
Contributor

@edoswald
Can you check if you have an entry in option table ?

SELECT * FROM `matomo_option` where option_name='GoogleAnalyticsImporter.importStatus_4'

If yes, can you run this command from /your/path/to/matomo ./console googleanalyticsimporter:import-ga4-report --idsite=4

@edoswald
Copy link
Author

image

Getting the same error

image

@edoswald
Copy link
Author

edoswald commented Sep 14, 2023

@snake14 would an ls -l command from a certain directory in the install help?

Here is everything from the option_value field

{"status":"started","idSite":4,"ga":{"import_type":"GA4","property":"properties/373493187","account":"accounts/266715688","view":""},"last_date_imported":null,"main_import_progress":null,"import_start_time":1694563083,"import_end_time":null,"last_job_start_time":1694563083,"last_day_archived":null,"import_range_start":"","import_range_end":"2023-09-11","extra_custom_dimensions":[],"days_finished_since_rate_limit":0,"reimport_ranges":[],"isGA4":true,"is_verbose_logging_enabled":true}

Server data

CPU AMD EPYC-Milan Processor (2 core(s))
Version Plesk Obsidian v18.0.53_build1800230619.12 os_Ubuntu 22.04
OS Ubuntu 22.04.3 LTS

@AltamashShaikh
Copy link
Contributor

@edoswald Does running below command creates a new site and works as expected ?

./console googleanalyticsimporter:import-ga4-report  --property="properties/373493187" --dates="2023-09-14,2023-09-11"

@edoswald
Copy link
Author

This is another error i've seen, which makes no sense. I've installed any recommended packages per installation. This might be the issue!

image

@AltamashShaikh
Copy link
Contributor

@edoswald looks like its the issue with your cli
I recommend checking with your hosting provider or try checking installed modules by running php -m command.

Closing the issue for now, feel free to open a issue if you face any other issues

@edoswald
Copy link
Author

@AltamashShaikh real quick, what modules should i ensure are activated?

@snake14
Copy link
Contributor

snake14 commented Sep 14, 2023

Hi @edoswald. The System Check gives a pretty good list of modules to check. When you're in the Matomo app, go to the gear icon (Administration) > Diagnostic > System Check:
image

@edoswald
Copy link
Author

edoswald commented Sep 15, 2023 via email

@AltamashShaikh
Copy link
Contributor

@edoswald We didn't get you on your last response

@edoswald
Copy link
Author

Sorry, did by email. Anyway, reinstalled everything from scratch. Appears to be some issue with the Plesk one-click, at least on a Vultr server. Installed Plesk using their web install interface on a LAMP one-click, and the only issue i had after some additional fixes which were obvious from system check is the LOCAL DATA INFILE (although the other is working, so i will leave it for now as I am only seeing a max of maybe 25k a month across all the sites tracked).

Just putting this in here in case it happens to somebody else who may have been trying to install Matomo on a Plesk one-click.

@tsteur
Copy link
Member

tsteur commented Dec 23, 2023

Reopening as this issue still exists and is still happening. Some information below. The command googleanalyticsimporter:import-ga4-reports --idsite=12 was executed there.

This fatal error happened on 5.0.0-rc9

Error: {"message":"Site ID 12 does not exist.","file":"/plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php","line":282,"backtrace":" on /plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php(282)\n#0 /plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php(76): Piwik\Plugins\GoogleAnalyticsImporter\Commands\ImportGA4Reports->getIdSite()\n#1 /plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php(53): Piwik\Plugins\GoogleAnalyticsImporter\Commands\ImportGA4Reports->executeImpl()\n#2 /core/Plugin/ConsoleCommand.php(110): Piwik\Plugins\GoogleAnalyticsImporter\Commands\ImportGA4Reports->doExecute()\n#3 /vendor/symfony/console/Command/Command.php(298): Piwik\Plugin\ConsoleCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#4 /core/Plugin/ConsoleCommand.php(125): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#5 /vendor/symfony/console/Application.php(1040): Piwik\Plugin\ConsoleCommand->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#6 /vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\Plugins\GoogleAnalyticsImporter\Commands\ImportGA4Reports), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#7 /core/Console.php(106): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#8 [internal function]: Piwik\Console->originDoRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#9 /core/Console.php(145): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#10 /core/Access.php(670): Piwik\Console->Piwik\{closure}()\n#11 /core/Console.php(146): Piwik\Access::doAsSuperUser(Object(Closure))\n#12 /core/Console.php(85): Piwik\Console->doRunImpl(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#13 /vendor/symfony/console/Application.php(171): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#14 /console(32): Symfony\Component\Console\Application->run()\n#15 {main}","safemode_backtrace":"#0 [internal function]: Piwik\Plugins\Cloud\Controller->safemode(Array)\n#1 /core/FrontController.php(637): call_user_func_array(Array, Array)\n#2 /core/FrontController.php(169): Piwik\FrontController->doDispatch('Cloud', 'safemode', Array)\n#3 /core/FrontController.php(100): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#4 /core/FrontController.php(140): Piwik\FrontController::(Array)\n#5 /core/Console.php(88): Piwik\FrontController::(Object(Exception))\n#6 /vendor/symfony/console/Application.php(171): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#7 /console(32): Symfony\Component\Console\Application->run()\n#8 {main}"}

Executed on CLI

@tsteur tsteur reopened this Dec 23, 2023
@AltamashShaikh
Copy link
Contributor

@tsteur I tried locally and seems to working for me, can you share more details on this to reproduce the same error
Screenshot from 2023-12-27 15-12-26

@tsteur
Copy link
Member

tsteur commented Dec 28, 2023

@AltamashShaikh I don't have more information than this. I can reproduce this locally with a siteId that does not exist.

./console googleanalyticsimporter:import-ga4-reports --idsite=343034
ERROR [17:25:22] 94946 api.matomo.cloud Uncaught exception: Exception: Site ID 343034 does not exist. in plugins/GoogleAnalyticsImporter/Commands/ImportGA4Reports.php:282

@AltamashShaikh
Copy link
Contributor

@tsteur Do you mean you deleted a site which had a GA import running and started getting above error post deletion ?

@tsteur
Copy link
Member

tsteur commented Dec 29, 2023

Yes, or a site that never existed maybe (unsure what happened there)

@AltamashShaikh
Copy link
Contributor

@tsteur We are deleting the import by registering to SitesManager.deleteSite.end event, may be some edge case where this event is not being fired ?

@tsteur
Copy link
Member

tsteur commented Jan 2, 2024

Possible 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants