"The requested URL was not recognized" when issue selected to schedule for publication

Hi there,

When I try to select an issue to schedule an article for publication, I get the now-familiar “The requested URL was not recognized” error. The URL returning the 403 is:

https://osotl.org/index.php?journal=osotl&endpoint=/osotl/api/v1/submissions/13/publications/13

I know the standard answer to these issues is to set disable_path_info to off but our host (IONOS) doesn’t support that.

base_url is set to “https://osotl.org
base_url[index] is currently commented out

I just upgraded to OJS 3.3.0.8.

Any ideas?

Thanks!

Matt

I’m wondering if that /osotl/ in the endpoint is the problem. The api directory is just in the root of the installation, as you’d expect. On the server, the website is contained within a directory called osotl.org (as determined by the hosting company).

Anyone? I’ve tried fiddling with the base_url settings but that doesn’t seem to be related to the path for the api stuff :frowning:

I have the same concern with article submission. My site is also hosted by IONOS. It seems the concern is linked with the last release ojs-3.3.0-8.

One of the reasons I updated to the latest release was to see if it fixed the issue - I was having the same problem with an earlier release. :frowning:

I’ve been using Firefox for this, which is where I see the 403. In Chrome, the developer tools show a 404:

/osotl/api/v1/submissions/13/publications/13

{error: "api.404.endpointNotFound", errorMessage: "The requested URL was not recognized."}
error: "api.404.endpointNotFound"
errorMessage: "The requested URL was not recognized."

However, the URL, when pasted into a browser, does work, and connects to the end point.

I’m pretty exasperated here - we can’t publish an issue.

Sorry to tag folk but I know that @asmecher and @jnugent have helped with similar issues in the past - any ideas?

Hi @matthewbarr,

I’m afraid you’re going to have to figure out how to get disable_path_info turned Off with the help of your host at some point. There are parts of the system that have never worked within spec when using disable_path_info, like the OAI-PMH interface (and this is beyond our control). There will be negative effects when your site is indexed by search engines like Google. Eventually we’re going to swap out the routing part of the software with something standard like Laravel’s router infrastructure. All of this is pointing towards support for that setting being removed; the disable_path_info setting should be considered deprecated and avoided.

When we first introduced disable_path_info it was because commodity web hosts often didn’t support our preferred URL scheme, which depends on the CGI PATH_INFO variable working properly. In recent years the number of hosts we observer with that configuration have dropped to near zero. I know that’s not what you wanted to hear, but I hope it provides something you can use to lean on your host to fix their configuration.

(Here is a similar discussion of your host and troubles running Moodle, with a suggested work-around that might allow you to get disable_path_info disabled with a few code changes.)

Thanks,
Alec Smecher
Public Knowledge Project Team

1 Like

Just in case someone else comes looking for a solution, I tried swapping out all references to PATH_INFO to ORIG_PATH_INFO but I get the same ‘URL not recognized’ message when I try to select an issue for publication, plus some more such messages in other places (e.g. the main Submissions page)

Interestingly, the endpoint being generated was exactly the same:

https://osotl.org/index.php?journal=osotl&endpoint=/osotl/api/v1/submissions/13/publications/13

For reference, here are the locations where I changed the PATH_INFO variable (on the server - this screenshot shows the local copy of OJS I used to locate instances of PATH_INFO):

PATH_INFO_OJS

I am now reverting back to using PATH_INFO so other parts of the site aren’t broken.

Hi @matthewbarr,

The change from PATH_INFO to ORIG_PATH_INFO is intended to facilitate/fix turning off the disable_path_info setting; if you leave disable_path_info turned On then you won’t see any difference as the PATH_INFO and/or ORIG_PATH_INFO variables won’t be used.

Regards,
Alec Smecher
Public Knowledge Project Team

Sorry for the slow reply. If I turn it Off, as intended, I get a 404 across the entire site.

If the endpoint https://osotl.org/index.php?journal=osotl&endpoint=/osotl/api/v1/submissions/13/publications/13 isn’t being generated correctly, can I hardcode in the right endpoint somewhere, just to be able to add articles to an issue?

Hi @matthewbarr,

Turning disable_path_info to Off will change the way that your site’s URLs are generated – e.g:

 https://osotl.org/index.php?journal=osotl&endpoint=/osotl/api/v1/submissions/13/publications/13

…would become the much friendlier…

https://osotl.org/index.php/osotl/api/v1/submissions/13/publications/13

However, if you’re following a link that was generated with disable_path_info turned On, it’s no surprise that it’ll result in a 404. Can you navigate your site from the root URL (https://osotl.org) with disable_path_info turned Off?

Regards,
Alec Smecher
Public Knowledge Project Team

Sorry for the slow response @asmecher - I will check this tomorrow. What I meant above was that after I had swapped out all the PATH_INFO references and set disable_path_info to Off, I got a 404 across the whole site, so I couldn’t see the new endpoint or anything else, and quickly reverted back to On with the PATH_INFO references restored. So, probably something else isn’t quite right in my set-up.

Replaced all instances of PATH_INFO with ORIG_PATH_INFO and set disable_path_info to Off again, and get a flat 404 across the whole site:

image

Maybe there are other settings (base_url?) I need to change, or (more likely) there’s something else broken in my installation. Obviously, having IONOS hosting is the root of the problem…

If I leave all the ORIG_PATH_INFO instances in place and go back to disable_path_info = On, the site keeps running (no 404s) but we get a ‘URL not recognized’ message on the Submissions page/dashboard. The web developer console suggests these are getting 403s:

https://osotl.org/index.php?journal=osotl&endpoint=/osotl/api/v1/_submissions&status=1&assignedTo=-1&searchPhrase=&count=30&offset=0&_=1638707578300

https://osotl.org/index.php?journal=osotl&endpoint=/osotl/api/v1/_submissions&status=1&searchPhrase=&count=30&offset=0&_=1638707578301

https://osotl.org/index.php?journal=osotl&endpoint=/osotl/api/v1/_submissions&status%5B%5D=4&status%5B%5D=3&status%5B%5D=5&searchPhrase=&count=30&offset=0&_=1638707578302

That probably doesn’t help, but interesting to note that we don’t get that error if we are using PATH_INFO, and the endpoints are reached successfully.

Not sure if it’s related, but previewing a galley results in a almost blank page (seemingly a 500 server error, according the the web dev tools)

image

Hi @matthewbarr,

That doesn’t seem related to me. You can check your PHP error log for details to go with that 500.

Regards,
Alec Smecher
Public Knowledge Project Team

OK, I have fixed it - really through blind luck - as follows:

  • Completely new install, to get rid of any previous fixes I’d tried.
  • Pointed to the existing database and copied the public directory etc. over.
  • Added a php.ini file to the root of my install, which contains a single line:

auto_prepend_file = set_path_info.php

  • Added that PHP file (also to the root of the install, as you’d expect) as follows:
<?php
if (getenv('ORIG_PATH_INFO')) {
    putenv("PATH_INFO=".getenv('ORIG_PATH_INFO'));
}
if ($_SERVER['ORIG_PATH_INFO']) {
    $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
}
if ($_ENV['ORIG_PATH_INFO']) {
    $_ENV['PATH_INFO'] = $_ENV['ORIG_PATH_INFO'];
}
?>
  • Set disable_path_info = Off

Thanks for your help @asmecher!

1 Like

Hi @matthewbarr,

Thanks for sticking with this and documenting the solution so well!

Regards,
Alec Smecher
Public Knowledge Project Team