deadda7a / Matomo-VIP-Detector

Detect visits from special predefined IP ranges and display the name
MIT License
0 stars 0 forks source link

Error when importing the json file #1

Closed Chardonneaur closed 1 year ago

Chardonneaur commented 1 year ago

Hello,

I tried to use the plugin today and when I try to import the json file, here is the answer I am getting: PHP Fatal error: Cannot override final method Piwik\Plugin\ConsoleCommand::execute() in /var/www/html/udemy/matomo/plugins/VipDetector/Commands/ImportData.php on line 25 I tried both the two examples you are providing as json file.

Hope that helps,

deadda7a commented 1 year ago

Hey,

Thank for the report :)

This is weird since that part of the code comes from the command generator that Matomo provides for plugin development; Can you tell me a bit about your environment (PHP / Matomo Version, what OS in what version)? And the command you used?

Sebastian Elisa

Chardonneaur commented 1 year ago

Sure, ok so i guess it is because I have Matomo v5, correct?

Click to view System Check ### Mandatory checks #### PHP version >= 7.2.5: ✔ 8.1.7-1ubuntu3.5 #### PDO extension: ✔ #### PDO\MYSQL extension: ✔ #### MYSQLI extension: ✔ #### Other required extensions: ✔ zlib ✔ json ✔ filter ✔ hash ✔ session #### Required functions: ✔ debug_backtrace ✔ eval ✔ hash ✔ gzcompress ✔ gzuncompress ✔ pack #### Required PHP configuration (php.ini): ✔ session.auto_start = 0 ✔ max_execution_time = 0 OR = -1 OR >= 30 #### Directories with write access: ✔ $DOC_ROOT/tmp ✔ $DOC_ROOT/tmp/assets ✔ $DOC_ROOT/tmp/cache ✔ $DOC_ROOT/tmp/climulti ✔ $DOC_ROOT/tmp/latest ✔ $DOC_ROOT/tmp/logs ✔ $DOC_ROOT/tmp/sessions ✔ $DOC_ROOT/tmp/tcpdf ✔ $DOC_ROOT/tmp/templates_c #### Directories with write access for Tag Manager: ✔ $DOC_ROOT/js ### Optional checks #### Required Private Directories: ⚠ Warning: Unable to execute check for $MATOMO_URLconfig/config.ini.php: curl_exec: Operation timed out after 2001 milliseconds with 0 bytes received. Hostname requested was: localhost ⚠ Warning: Unable to execute check for $MATOMO_URL.git: curl_exec: Operation timed out after 2001 milliseconds with 0 bytes received. Hostname requested was: localhost ⚠ Warning: Unable to execute check for $MATOMO_URL.git/config: curl_exec: Operation timed out after 2001 milliseconds with 0 bytes received. Hostname requested was: localhost ✔ All private directories are inaccessible from the internet. #### Recommended Private Directories: ⚠ Warning: Unable to execute check for $MATOMO_URLtmp/: curl_exec: Operation timed out after 2001 milliseconds with 0 bytes received. Hostname requested was: localhost ⚠ Warning: Unable to execute check for $MATOMO_URLtmp/empty: curl_exec: Operation timed out after 2001 milliseconds with 0 bytes received. Hostname requested was: localhost ⚠ Warning: Unable to execute check for $MATOMO_URLlang/en.json: curl_exec: Operation timed out after 2001 milliseconds with 0 bytes received. Hostname requested was: localhost ✔ All private directories are inaccessible from the internet. #### File integrity: ⚠ Warning: (Disabled in development mode) #### 64-bit PHP Binary: ✔ #### Tracker status: ✔ #### Memory limit: ✔ There is no memory limit set #### Time zone: ✔ #### Open URL: ✔ curl #### PageSpeed is turned off: ✔ #### GD > 2.x + FreeType (graphics): ✔ #### Other extensions: ✔ json ✔ libxml ✔ dom ✔ SimpleXML ✔ openssl #### Other functions: ✔ shell_exec ✔ set_time_limit ✔ mail ✔ parse_ini_file ✔ glob ✔ gzopen ✔ md5_file #### Filesystem: ✔ #### Set up Cron (faster report-loading): ⚠ Warning: For optimal performance and a speedy Matomo, it is highly recommended to set up a crontab to automatically archive your reports, and to disable browser triggering in the Matomo settings. Learn more. #### Set up Cron - Managing processes via CLI: ✔ Ok #### Database abilities: ✔ UTF8mb4 charset ⚠ Warning: LOAD DATA INFILE
Hint: Using LOAD DATA INFILE by updating your PHP and MySQL software and ensuring your database user has the FILE privilege speeds up Matomo's archiving process a lot.
You should fix this problem if your Matomo server tracks high-traffic websites (e.g. over 100,000 pages per month).
Error: LOAD DATA INFILE failed... Error was:
Try #1: LOAD DATA INFILE : SQLSTATE[HY000]: General error: 1290 The MySQL server is running with the --secure-file-priv option so it cannot execute this statement,
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 #### Max Packet Size: ✔ #### Forced SSL Connection: ⚠ Warning: We recommend using Matomo over secure SSL connections only. To prevent insecure access over http, add force_ssl = 1 to the General section in your Matomo config/config.ini.php file.

Attention: Doing this without having set up a SSL certificate for using HTTPS will break Matomo. #### Geolocation: ✔ geoip2php (continent_code, continent_name, country_code, country_name, region_name, city_name, lat, long) #### Update over HTTPS: ✔ #### Mobile Messaging SMS Provider: not configured #### Writable JavaScript Tracker ("/matomo.js"): ✔ ### Informational results #### Matomo Version: 5.0.0-b5 #### Matomo Update History: 5.0.0-b5, #### Matomo Install Version: 5.0.0-b5 #### Latest Available Version: 4.15.1 #### Is Git Deployment: 1 #### PHP_OS: Linux #### PHP_BINARY: /usr/bin/php8.1 #### PHP SAPI: cli-server #### Timezone Version: 0.system #### PHP Timezone: UTC #### PHP Time: 1694006689 #### PHP Datetime: 2023-09-06 13:24:49 #### PHP INI max_execution_time: 30 #### PHP INI post_max_size: 8M #### PHP INI max_input_vars: 1000 #### PHP INI zlib.output_compression: #### Curl Version: 7.85.0, OpenSSL/3.0.5 #### Suhosin Installed: 0 #### DB Prefix: matomo_ #### DB Charset: utf8mb4 #### DB Adapter: PDO\MYSQL #### MySQL Version: 8.0.33-0ubuntu0.22.10.2 #### Num Tables: 47 #### Browser Segment Archiving Enabled: 1 #### Development Mode Enabled: 1 #### Internet Enabled: 1 #### Multi Server Environment: 0 #### Auto Update Enabled: 1 #### Custom User Path: 0 #### Custom Include Path: 0 #### Release Channel: latest_stable #### Plugins Activated: API, Actions, Annotations, BulkTracking, Contents, CoreAdminHome, CoreConsole, CoreHome, CorePluginsAdmin, CoreUpdater, CoreVisualizations, CoreVue, CustomDimensions, CustomJsTracker, Dashboard, DevicePlugins, DevicesDetection, Diagnostics, Ecommerce, Events, FCN 0.1.0, Feedback, GeoIp2, Goals, Heartbeat, ImageGraph, Insights, Installation, Intl, IntranetMeasurable, LanguagesManager, Live, Login, Marketplace, MobileMessaging, Monolog, Morpheus, MultiSites, Overlay, PagePerformance, PrivacyManager, ProfessionalServices, Proxy, Referrers, Resolution, RssWidget, SEO, ScheduledReports, SegmentAuthorization 0.1.0, SegmentEditor, SitesManager, Sweden 0.1.0, TagManager, TestRunner, Tour, Transitions, TwoFactorAuth, UdemyPlugin 0.1.0, UdemySettingsNew 0.1.0, UdemyWidget 0.1.0, UserCountry, UserCountryMap, UserId, UserLanguage, UsersManager, VipDetector 1.0.0, VisitFrequency, VisitTime, VisitorInterest, VisitsSummary, WebsiteMeasurable, Widgetize #### Plugins Deactivated: AlternativeSparklines 0.3.0, AnonymousPiwikUsageMeasurement 5.0.0, Bandwidth 5.0.0, Cecile 0.1.0, ClassicFontTheme 5.0.0, CustomAlerts 5.0.0, CustomVariables 5.0.0, DBStats, DarkTheme 5.0.1, DeviceDetectorCache 5.0.0, Donttouch 0.1.0, ExampleAPI, ExampleCommand, ExampleLogTables, ExamplePlugin, ExampleReport, ExampleSettingsPlugin, ExampleTheme, ExampleTracker, ExampleUI, ExampleVisualization, ExampleVue, FCNtheme 0.1.0, Fcnudemy 0.1.0, GoogleTheme 5.0.1, HP 0.1.0, Halloween 0.1.0, HarryPotter 0.1.0, Images 0.1.0, LogViewer 5.0.0, LoginLdap 5.0.0, MarketingCampaignsReporting 5.0.0, MobileAppMeasurable, Modern 5.0.0, Morpheus2 0.1.0, MyPlugin 0.1.0, OM 5.0.1, PSG 0.1.0, Phptheme 0.1.0, Provider 5.0.0, QueuedTracking 5.0.0, SecurityInfo 5.0.0, SegmentAuthorization2 0.1.0, Stackedit 0.1.0, TasksTimetable 5.0.0, TheFamousSnakeHouse 0.1.0, TrackingSpamPrevention 5.0.0, TreemapVisualization 5.0.0, Udemycourse 0.1.0, VisitorGenerator 5.0.0 #### Plugins Invalid: #### Server Info: PHP 8.1.7-1ubuntu3.5 Development Server #### Had visits in last 1 day: 1 #### Had visits in last 3 days: 1 #### Had visits in last 5 days: 1 #### Archive Time Last Started: - #### Archive Time Last Finished: - #### User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0 #### Browser Language: en-us,en #### Total Invalidation Count: 7 #### In Progress Invalidation Count: 0 #### Scheduled Invalidation Count: 7 #### Earliest invalidation ts_started: #### Latest invalidation ts_started: #### Earliest invalidation ts_invalidated: 2023-08-22 10:15:53 #### Latest invalidation ts_invalidated: 2023-09-06 12:24:05 #### Number of segment invalidations: 0 #### Number of plugin invalidations: 0 #### List of plugins being invalidated: #### Anonymize Referrer: #### Do Not Track enabled: 0
deadda7a commented 1 year ago

Hmm I've only tested up to 4.15.1 since this is the latest stable release. And yes, this seems to be the issue because according to the changelog:

To encapsulate plugin commands from directly using any symfony console dependency our class Piwik\Plugins\ConsoleCommand has been rewritten. To migrate your commands you need to apply some changes: Methods like run, execute, interact or initialize can no longer be overwritten.

I'll look into it, but probably after 2023-09-20 'cause I decided to finish high school next to work and on the 19th I've my last exam :)

deadda7a commented 1 year ago

Hello, sorry for the late reply but I got derailed by life :sweat_smile: Anyway in the 5-dev branch there now is a version for Matomo 5.