@bluesailor45 opened this Issue on January 19th 2017

after upgrade to PIWIK 3.0.1 in Joomla, following error appears:
fatal error in PIWIK 3.0.1
Call to undefined function Piwik\fnmatch() in /share/MD0_DATA/.qpkg/Piwik/Piwik/core/FileIntegrity.php 312 using PHP 5.5.26

thereafter it is not possible to logon to PIWIK:

a fatal error occurred:
Please contact the system administrator, or login to Piwik to learn more.

If you are Super User, but cannot login because of this error, you can still troubleshoot further. Follow these steps:
1) open the config/config.ini.php file and look for the salt value under [General].
2) edit this current URL you are viewing and add the following text (replacing salt_value_from_config by the salt value from the config file):
index.php?i_am_super_user=salt_value_from_config&....

However this 2) message is not useful for me.

@CheweyZ commented on January 19th 2017 Contributor

What OS are you running this on?

@bluesailor45 commented on January 20th 2017

Hi CheweyZ
I am running Linux-Firmware Version 4.2.1 in QNap TS-219P. In Joomla I am using Joomla 3.6.5 with PHP 5.5.26. I was upgrading PIWIK from Version 2.6.1 which was installed as a QNAP Application.
Thanks for your help.

@bluesailor45 commented on January 28th 2017

No solution to that 😳???

@CheweyZ commented on January 28th 2017 Contributor

So not 100% sure but it appears your system is none POSIX compliant which means that fnmatch is not able to run on your machine. To find out more see or confirm you machine-distro is a POSIX supported system as then php call only works on that.

Sorry for the little help.

@bluesailor45 commented on January 30th 2017

Thank you very much for your hint. Any tip is welcome😉. I will check in this direction.

@tsteur commented on February 3rd 2017 Member

@bluesailor45 can you try to copy something like this in your "libs/upgradephp/upgrade.php"

if(!function_exists('fnmatch')) {

    function fnmatch($pattern, $string) {
        return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
    } // end

} // end if

I haven't tested it and only copied it from http://php.net/manual/en/function.fnmatch.php

We would need to define this method then in the future if it is not defined

@bluesailor45 commented on February 4th 2017

@tsteur thank you very much for your help.
I added your suggested code add the end of upgrade.php and it did work!

Unfortunately I got an additional error while the upgrade is trying to upgrade the Mysql database:
Mysqli prepare error: Table 'Piwik_analytics.piwik_plugin_setting' doesn't exist

I checked the Piwik_analytics.piwik database and the mentioned table really does not exist. Please provide me with the correct create table command.
Thank you very much.

@bluesailor45 commented on February 4th 2017

Thank you Thomas

I have added this code to the end of upgrade.php and the update process did work until the database upgrade - which ended with the error message:

Mysqli prepare error: Table 'Piwik_analytics.piwik_plugin_setting' doesn't exist

How do I have to create this table? Can you give me the correct Mysql create table command

Thank you very much.

Very kind regards

Kurt

Am 03.02.2017 um 23:37 schrieb Thomas Steur <notifications@github.com>:

@bluesailor45 https://github.com/bluesailor45 can you try to copy something like this in your "libs/upgradephp/upgrade.php"

if(!function_exists('fnmatch')) {

function fnmatch($pattern, $string) {
    return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
} // end

} // end if
I haven't tested it and only copied it from http://php.net/manual/en/function.fnmatch.php http://php.net/manual/en/function.fnmatch.php
We would need to define this method then in the future if it is not defined


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/piwik/piwik/issues/11237#issuecomment-277381871, or mute the thread https://github.com/notifications/unsubscribe-auth/AYDpID4oDr5Pwof3ydWF7BPfg8E05jd9ks5rY6xDgaJpZM4LoJ2x.

@RMastop commented on February 4th 2017 Contributor

Please use this to create the table

CREATE TABLE `piwik_plugin_setting` (
  `plugin_name` varchar(60) NOT NULL,
  `setting_name` varchar(255) NOT NULL,
  `setting_value` longtext NOT NULL,
  `user_login` varchar(100) NOT NULL DEFAULT '',
  KEY `index_plugin_name_user_login` (`plugin_name`,`user_login`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
@bluesailor45 commented on February 4th 2017

Hi Thomas
thank you very much for your fast response. After I have created the table and rerun the update, obviously the table „Piwik_analytics.piwik_site_setting“ is also missing.
Please send also the required create table sql.

Thank you very much.

Very kind regards
Kurt

Am 04.02.2017 um 12:30 schrieb RMastop <notifications@github.com>:

Please use this to create the table

CREATE TABLE piwik_plugin_setting (
plugin_name varchar(60) NOT NULL,
setting_name varchar(255) NOT NULL,
setting_value longtext NOT NULL,
user_login varchar(100) NOT NULL DEFAULT '',
KEY index_plugin_name_user_login (plugin_name,user_login)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/piwik/piwik/issues/11237#issuecomment-277437465, or mute the thread https://github.com/notifications/unsubscribe-auth/AYDpIIBJbDmc5giSQwuYMjlcIC-voP0Hks5rZGFXgaJpZM4LoJ2x.

@RMastop commented on February 4th 2017 Contributor

Hi,

The requested info:
CREATE TABLEpiwik_site_setting( idsiteint(10) unsigned NOT NULL, plugin_namevarchar(60) NOT NULL, setting_namevarchar(255) NOT NULL, setting_valuelongtext NOT NULL, KEYidsite(idsite,plugin_name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8

@bluesailor45 commented on February 4th 2017

Hi
I created requested table and rerun, but there is obviously some severe errors with my install (see below). I will try to uninstall from Qnap, and install the Qnap supported version and the upgrade. Keep fingers crossed ;-)

File integrity check failed and reported some errors. You should fix this issue and then refresh this page until it shows no error.
Directories were found in your Piwik but we didn't expect them.
--> Please delete these directories to prevent errors. <--

Directory to delete: libs/pChart2.1.3
Directory to delete: libs/tcpdf


To delete all these directories at once, you can run this command:
rm -Rf /share/MD0_DATA/.qpkg/Piwik/Piwik/libs/pChart2.1.3 /share/MD0_DATA/.qpkg/Piwik/Piwik/libs/tcpdf


Files were found in your Piwik but we didn't expect them.
--> Please delete these files to prevent errors. <--

File to delete: config/global.ini.auto-backup-before-update.php
File to delete: libs/PEAR.php
File to delete: libs/PEAR5.php
File to delete: libs/Archive_Tar/Tar.php
File to delete: libs/PEAR/Exception.php
File to delete: libs/PEAR/FixPHP5PEARWarnings.php
File to delete: libs/PEAR/LICENSE
File to delete: libs/PclZip/lgpl-2.1.txt
File to delete: libs/PclZip/pclzip.lib.php
File to delete: libs/PiwikTracker/LICENSE.txt
File to delete: libs/UserAgentParser/README.md
File to delete: libs/UserAgentParser/UserAgentParser.php
File to delete: libs/UserAgentParser/UserAgentParser.test.php
File to delete: libs/angularjs/LICENSE
File to delete: libs/angularjs/angular-animate.js
File to delete: libs/angularjs/angular-animate.min.js
File to delete: libs/angularjs/angular-cookies.js
File to delete: libs/angularjs/angular-cookies.min.js
File to delete: libs/angularjs/angular-csp.css
File to delete: libs/angularjs/angular-loader.js
File to delete: libs/angularjs/angular-loader.min.js
File to delete: libs/angularjs/angular-mocks.js
File to delete: libs/angularjs/angular-resource.js
File to delete: libs/angularjs/angular-resource.min.js
File to delete: libs/angularjs/angular-route.js
File to delete: libs/angularjs/angular-route.min.js
File to delete: libs/angularjs/angular-sanitize.js
File to delete: libs/angularjs/angular-sanitize.min.js
File to delete: libs/angularjs/angular-scenario.js
File to delete: libs/angularjs/angular-touch.js
File to delete: libs/angularjs/angular-touch.min.js
File to delete: libs/angularjs/angular.js
File to delete: libs/angularjs/angular.min.js
File to delete: libs/angularjs/errors.json
File to delete: libs/angularjs/version.json
File to delete: libs/angularjs/version.txt
File to delete: libs/html5shiv/html5shiv.js
File to delete: libs/javascript/sprintf.js
File to delete: libs/jquery/MIT-LICENSE-jquery.txt
File to delete: libs/jquery/MIT-LICENSE-jqueryui.txt
File to delete: libs/jquery/MIT-LICENSE-placeholder.txt
File to delete: libs/jquery/MIT-LICENSE-scrollto.txt
File to delete: libs/jquery/jquery-ui.js
File to delete: libs/jquery/jquery.history.js
File to delete: libs/jquery/jquery.js
File to delete: libs/jquery/jquery.jscrollpane.js
File to delete: libs/jquery/jquery.mousewheel.js
File to delete: libs/jquery/jquery.placeholder.js
File to delete: libs/jquery/jquery.scrollTo.js
File to delete: libs/jquery/themes/base/jquery-ui.css
File to delete: libs/mousetrap/README.md
File to delete: libs/mousetrap/mousetrap.min.js
File to delete: libs/upgradephp/old-upgrade.php
File to delete: misc/others/cli-script-bootstrap.php
File to delete: misc/others/iframeWidget.htm
File to delete: misc/others/phpstorm-codestyles/Piwik_codestyle.xml
File to delete: misc/others/phpstorm-codestyles/README.md
File to delete: misc/proxy-hide-piwik-url/piwik.php
File to delete: vendor/piwik/device-detector/phpunit.xml.dist
File to delete: vendor/piwik/device-detector/test.php
File to delete: vendor/piwik/device-detector/Cache/CacheFile.php
File to delete: vendor/piwik/device-detector/Cache/CacheInterface.php
File to delete: vendor/piwik/device-detector/Cache/CacheMemcache.php
File to delete: vendor/piwik/device-detector/Cache/CacheStatic.php
File to delete: vendor/twig/twig/ext/twig/LICENSE
File to delete: vendor/twig/twig/lib/Twig/Node/SandboxedModule.php
File to delete: vendor/twig/twig/.editorconfig


To delete all these files at once, you can run this command:
rm "/share/MD0_DATA/.qpkg/Piwik/Piwik/config/global.ini.auto-backup-before-update.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/PEAR.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/PEAR5.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/Archive_Tar/Tar.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/PEAR/Exception.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/PEAR/FixPHP5PEARWarnings.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/PEAR/LICENSE" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/PclZip/lgpl-2.1.txt" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/PclZip/pclzip.lib.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/PiwikTracker/LICENSE.txt" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/UserAgentParser/README.md" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/UserAgentParser/UserAgentParser.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/UserAgentParser/UserAgentParser.test.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/LICENSE" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-animate.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-animate.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-cookies.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-cookies.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-csp.css" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-loader.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-loader.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-mocks.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-resource.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-resource.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-route.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-route.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-sanitize.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-sanitize.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-scenario.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-touch.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular-touch.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/angular.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/errors.json" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/version.json" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/angularjs/version.txt" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/html5shiv/html5shiv.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/javascript/sprintf.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/MIT-LICENSE-jquery.txt" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/MIT-LICENSE-jqueryui.txt" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/MIT-LICENSE-placeholder.txt" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/MIT-LICENSE-scrollto.txt" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/jquery-ui.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/jquery.history.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/jquery.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/jquery.jscrollpane.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/jquery.mousewheel.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/jquery.placeholder.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/jquery.scrollTo.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/jquery/themes/base/jquery-ui.css" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/mousetrap/README.md" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/mousetrap/mousetrap.min.js" "/share/MD0_DATA/.qpkg/Piwik/Piwik/libs/upgradephp/old-upgrade.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/misc/others/cli-script-bootstrap.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/misc/others/iframeWidget.htm" "/share/MD0_DATA/.qpkg/Piwik/Piwik/misc/others/phpstorm-codestyles/Piwik_codestyle.xml" "/share/MD0_DATA/.qpkg/Piwik/Piwik/misc/others/phpstorm-codestyles/README.md" "/share/MD0_DATA/.qpkg/Piwik/Piwik/misc/proxy-hide-piwik-url/piwik.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/piwik/device-detector/phpunit.xml.dist" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/piwik/device-detector/test.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/piwik/device-detector/Cache/CacheFile.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/piwik/device-detector/Cache/CacheInterface.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/piwik/device-detector/Cache/CacheMemcache.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/piwik/device-detector/Cache/CacheStatic.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/twig/twig/ext/twig/LICENSE" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php" "/share/MD0_DATA/.qpkg/Piwik/Piwik/vendor/twig/twig/.editorconfig"


Errors below may be due to a partial or failed upload of Piwik files.
--> Try to reupload all the Piwik files in BINARY mode. <--

Unterschiedliche Dateigröße: /share/MD0_DATA/.qpkg/Piwik/Piwik/libs/upgradephp/upgrade.php (erwartete Größe: 16965, gefunden: 17282)

Very kind regards
Kurt

Am 04.02.2017 um 15:37 schrieb RMastop <notifications@github.com>:

Hi,

The requested info:
CREATE TABLEpiwik_site_setting(idsiteint(10) unsigned NOT NULL,plugin_namevarchar(60) NOT NULL,setting_namevarchar(255) NOT NULL,setting_valuelongtext NOT NULL, KEYidsite(idsite,plugin_name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/piwik/piwik/issues/11237#issuecomment-277449796, or mute the thread https://github.com/notifications/unsubscribe-auth/AYDpIKwn9xkJSSSGTukHbQq0HU2AlRJhks5rZI0XgaJpZM4LoJ2x.

@RMastop commented on February 4th 2017 Contributor

Hi @bluesailor45,

It might actually be correct to remove those files and directories. Do you have a way to remove the directories and files from the device? Piwik 3.0.1 has a check on unexpected files / directories.

In the past some files were kept in the install package, Piwik now identifies those unneeded items.

@bluesailor45 commented on February 5th 2017

I tried to reinstall Piwik 2.6.1 (which is supported in Knapp App store), apply the mentioned fix to the module and rerun the upgrade process. However I got much too many error while upgrade. I will wait with the install/update until 3.xx is available in the Qnap app store.

This Issue was closed on February 21st 2017
Powered by GitHub Issue Mirror