JSON Issues after Installing Plugins

ojs3
#3

Hi @fpannach,

For some reason JSON is malformed. Path to the TabHandler.js is: lib/pkp/js/controllers/TabHandler.js

#4

Dear @Vitaliy,
thanks. It seems the code already includes the fix. https://github.com/asmecher/pkp-lib/commit/65475ba862e1ed5cad8f03ea34680be86a3dbe7e

#5

Does your OJS instance have that commit?

#6

I am running 3.1.2, I think the fix was for 3.1.1.4 (?).

#7

Yes, it should be fixed, but I’d double check.

Also, do you see anything relevant regarding requests and responses upon plugin activation, e.g. under network tab of Google Chome browser? Is there something with status code not 200?

#8

Everything has status code 200, but when I checked the plugin activation, I could actually see the list of plugins. However, after activating/deactivating the custom block plugin again, now the plugin list too is a white page.

Maybe to clarify, the plugin actually worked the first time I activated it, but it resulted in AJAX errors when I wanted to do new submissions.

Also, I am using this docker image: https://github.com/TypesetIO/pkp-ojs-docker

#9

Do you see any Fatal Errors in the logs? If the plugins page doesn’t load, there should be something reflected in PHP logs.

#10

btw thanks for looking into this

No, for some reason, the error log (inside the container /var/log/apache2) is completely empty.

#11

Unfortunately I haven’t got any experience with Docker and its logging to outside the container. Maybe @NateWr knows more.

#12

Also, the docker logs do not show any error messages:

[OJS Startup] Started cron
[OJS Startup] Starting apache… You’ll be good to go after this…
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.23.0.2. Set the ‘ServerName’ directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.23.0.2. Set the ‘ServerName’ directive globally to suppress this message
[Thu May 09 07:07:41.206491 2019] [mpm_prefork:notice] [pid 8]
AH00163:Apache/2.4.25 (Debian) PHP/7.2.17 configured – resuming normal operations
[Thu May 09 07:07:41.206542 2019] [core:notice] [pid 8]
AH00094: Command line: ‘apache2 -D FOREGROUND’

#13

Is this problem reproducible without Docker?

#14

I installed OJS 3.1.2 [without dockerization] on my local machine and it seems to work fine, before and after enabling plugins (Custom Block & DOI)

#15

So, the problem is probably in Docker image :slight_smile: I think it’s better to contact its developer. The only thing that I see is that this script doesn’t compile js:

npm install
npm run build

In your install, does OJS download via pkp.sfu.ca or git?

#16

It’s downloaded from the pkp website

#17

I rebuilt the docker container and installed nodeJS/npm inside the container although the installation should have come with npm already since it was downloaded from pkp.sfu.ca. After reinstalling everything, I have the same issue as before wtith saving the metadata: OJS 3 Submission metadata saving issues

#18

Here some errors from the browser console. PHP errorlog inside the container + Docker logs are still empty.

Opera just shows a blank screen after sign in, Firefox shows the frame of the submission workflow but the inner sections are blank.

#19

The error says that JSON data here is malformed: https://github.com/pkp/pkp-lib/blob/master/js/controllers/TabHandler.js#L263

Can you look at the output of the jsonString either from the Chome’s Network tab or directly via console: console.log(jsonString); (turn config setting enable_minified to off).

#20

E.g., in my case when changing tabs that represent submissions workflow stage I receive:

content: "the content of response here"
elementId: "0"
events: null
status: true

It probably would be a starting point for debugging - to look what is missing or malformed.

#21

Thank you Vitaly, we are building a new OJS dockerization from scratch now. Let’s see if the problem still persists.

#22

I would check what is wrong with the response and its type. It may be related to this issue: Setting tabs not loading - Unexpected end of JSON