@mattab opened this Issue on October 27th 2020 Member

Got this error reported by email:

Illegal length modifier specified 'f' in s[np]printf call in /home/track/vendor/twig/twig/src/Cache/FilesystemCache.php 65 using PHP 7.3.21

in Matomo 3.13.6

@tsteur commented on October 27th 2020 Member

@mattab I'll close this for now as we upgraded to a new major twig version in Matomo 4 so this might be fixed. Also we can't fix this ourselves anyway and be best to otherwise create an issue in the twig repository if this happens again in Matomo 4. The sprintf calls look actually good/standard to me.

@mattab commented on October 27th 2020 Member

fyi got another report from a different user Illegal length modifier specified 'f' in s[np]printf call in /home/public_html/vendor/twig/twig/src/Cache/FilesystemCache.php 65 using PHP 7.2.33

@tsteur commented on October 27th 2020 Member
@Findus23 commented on October 27th 2020 Member

I talked a bit about this issue here:
https://forum.matomo.org/t/matomo-not-working-after-full-removal-reinstall-2020/37837/8

It might be some weird PHP bug where file_put_contents or rename internally call printf.

@thinkhuman commented on July 24th 2021

I'm using Matomo v4.3.1. I absolutely still get this error message constantly, and it renders most of the analytics unusable.
Illegal length modifier specified 'f' in s[np]printf call

@Findus23 commented on July 24th 2021 Member

@thinkhuman I would strongly recommend you to update your PHP version to newer version that doesn't contain this weird bug.

@thinkhuman commented on July 27th 2021

@Findus23 Thanks Lukas. I'd already tried that--running 7.4. No change in error messages. Bug still exists, as far as i can tell.

@Findus23 commented on July 27th 2021 Member

@thinkhuman
Where are you getting your PHP binaries from? Which linux distribution are you using?

Maybe the comments from https://stackoverflow.com/questions/66281360/error-illegal-length-modifier-specified-f-in-snpprintf-laravel and https://chat.stackoverflow.com/rooms/228965/discussion-between-muresan-andrei-and-gerardo-marroquin help you (that's one of the few places on the internet where I can find information about this bug)

@thinkhuman commented on July 27th 2021

@Findus23 I'm running Matomo at my hosting provider--not hosted/onsite. Here's the diagnostics dump:

# Matomo

* Matomo Plugin Version: 4.3.1
* Config exists and is writable.: Yes ("$ABSPATH/wp-content/uploads/matomo/config/config.ini.php" )
* JS Tracker exists and is writable.: Yes ("$ABSPATH/wp-content/uploads/matomo/matomo.js" )
* Plugin directories: Yes ([{"pluginsPathAbsolute":"$ABSPATH\/wp-content\/plugins\/matomo\/plugins","webrootDirRelativeToMatomo":"..\/"}])
* Tmp directory writable: Yes ($ABSPATH/wp-content/cache/matomo)
* Matomo Version: 4.3.1-rc1
* Matomo Blog idSite: 1
* Matomo Install Version: 1.1.2 (Install date: 2020-06-09 19:21:04)
* Upgrades outstanding: No
* Upgrade in progress: No

## Endpoints

* Matomo JavaScript Tracker URL:  ($site_url/wp-content/uploads/matomo/matomo.js)
* Matomo JavaScript Tracker - WP Rest API:  ($site_url/wp-json/matomo/v1/hit/)
* Matomo HTTP Tracking API:  ($site_url/wp-content/plugins/matomo/app/matomo.php)
* Matomo HTTP Tracking API - WP Rest API:  ($site_url/wp-json/matomo/v1/hit/)

## Crons

* Server time: 2021-07-27 17:58:09
* Blog time: 2021-07-27 17:58:09 (Below dates are shown in blog timezone)
* Sync users & sites: Next run: 2021-07-27 19:21:01 (1 hours 22 min) ( Last started: 2021-07-26 19:34:44 (-22 hours 23 min). Last ended: 2021-07-26 19:34:45 (-22 hours 23 min). Interval: daily)
* Archive: Next run: 2021-07-27 18:21:01 (22 min 52s) ( Last started: 2021-07-27 17:21:35 (-36 min 34s). Last ended: 2021-07-27 17:21:39 (-36 min 30s). Interval: hourly)
* Update GeoIP DB: Next run: 2021-08-03 19:21:01 (7 days 1 hours) ( Last started: 2021-07-04 19:27:24 (-22 days 22 hours). Last ended: 2021-07-04 19:27:46 (-22 days 22 hours). Interval: matomo_monthly)

## Mandatory checks

* PHP version >= : ok 
* PDO extension: ok 
* PDO\MYSQL extension: ok 
* MYSQLI extension: ok 
* Other required extensions: ok 
* Required functions: ok 
* Required PHP configuration (php.ini): ok 
* Directories with write access: ok 
* Directories with write access for Tag Manager: ok 

## Optional checks

* Tracker status: ok 
* Memory limit: ok 
* Time zone: ok 
* Open URL: ok 
* PageSpeed disabled: ok 
* GD > 2.x + Freetype (graphics): ok 
* Other extensions: ok 
* Other functions: ok 
* Warning Filesystem: warning  (Your server is using an NFS filesystem. This means Matomo will be extremely slow when using file based sessions. )
* Last Successful Archiving Completion: ok 
* Database abilities: ok 
* Max Packet Size: ok 
* Geolocation: ok 
* Update over HTTPS: ok 
* Writable JavaScript Tracker ("/matomo.js"): ok 
* Supports Async Archiving: No
* Location provider ID: geoip2php
* Location provider available: Yes
* Location provider working: Yes
* Had visit in last 5 days: Yes
* Matomo URL: Yes ($site_url/wp-content/plugins/matomo/app/)

## Matomo Settings

* Track mode: default
* Track codeposition: footer
* Track api endpoint: default
* Track js endpoint: default
* Version history: 4.3.1, 4.2.0, 4.1.3, 1.3.1, 1.2.0
* Core version: 4.3.1-rc1
* Last tracking settings update: 1591733440
* Last settings update: 1591742641

## Logs

* None: 

# WordPress

* Home URL: $site_url
* Site URL: $site_url
* WordPress Version: 5.8
* Number of blogs: 1
* Multisite Enabled: No
* Network Enabled: No
* WP_DEBUG: No
* WP_DEBUG_DISPLAY: Yes
* WP_DEBUG_LOG: No
* DISABLE_WP_CRON: -
* FORCE_SSL_ADMIN: Yes
* WP_CACHE: No
* CONCATENATE_SCRIPTS: -
* COMPRESS_SCRIPTS: -
* COMPRESS_CSS: -
* ENFORCE_GZIP: -
* WP_LOCAL_DEV: -
* WP_CONTENT_URL: $site_url/wp-content
* WP_CONTENT_DIR: $ABSPATH/wp-content
* UPLOADS: -
* BLOGUPLOADDIR: -
* DIEONDBERROR: -
* WPLANG: -
* ALTERNATE_WP_CRON: -
* WP_CRON_LOCK_TIMEOUT: 60
* WP_DISABLE_FATAL_ERROR_HANDLER: -
* MATOMO_SUPPORT_ASYNC_ARCHIVING: -
* MATOMO_TRIGGER_BROWSER_ARCHIVING: -
* MATOMO_ENABLE_TAG_MANAGER: -
* MATOMO_SUPPRESS_DB_ERRORS: -
* MATOMO_ENABLE_AUTO_UPGRADE: -
* MATOMO_DEBUG: -
* MATOMO_SAFE_MODE: -
* MATOMO_GLOBAL_UPLOAD_DIR: -
* MATOMO_LOGIN_REDIRECT: -
* Permalink Structure: /%postname%/
* Possibly uses symlink: No
* Upload base url: $site_url/wp-content/uploads
* Upload base dir: $ABSPATH/wp-content/uploads
* Upload url: $site_url/wp-content/uploads
* Custom upload_path: 
* Custom upload_url_path: 
* Compatible content directory: Yes

# WordPress Plugins

* Advanced Custom Fields: 5.9.9
* Classic Editor: 1.6.2
* IP Geo Block: 3.0.17.4
* Jetpack: 9.9.1
* JM Twitter Cards: 11.1.6
* Limit Login Attempts Reloaded: 2.23.0
* Matomo Analytics - Ethical Stats. Powerful Insights.: 4.3.1
* Sucuri Security - Auditing, Malware Scanner and Hardening: 1.8.27
* Visual Portfolio, Posts & Image Gallery: 2.13.1
* WPS Hide Login: 1.8.5
* Active Plugins: 10 (advanced-custom-fields classic-editor ip-geo-block jetpack jm-twitter-cards limit-login-attempts-reloaded matomo sucuri-scanner visual-portfolio wps-hide-login)
* Theme: write-pro (write-pro)

# Server

* Server Info: Apache
* PHP OS: Linux
* PHP Version: 7.4.19
* PHP SAPI: cgi-fcgi
* PHP Binary Name: php-cgi
* PHP Error Reporting: 0 After bootstrap: 0
* PHP Found Binary: php -q
* Timezone: UTC
* WP timezone: +00:00
* Locale: en_US
* User Locale: en_US
* Memory Limit: 768M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
* WP Memory Limit: 40M
* WP Max Memory Limit: 768M
* Timezone version: 0.system
* Time: 1627408690
* Max Execution Time: 30
* Max Post Size: 512M
* Max Upload Size: 536870912
* Max Input Vars: 6200
* Disabled PHP functions: No
* zlib.output_compression is off: Yes
* Curl Version: 7.77.0, OpenSSL/1.1.1k
* Suhosin installed: No

# Database

* MySQL Version: 5.5.5
* Mysqli Connect: Yes
* Force MySQL over Mysqli: No
* DB Prefix: thx_
* DB CHARSET: utf8mb4
* DB COLLATE: 
* SHOW ERRORS: No
* SUPPRESS ERRORS: No
* Uses Socket: No
* Uses IPv6: No
* Matomo tables found: 124
* Matomo users found: 1
* Matomo sites found: 1
* Required permissions: OK
@sgiehl commented on July 28th 2021 Member

@thinkhuman Seems you are using Matomo for Wordpress. In this case it might be some incompatibility with another wordpress plugin maybe. Might be good to create a new issue here: https://github.com/matomo-org/matomo-for-wordpress/issues

This Issue was closed on October 27th 2020
Powered by GitHub Issue Mirror