UsageStatsPlugin asserting after an upgrade

I’ve recently upgraded to 2.4.8.1 from 2.2.2 and I’ve run into a lot of problems. The below error in particular has been clogging up my logs. Should I delete the contents of the usageStats directory in my files_dir?

ojs2 has produced an error\n Message: WARNING: assert(): Assertion failed\n In file: /home/sites/epubs.utah.edu/plugins/generic/usageStats/UsageStatsPlugin.inc.php\n At line: 443\n Stacktrace: \n Server info:\n OS: Linux\n PHP Version: 5.5.9-1ubuntu4.20\n Apache Version: Apache/2.4.7 (Ubuntu)\n DB Driver: mysql\n DB server version: 5.5.54-0ubuntu0.14.04.1

Hi @califer,

That suggests that OJS doesn’t have permissions to lock a log file. Ensure that your file permissions are set according to this FAQ entry.

Regards,
Alec Smecher
Public Knowledge Project Team

my Server API is “Apache 2.0 Handler”, which doesn’t match either of the options listed. I have the owner of the folders listed (the files_dir, cache, public and all subdirectories) as root and the group as www-data. permissions on the folders are 775.

The cache folder is creating things with the owner and group as www-data and permissions of 644.

I’m still getting the same error.

More importantly, it still contantly kicks me out when I’m trying to login. The console shows the error “Uncaught TypeError: Cannot read property ‘username’ of undefined at login:191”.

Hi @califer,

The problem is the line of code…

 flock($fp, LOCK_EX);

This attempts to lock the log file, meaning that other processes can’t use it for a brief moment while it commits its own changes.

What kind of OS are you running your system on?

(Regarding the other issue of being logged out – could you post that on a new thread? That’ll help keep the forum organized.

Thanks,
Alec Smecher
Public Knowledge Project Team