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

Piwik/ matomo suddenly stopped working with error syntax error, unexpected ''/var/www/html/plugins/VisitTi' (T_ENCAPSED_AND_WHITESPACE), expecting ')' #13143

Closed
jkjha opened this issue Jul 6, 2018 · 15 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@jkjha
Copy link

jkjha commented Jul 6, 2018

This is embarrassing.. my matomo instance has suddenly stopped working today and it is throwing this error on UI when I visit the url:

syntax error, unexpected ''/var/www/html/plugins/VisitTi' (T_ENCAPSED_AND_WHITESPACE), expecting ')'

I am loosing my critical important tracking data. Assuming this is free and reliable, we started using this but now I am stuck.

Business support is too costly and we can't afford that.. can anyone please have a look into this urgently.

My Matomo version is 3.4.0

Let me know if you need more information.

@Findus23
Copy link
Member

Findus23 commented Jul 6, 2018

Quick answer: look into the file the error mentions. Maybe it got corrupted.

Alternative would be replacing al files except for the config with the latest Matomo download (or even better download 3.4.0 from http://builds.matomo.org and after you fixed the issue update Matomo)

@jkjha
Copy link
Author

jkjha commented Jul 6, 2018

The problem is I have limited matomo server access , so I can't perform write operations there. Is there a way I can solve this from UI (browser)..

@huang0808
Copy link

I see your erro informaton, you firstly deactivate the plugin(var/www/html/plugins/VisitTi). Login Server, and enter your application run ./console plugin:deactivate pluginname.

@Findus23
Copy link
Member

Findus23 commented Jul 6, 2018

@jkjha
It would also help to see the full error. (e.g. from the php error_log)

There is no VisitTi, but just a VisitTime plugin. You can try disabling the plugin, but that isn't really a sulution as this plugin is quite required.

I would contact someone who has write access to your server

@jkjha
Copy link
Author

jkjha commented Jul 6, 2018

Thanks @Findus23 I have requested for write access to the server.. may be in some time I will get that..
I can disable the plugin as you suggested once I get the access.
But any suggestion how I can have a real fix for this?
I will provide more info in some time

@jkjha
Copy link
Author

jkjha commented Jul 6, 2018

here is more error.. I am not able to even deactivate the plugin

user@host-server:/var/www/html$ ./console plugin:deactivate VisitTime
Uncaught exception: syntax error, unexpected ''/var/www/html/plugins/VisitTi' (T_ENCAPSED_AND_WHITESPACE), expecting ')'
in /var/www/html/tmp/cache/tracker/eagercache-340-ui.php line 4709
#0 /var/www/html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php(63): Doctrine\Common\Cache\PhpFileCache->includeFileForId('eagercache-340-...')
#1 /var/www/html/vendor/piwik/cache/src/Backend/File.php(54): Doctrine\Common\Cache\PhpFileCache->doContains('eagercache-340-...')
#2 /var/www/html/vendor/piwik/cache/src/Backend/Chained.php(41): Piwik\Cache\Backend\File->doContains('eagercache-340-...')
#3 /var/www/html/vendor/piwik/cache/src/Eager.php(49): Piwik\Cache\Backend\Chained->doFetch('eagercache-340-...')
#4 /var/www/html/config/global.php(46): Piwik\Cache\Eager->__construct(Object(Piwik\Cache\Backend\Chained), 'eagercache-340-...')
#5 [internal function]: DI\Definition\Source\DefinitionFile->{closure}(Object(DI\Container))
#6 /var/www/html/vendor/php-di/invoker/src/Invoker.php(82): call_user_func_array(Object(Closure), Array)
#7 /var/www/html/vendor/php-di/php-di/src/DI/Definition/Resolver/FactoryResolver.php(81): Invoker\Invoker->call(Object(Closure), Array)
#8 /var/www/html/vendor/php-di/php-di/src/DI/Definition/Resolver/ResolverDispatcher.php(58): DI\Definition\Resolver\FactoryResolver->resolve(Object(DI\Definition\FactoryDefinition), Array)
#9 /var/www/html/vendor/php-di/php-di/src/DI/Container.php(287): DI\Definition\Resolver\ResolverDispatcher->resolve(Object(DI\Definition\FactoryDefinition), Array)
#10 /var/www/html/vendor/php-di/php-di/src/DI/Container.php(124): DI\Container->resolveDefinition(Object(DI\Definition\FactoryDefinition))
#11 /var/www/html/core/Container/StaticContainer.php(80): DI\Container->get('Piwik\\Cache\\Eag...')
#12 /var/www/html/core/Cache.php(56): Piwik\Container\StaticContainer::get('Piwik\\Cache\\Eag...')
#13 /var/www/html/core/Plugin.php(134): Piwik\Cache::getEagerCache()
#14 /var/www/html/core/Plugin/Manager.php(971): Piwik\Plugin->__construct()
#15 /var/www/html/core/Plugin/Manager.php(932): Piwik\Plugin\Manager->makePluginClass('CorePluginsAdmi...')
#16 /var/www/html/core/Plugin/Manager.php(853): Piwik\Plugin\Manager->loadPlugin('CorePluginsAdmi...')
#17 /var/www/html/core/Plugin/Manager.php(838): Piwik\Plugin\Manager->reloadActivatedPlugin('CorePluginsAdmi...', Array)
#18 /var/www/html/core/Plugin/Manager.php(690): Piwik\Plugin\Manager->reloadActivatedPlugins()
#19 /var/www/html/core/Plugin/Manager.php(105): Piwik\Plugin\Manager->loadPlugins(Array)
#20 /var/www/html/core/Console.php(204): Piwik\Plugin\Manager->loadActivatedPlugins()
#21 /var/www/html/core/Console.php(66): Piwik\Console::initPlugins()
#22 /var/www/html/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/html/console(27): Symfony\Component\Console\Application->run()
#24 {main}

@jkjha
Copy link
Author

jkjha commented Jul 6, 2018

this is the content from the cache (eagercache-340-ui.php)

    'PluginVisitTimeReports\\Piwik\\Plugin\\Report' =>
    array (
      '/var/www/html/plugins/VisitTime/Reports/GetByDayOfWeek.php' => 'Piwik\\Plugins\\VisitTime\\Reports\\GetByDayOfWeek',
      '/var/www/html/plugins/VisitTime/Reports/GetVisitInformationPerLocalTime.php' => 'Piwik\\Plugins\\VisitTime\\Reports\\GetVisitInformationPerLocalTime',
      '/var/www/html/plugins/VisitTime/

I had pasted last few lines.. as you can see this array seems uncomplete

@fdellwing
Copy link
Contributor

fdellwing commented Jul 6, 2018

As this is a cache file, you should be able to fix that by simply deleting the file.

@jkjha
Copy link
Author

jkjha commented Jul 6, 2018

yes, i was scared of deleting it.. but after simply deleting this it worked well.
Thanks for your time.
Meanwhile, can you please help me understand why this had happened.

@fdellwing
Copy link
Contributor

That is an interesting question, but I don't think it is worth the time (if it does not happen again of course).

@jkjha
Copy link
Author

jkjha commented Jul 6, 2018

yes, you may be right.
I am closing this PR, if anyone else faces this issue, feel free to reopen it.
Really appreciate @fdellwing @Findus23 @huang0808 for your timely help.

@jkjha jkjha closed this as completed Jul 6, 2018
@jkjha
Copy link
Author

jkjha commented Jul 7, 2018

OK, so I was able to find the root cause of this and able to reproduce this scenario.
This happens when server storage gets filled and there is no space to write in the cache log... that's why piwik could not write complete log inside cache "eagercache-340-ui.php" , and it causes syntax error.

Cleaning up the cache files and freeing up some more space, fixed this issue.

@jkjha jkjha reopened this Jul 7, 2018
@jkjha
Copy link
Author

jkjha commented Jul 7, 2018

my bad, reopened by mistake.

@jkjha jkjha closed this as completed Jul 7, 2018
@fdellwing
Copy link
Contributor

@tsteur @mattab Should Matomo handle this case? Could be hard, but maybe..mh..if tmp dir has less than N mb free space, don't write anything there and show a integrity warning? I think there is not really a nice way to handle this, sadly.

@mattab
Copy link
Member

mattab commented Aug 28, 2018

@fdellwing Good idea, something like this would be possible I think 👍 maybe a new diagnostic that checks there is at least a few Mb of free disk so we can write caches etc. Could you maybe create a new issue as this one is closed?

@mattab mattab added the duplicate For issues that already existed in our issue tracker and were reported previously. label Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

5 participants