PDF not loading in OJS 3.0

Hi @dalmasont,

I would suggest looking around your log files for something that provides more detail about that 500 Internal Server Error. You may have a different Apache error log from your PHP error log.

Regards,
Alec Smecher
Public Knowledge Project Team

The error 500 is because the file wasn’t finded. That’s what the server admin says.

There where 37 articles in the journal. I manually update each one and now the pdf can be loaded.

Probably ther is some apache misconfiguration, but for me, the manual update was enough.

Once more, thank you for all the help!!!

Hello all,
I have similar issues. PDFs not loading.
I have upgraded OJS 2.4.6 to 3.0.2 on Linux (complete package with duplicated database and files).
PHP version - 5.6.30
Apache version - Apache/2.4.23
Database driver - mysql
Database server version - 5.6.35-cll-lve

I have double checked the file path, its correct, and so are the file permissions I believe.
Any help would be appreciated.
Thanks.

Hello,
Is it OK to cup-paste the error log here?
BW

Hi @miranda

The update to OJS 3 reorganizes the files in the file_dir. Was your upgrade without any warnings? Have you checked the access permissions in your file_dir and that the actual PDF file is there and in the correct subfolder?
Else, yes, if there are any errors in your PHP error log file, when viewing the PDF, you can post them here – you can remove the sensible information (e.g. IP a addresses) before copying them here…

Best,
Bozana

Hi, thanks for the reply.
There were warnings…

Strict Standards: Declaration of DevelopedByBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in root/public_html/170729johr/plugins/blocks/developedBy/DevelopedByBlockPlugin.inc.php on line 79

Strict Standards: Declaration of DevelopedByBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in root/public_html/170729johr/plugins/blocks/developedBy/DevelopedByBlockPlugin.inc.php on line 79

Strict Standards: Declaration of DevelopedByBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in root/public_html/170729johr/plugins/blocks/developedBy/DevelopedByBlockPlugin.inc.php on line 79

Deprecated: Non-static method Application::getName() should not be called statically, assuming $this from incompatible context in root/public_html/170729johr/lib/pkp/classes/install/form/InstallForm.inc.php on line 146

Deprecated: Non-static method Application::getName() should not be called statically, assuming $this from incompatible context in root/public_html/170729johr/lib/pkp/classes/install/form/InstallForm.inc.php on line 148

Deprecated: Non-static method Application::getName() should not be called statically, assuming $this from incompatible context in root/public_html/170729johr/lib/pkp/classes/install/form/InstallForm.inc.php on line 150

Deprecated: Non-static method VersionCheck::getCurrentCodeVersion() should not be called statically, assuming $this from incompatible context in root/public_html/170729johr/lib/pkp/classes/install/form/MaintenanceForm.inc.php on line 37

Strict Standards: Non-static method Version::fromString() should not be called statically in root/public_html/170729johr/lib/pkp/classes/site/VersionCheck.inc.php on line 115

Deprecated: Non-static method PKPRequest::getUserVar() should not be called statically, assuming $this from incompatible context in root/public_html/170729johr/lib/pkp/classes/form/Form.inc.php on line 351

Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in root/public_html/170729johr/lib/pkp/classes/core/PKPRequest.inc.php on line 582

Sharing the PHP error log file…

Thanks in advance.
BW

hi @miranda

It seems like the upgrade did not work well – there were some warnings: “Unable to find a match for…” and “copy… failed to open stream”. This means that those files in the OJS files_dir could not be found and reorganized by the upgrade script. Could you double check you OJS 2.4.x installation and files_dir, if these files are there and eventually correct them (best via the GUI)? Also please double check the permissions for the files_dir content.
Once you have fixed the files and permissions, you should do the upgrade anew, on the fixed OJS 2.4.x backup data + files.

Best,
Bozana

1 Like

Hello @bozana,
I installed afresh.
The pdfs are loading now. Thanks. And I have no clew what went right :wink:
I still got those errors while upgrading. Anything that I should look into.
Best wishes,

Hi @miranda

If you still had the errors I mentioned in the post above, you should take care of them and check what is wrong with those files in OJS 2.4.x. The other errors/warnings, like strict standard and deprecation, are not important.

Best,
Bozana

1 Like

Hi @asmecher

I am upgrading OJS 2.4.6 to 3.0.2 now.

I am having the same errors when opening PDF view of articles.

Stack Trace:

File: (unknown) line (unknown)
Function: FileApiHandler->downloadFile(Array(4), Object(Request))

File: //lib/pkp/classes/core/PKPRouter.inc.php line 372
Function: call_user_func(Array(2), Array(4), Object(Request))

File: //lib/pkp/classes/core/PKPComponentRouter.inc.php line 262
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(4))

File: //lib/pkp/classes/core/Dispatcher.inc.php line 134
Function: PKPComponentRouter->route(Object(Request))

File: //lib/pkp/classes/core/PKPApplication.inc.php line 227
Function: Dispatcher->dispatch(Object(Request))

File: //index.php line 68
Function: PKPApplication->execute()

Recently I found that files_dir path was wrong in the config file during the upgrade.

Journal manager was unable to login with existing login credentials and some images were missing after upgrade.

Is there a way to fix these issues or I have to do a fresh upgrade again?

Thank you

Hi @LaxMariappan

If the files_dir path was wrong during the upgrade you will have to do the upgrade again – the upgrade makes some restructuring of the files there, important for OJS 3.x to work properly…

Best,
Bozana

Hi @bozana,

I have used a subdomain for upgrade and missed to change files_dir path. I found some image files were missing and PDF view not loading.

I will do a fresh upgrade again

Best,
Lax

You have to perform the update step by step.
Download the source code for the updated version.
We copy the contents of /public and the files folder.
We import the database.
Configure the config.inc.php file. “Very important” put the path of the files directory.
We do the update.

I solved!

In my case I had 2 journals in the folder home/public_html/ojs/files/journals : 0 and 1.
I checked that in folder 1 there was no PDF. Only in folder 0.
So I delete folder 1 and rename folder 0 to 1.

It worked for me!

PS: Sorry for my English