usageStats and Baseurl changed from http to https

Hello everyone,
I am pretty new and have inherited the maintenance of an OJS Journal ( 3.1.1.4)

My issue is that my stats are at 0 since we moved from http to https. I have read some other topics but can’t figured it out what i have to do exactly.

So here is what i have in my usageStats Folder:

  • archive folder is filled with usage_events_xxxxxxxx.log but stopped at the date we changed from http to https
  • processing folder has only one file : the usage_events log from today
  • there is nothing in reject folder
  • stage folder has a lot of usage_events log from the day i changed the base url to today
  • in folder scheduledTaskLogs i have a lot of ##plugins.generic.usageStats.usageStatsLoaderName## with each time this line : ##plugins.generic.usageStats.processingPathNotEmpty##
  • in config file, my base_url is right
  • in DB, metrics table has entry but stopped the day i switch to https
  • I am using acron

Can someone help me?

Thank you in advance !

Hi @long,

The first thing I’d recommend is to read our documentation on processing log files.

It sounds to me like all of the log files have been staged for processing but not processed. You may be able to follow the directions to manually process those and recover the statistics for the missing dates.

However, it is still the case that you need the logs to be processed automatically, so let’s see if we can figure out why they are getting stuck in the stage folder. From looking at the code, it seems like they can get stuck there if they are not claimed and processed or if there is an error during the processing and they are moved back into the stage directory.

I’d recommend inspecting FileLoader::executeActions() while processing staged files to see if you can figure out whether the process is executing and, if so, when it might be failing.

Thank you @NateWr
I have read the documentation and it’s quite technical but i’ll give it a try.
Do you think this issue would be related to mine?

Yes, that could definitely be it. However, I’m confused about why you have so many log files in the stage folder. If the base_url doesn’t match, the log entry should be skipped but the file should still be processed and archived.

Hello @NateWr,
I have setup a local test env and copy my OJS there.
In every log files i have find and replace URLS to reflect my local base_url. Then i moved all the logs in archive folder to stage folder and ran the process 1 ( as stated in your doc)
It ran and at one moment i have a fatal error:

[23-Nov-2020 12:15:09 Europe/Berlin] PHP Notice:  unserialize(): Error at offset 1149 of 1164 bytes in /Applications/MAMP/htdocs/droz.local/lib/pkp/classes/db/DAO.inc.php on line 352
[23-Nov-2020 12:15:09 Europe/Berlin] PHP Strict Standards:  Non-static method Core::removeBaseUrl() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/htdocs/droz.local/lib/pkp/plugins/generic/usageStats/PKPUsageStatsLoader.inc.php on line 508
[23-Nov-2020 12:15:09 Europe/Berlin] PHP Strict Standards:  Non-static method Core::_getBaseUrlAndPath() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/htdocs/droz.local/lib/pkp/classes/core/Core.inc.php on line 256
[23-Nov-2020 12:15:09 Europe/Berlin] PHP Strict Standards:  Non-static method Config::getContextBaseUrls() should not be called statically, assuming $this from incompatible context in /Applications/MAMP/htdocs/droz.local/lib/pkp/classes/core/Core.inc.php on line 313
[23-Nov-2020 12:15:09 Europe/Berlin] PHP Strict Standards:  Declaration of SubmissionFileDAO::fromRow() should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation) in /Applications/MAMP/htdocs/droz.local/classes/article/SubmissionFileDAO.inc.php on line 23
[23-Nov-2020 12:15:09 Europe/Berlin] PHP Fatal error:  Call to a member function getCategory() on a non-object in /Applications/MAMP/htdocs/droz.local/plugins/generic/usageStats/UsageStatsLoader.inc.php on line 79

Could this explained why i have so much files in my stage folder? and how cn i correct this error?