Upload of large files hangs interface, no error message

OJS 3.3.0.6

We are having an issue uploading some larger files to OJS. When uploading, the progress bar goes all way and then hangs, nothing ever happens after that. No error messages. This happens to files that seem to be over 10MB. A 13MB Word document did not upload, but zipped at 9MB it uploaded no issue. We also have authors trying to submit 20MB files and are unable to.

Have checked: FAQ about Errors and Troubleshooting in Open Journal Systems (OJS), Open Monograph Press (OMP), and Open Preprint Systems (OPS), and here are my hosting settings:

  • post_max_size: 512M
  • upload_max_filesize: 512M
  • memory_limit: 256
  • max_execution. 120
2 Likes

Hi @guitman444

I suspect I know what this. Can you or your systems person make the following small change?

Can you edit the file at

lib/pkp/controllers/api/file/PKPManageFileApiHandler.inc.php

And find the line around line 225 and comment out (add // before the line) where it says:

$articleSearchIndex->submissionFilesChanged($submission);

So it reads

//$articleSearchIndex->submissionFilesChanged($submission);

and try uploads again?

Cheers,
Jason

1 Like

I can edit this file. However, we really try to abide by a policy of not altering core files.

It seems this comment will disable indexing during the submission process? If so, and your recommendation works, is this a bug to be addressed in a future release?

Thanks!

hi @guitman444

The change disables the file indexing when the file is first uploaded. I’ve never really understood why files are indexed when they are uploaded, and not just when an article is published or a version changed, but with large sites with lots of files, the search index can grow to millions of records and there can be lag when files are uploaded. You can always just kick off a manual reindex using the command line tool

php tools/rebuildSearchIndex.php

after you publish an issue or make a change.

Cheers,
Jason

And I’m not really sure if it counts as a bug or not, but I think that future versions of OJS will include task queuing and that may provide a solution for this.

Hello @guitman444,

you can temporarily disable the indexing also with a plugin hook as describe in a previous post here:

We had the same issue in our largest 3.1.2-4 installation

Tried the modification of lib/pkp/controllers/api/file/PKPManageFileApiHandler.inc.php. Upload still fails. Attached is a screenshot. Screen Shot 2021-11-01 at 3.08.18 PM

This one gave the HTTP Error, but sometimes it just hangs at the end of the blue progress bar.

Also, it was line 155, not 255.

Hi @guitman444

If you’re getting an HTTP error, there is probably a corresponding error in your error log on the server.

Best
Jason

I’m having nearly the same problem here. Except we cannot upload any files over 1.5M. We are Running the same version of OJS.
My settings in php.ini are:

  • post_max_size: 12M
  • upload_max_filesize: 14M
  • memory_limit: 15
  • max_execution. 30

I have commented out the file mentioned in this thread: (see below) And tried uploads again with same results. I also have checked my error.log file are there are no corresponding errors to our upload issue. We do get the error HTTP error, but we know it’s related to file size because if we upload under 1MB, they upload fine without issue. We are open to any suggestions!
Many thanks!

edit the file at

lib/pkp/controllers/api/file/PKPManageFileApiHandler.inc.php

And find the line around line 225 and comment out (add // before the line) where it says:

$articleSearchIndex->submissionFilesChanged($submission);

So it reads

//$articleSearchIndex->submissionFilesChanged($submission);

Hi @jules

Can you confirm that your php.ini settings are in fact what you think they are? Apache may be using a different .ini file, or perhaps the settings are being overridden elsewhere. You can use the “more info” area in the OJS Administration area to know for sure.

Best,
Jason

Mine are as shown in the initial post.

  • post_max_size: 512M
  • upload_max_filesize: 512M
  • memory_limit: 256
  • max_execution. 120

Great suggestion @jnugent ! I actually wasn’t 100% sure which php.ini file was being used so I made the changes to both (/etc/php/7.4/apache2/php.ini and /etc/php/7.4/cli/php.ini) After reviewing your suggestion, the correct path is in…/apache2/php.ini — Which does have the upload_max_filesize set to 12M. Just for kicks, I increased both to 50M, (upload_max_filesize and post_max_size) but still get error that
image

image

Many thanks for your suggestion.

Hi @jules

It concerns me that the error page is showing NGINX as a web server, not Apache. But perhaps it is using the same configuration.

But “413 Request Entity Too Large” is something else entirely. It’s related to file sizes but not quite. Here’s a good article about it:

Best
Jason

1 Like

Hi Jason, thanks again for your guidance.

I thought it odd mentioning nginx in that error also as nginx is definitely not installed on this server. It does run Apache only. I’m unfamiliar with nginx as I’ve always only run Apache on my servers.
As a clarification: That 413 error displays when attempting to upload an ARTICLE. I get the http error when attempting to upload a GALLY.
image

The line of code mentioned in the article you sent ```
LimitRequestBody 104857600


Unfortunately, I get the same results.  It just seems like it should be an easy fix. Darn it all.
I do need to update to the latest version of ojs.....  so maybe ???  Strangely enough, we were able to upload larger files when we were on an older version of OJS
Thank you muchly.

I finally was able to find a log error on the server:

[Thu Nov 18 11:33:52.540151 2021] [fcgid:warn] [pid 19635:tid 139931732940544] (28)No space left on device: [client masked:55930] mod_fcgid: can’t write tmp file for stdin request, referer: Login | Pathogens and Immunity

Not sure why it says no space left on device. It gives the client IP (my machine) in the log file. My machine and the server has plenty of room on it. Any ideas?