Multiple versions of an article have missing galley files

Describe the issue or problem
We recently created a new version of an existing article and uploaded the associated galley files to that version and published it. Now when I attempt to view any of the galley files from the older version, they return 404 errors but the newer versions do not.

Steps I took leading up to the issue
For example:

  1. Unpublish an existing article
  2. Create a new version
  3. Add a galley file to the new version
  4. Re-publish
  5. View the article in the front-end, change to version #1 and click the galley link - it will 404. (Version #2 galley files look fine)

What application are you using?
OJS 3.3.0-19

Additional information
This is an anonymised log entry for one of the 404’s:

2025/10/23 13:13:56 [error] 85881#85881: *112264 FastCGI sent in stderr: “PHP message: ojs2: 404 Not Found” while reading response header from upstream, client: xx.xx.xx.xx, server: server.website.org, request: “GET /index.php/XX/article/download/47 HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php/php8.1-fpm.sock:”, host: “server.website.org”, referrer: “https://server.website.org/index.php/XX/article/view/47/version/38”

Additionally, I wrote a small utility to query the database, given an article ID it will return all versions and their galley files, shown red where the files do not exist and green where they do. However, in the first version (at the top of the screenshot) the galley files are missing and return 404 errors. The single green galley file in the first version was one I re-uploaded, so it DOES exist on disk, but it still returns a 404!

I’m stumped. Not sure what to do - any help is appreciated!

Quick update, seems I’ve opened a can of worms!
The submission_galleys database table is/was missing entirely from my installation, possibly as a result of a failed upgrade some time ago.

The database schema appears to have some issues also, the submissions_file_revisions table has a mismatch between the actual and expected fields: revision_id versus revision

I recreated the submission_galleys table and created the missing revision_id field and I’m hoping this will be sufficient to correctly reference galley files from now on as I’m assuming the backend functionality will work for future submissions.. That’s my hope at least, and I’ll post my results back here.

Is my installation broken? Could it be the result of a failed (silent) upgrade some time ago?

Another update:

SELECT * FROM versions WHERE product = ‘ojs2’;

This query indicates the updgrades that I performed recently and shows the upgrade path since the journal went live. You can see that the “Product” column indicates that the journal is running OJS2. Should this be showing OJS3?

major minor revision build date_installed current product_type product product_class_name lazy_load sitewide
2 4 6 0 2015-10-07 15:03:58 0 core ojs2 0 1
3 1 2 1 2019-08-22 13:55:01 0 core ojs2 0 1
3 1 2 4 2022-12-12 10:21:57 0 core ojs2 0 1
3 2 1 4 2022-12-12 10:25:25 0 core ojs2 0 1
3 3 0 11 2022-12-12 10:29:07 0 core ojs2 0 1
3 3 0 13 2022-12-12 10:36:30 0 core ojs2 0 1
3 3 0 14 2025-10-23 10:53:49 0 core ojs2 0 1
3 3 0 15 2025-10-23 11:53:50 0 core ojs2 0 1
3 3 0 16 2025-10-23 12:26:58 0 core ojs2 0 1
3 3 0 19 2025-10-23 12:29:58 0 core ojs2 0 1
3 3 0 20 2025-10-23 12:57:33 1 core ojs2 0 1

generated 2025-10-24 09:16:15 by HeidiSQL 12.11.0.7065

Is there a solution to this? It’s worrying that my OJS3 installation is flagged as being OJS2, and I suspect this may be the cause of our issues.

Hi @Ant_Forshaw,

The submission_galleys table shouldn’t exist in a OJS 3.3.0-x database; it was present in older branches, but was shifted to publication_galleys to accommodate submission versioning (where an article can have multiple versions) when that feature was added some years ago.

The ojs2 in the versions table is expected; eventually we’ll clean it up, but it’s just cosmetic, and best not to change.

Since you mentioned failed upgrades, are you sure you’re currently running a “clean” 3.3.0-x, or is it possible that there was a failed upgrade to 3.4.0-x? Check dbscripts/xml/version.xml to see what version your code is.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks Alex for the information - most useful, seems I’ve been chasing a wild goose with the submission_galleys direction. I’ll factor that into my investigations and post back here if I encounter any issues.

Kind regards,

Ant

1 Like

Update: I managed to find a solution that I could incorporate into my own theme. The galley_link.tpl file just needed to have the URL constructed correctly.. job done.

Many thanks for your help :slight_smile:

1 Like

This topic was automatically closed after 10 days. New replies are no longer allowed.