PKP Usage statistics report missing in OJS 3.1.1-4

Hi,

in a fresh OJS 3.1.1.-4 installation, the Usage statistics report is missing:

usageStatsReportMissing

Resulting in the Report Generator loading the form in vain.

The code (e.g. plugins/generic/usageStats/UsageStatsReportPlugin.inc.php and
/lib/pkp/plugins/generic/usageStats/PKPUsageStatsReportPlugin.inc.php) is there.

best,
Carola

I think they moved that to a new independent repository. Did you install using git?
edit: no sorry, actually 3.1.1 stable should still have that in the OJS package, so the submodule is probably planned for 3.2 GitHub - pkp/usageStats

ping @asmecher this is not solved although answered…

Yes, I installed via git. Logging and processing the data seems to be okay, there are entries in the metrics table.

best,
carola

P.S. Error message: “ojs2: Invalid metric type”

I’m also seeing this on one of our 3.1.1 installs. From what I can tell, defaultMetricType is just null but should be ojs::counter which I assume is supplied by the plugin, but the plugin doesn’t show despite it being right there in the code.

Hi all,

Hmmm… this is strange… That report plugin should be there. I only once heard from an user (@Lazar_Stosic) a similar issue – for some reason that report plugin could not be registered correctly at/for the page Tools > Statistics… I couldn’t figured out then why is this happening :frowning: Especially because I cannot reproduce it, and as I said I only heard of the similar issue once… I’ll take a new look into it…

Best,
Bozana

I have full access to the server, so can provide any information that might help.

Hi @bozana and @rm_is_too_short,

I made two new installations (IJS-3.1.1-4) on two different servers and the result (one is okay, the other is missing the report plugin as well) suggests that it is dependent on the server. I’ll try to find out what the difference is.

On the server with the report plugins missing, I have two other OJs 3 installations where the report plugin works fine (both OJS 3.1.1-2).

best,
Carola

Thanks a lot @carola! Any debugging i.e. trying to figure out why is this happening would be great! Because I cannot reproduce it I cannot debug it properly… :frowning:

Best,
Bozana

Hi @bozana,

I still have no idea what causes the problem. I have

Server 1: Report works for all installations

Server 2: Report works for OJS 2 installations and for OJS 3 installations up to 3.1.1-2, but not for 3.1.1-4

On Server 2 I upgraded an OJS 2.4.8-Installation where the report worked fine, and after the installation, the report plugin vanished from the plugin list. So it seems to be the combination of server and OJS-Version.

I upgraded npm and the OJS 3.1.1-4 installation on Server 2, but it did not help.

Do you have any other idea what to test or how I can try to reinstall the plugin to get an error message? Tools/installPluginVersion.php does not work for the Usage Stats Plugin.

best,
Carola

Hi @rm_is_too_short,

what OJS version to you have?

best,
Carola

Hi @bozana,

now it works for one of the installations, but I am not sure why. I deleted the entry in the versions table and ran the upgrade again. This did not work at once, but at some point I could load the report.

Still, the entry in the versions table is not correct:

versions

best,
Carola

We’re running version 3.1.1.2 here.

Hi @carola

Hmmm… I did not totally understand what is/was wrong with the entries in the DB table versions? What reports plugins do you see there?

Thanks a lot!
Bozana

Hi @bozana

I think our situation is somewhat similar to that of @carola. For what it’s worth, we have the standard “Articles Report”, “COUNTER Reports”, “Review Report” and “View Report” installed and enabled. Hope that helps.

//@jmesser

@Bozana,

in an installation where the plugin was installed correctly, there are entries for the report plugin and the block plugin. I don’t know if this makes a difference.

versionsTableUsageStats

best,
Carola

Well. I have a workaround:

update versions set product=‘_usageStats’ where product=‘usageStats’;

Then reload the plugins page and everything’s as it should be.

Edit to hypothesize: This is a 3.1.1.2 installation that was upgraded from 2.4.8. Seeing multiple entries in the versions table for the same plugin, and from reading through the plugin code, it looks like the plugins are scanned fairly continuously. So removing (or renaming) the entries in the versions table should result in a fresh scan of the plugins, which it seems is what happened. Here’s the versions table after the rescan:

MariaDB [ubco]> select * from versions where product like '%usageStats%';                                                            
+-------+-------+----------+-------+---------------------+---------+-----------------+-------------+--------------------+-----------+----------+
| major | minor | revision | build | date_installed      | current | product_type    | product     | product_class_name | lazy_load | sitewide |
+-------+-------+----------+-------+---------------------+---------+-----------------+-------------+--------------------+-----------+----------+
|     1 |     0 |        0 |     0 | 2015-04-14 11:54:04 |       1 | plugins.generic | _usageStats |                    |         0 |        1 |
|     1 |     0 |        0 |     0 | 2018-04-04 14:17:02 |       1 | plugins.reports | _usageStats |                    |         0 |        1 |
|     1 |     0 |        0 |     0 | 2018-04-04 14:17:02 |       1 | plugins.blocks  | _usageStats |                    |         0 |        1 |
|     1 |     0 |        0 |     0 | 2018-11-22 16:21:30 |       1 | plugins.generic | usageStats  | UsageStatsPlugin   |         0 |        1 |
+-------+-------+----------+-------+---------------------+---------+-----------------+-------------+--------------------+-----------+----------+

I think the resulting “_usageStats” entries are harmless, but I kept them just in case they needed to be reverted.

Hi all,

Hmmm… I have to admit that I am a little bit confused :-\ I have two OJS 3 installations: one has only one entry for the plugins.generic usageStats, and the other has three for plugins.generic, plugins.report and plugins.blocks. And they both work well for me :open_mouth:

Thanks for reporting the solution @rm_is_too_short!
@carola, when you just leave the plugins.generic DB entry in the installation that is not working i.e. when you proceed like @rm_is_too_short, does this solve the problem?

Hmmm… :thinking:
Thanks!
Bozana

Hi @bozana,

for me, everything works fine now. As I wrote above, it worked after deleting the entries in the versions table an running the upgrade script. I don’t know if it makes a difference that the report and the block plugin are not listed in the versions table. Currently I do not notice any differences in the frontend.

I did not find out why the report plugin was not installed correctly during the main installation. I will wait and see if this happens again when running a new installation on that server.

best,
Carola

OK, thanks a lot @carola!

1 Like

Hello, i have the same problem, but i have that

MariaDB [ojs]> select * from versions where product like '%usageStats%'; 
+-------+-------+----------+-------+---------------------+---------+-----------------+------------+--------------------+-----------+----------+
| major | minor | revision | build | date_installed      | current | product_type    | product    | product_class_name | lazy_load | sitewide |
+-------+-------+----------+-------+---------------------+---------+-----------------+------------+--------------------+-----------+----------+
|     1 |     0 |        0 |     0 | 2018-01-26 13:31:16 |       1 | plugins.generic | usageStats |                    |         0 |        1 |
|     1 |     0 |        0 |     0 | 2018-09-04 13:33:54 |       1 | plugins.reports | usageStats |                    |         0 |        0 |
+-------+-------+----------+-------+---------------------+---------+-----------------+------------+--------------------+-----------+----------+
2 rows in set (0.00 sec)

What can i do? Thanks