The requested URL was not recognized, OJS version 3.3.0.6

Hello everyone,

Please help me with the problem:

When I try to Schedule For Publiction an article, I have a pop-up - The requested URL was not recognized.

In the console it writes: Failed to load resource: the server responded with a status of 403 (Forbidden)

My system OJS version 3.3.0.6
OS platform FreeBSD
PHP version 7.4.0
Apache version Apache/2.2.34 (FreeBSD)
Database driver mysql
Database server version 5.5.62-log

Server http logs shows:
[Wed Jun 16 12:37:47 2021] [warn] [client 185.132.1.126] mod_fcgid: stderr: PHP Warning: Declaration of ManageCopyeditFilesForm::execute($stageSubmissionFiles, $fileStage = NULL) should be compatible with ManageSubmissionFilesForm::execute($stageSubmissionFiles = NULL, $fileStage = NULL, …$functionArgs) in /sata2/home/users/ozhurnal/www/ojs.ozhurnal.com/lib/pkp/controllers/grid/files/copyedit/form/ManageCopyeditFilesForm.inc.php on line 33, referer: http://ojs.ozhurnal.com/index.php/files/workflow/index/83/4

Hi @Ozh

What URL is being marked as 403/Forbidden?

Cheers,
Jason

Dear Jason,

URL ojs.ozhurnal.com/index.php/files/api/v1/submissions/62/publications/62

Thank you in advance,
Yevheniia

When I open this link {“error”:“api.404.endpointNotFound”,“errorMessage”:“The requested URL was not recognized.”}

Hi @Ozh,

Thanks for being patient. This took me a while to figure out because I needed to set up my own 3.3 install. I had a hunch and needed to test it.

It turns out that when you schedule for publication, the API handler call ultimately first lands in the index.php file present in /api/v1/submissions/index.php and that file examines the $requestPath to see if it should route it to the files handler by doing:

if (strpos($requestPath, '/files')) {
	import('lib.pkp.api.v1.submissions.PKPSubmissionFileHandler');
	return new PKPSubmissionFileHandler();
}

And in your case, the $requestPath would be /index.php/files/api/v1/submissions/65/publications/65 because your journal path is “files” and what’s happening here is that index.php is seeing the /files bit and sending the request to the wrong handler because it thinks you’re doing something with files, when you are in fact not. You’re getting a 404 “end point not found” error because the schedule for publication end points are not in the API handler that’s being called.

I duplicated this locally and the problem goes away if I change my journal path to something else.

I’m tagging @asmecher and @NateWr because this is probably a bug (I’ve never seen a journal created with a path of “files” before).

Cheers,
Jason

Hi @jnugent / @Ozh,

I’ve filed this for attention at Journal path of "files" has unexpected behaviour · Issue #7152 · pkp/pkp-lib · GitHub – it does look like that code will mistakenly treat requests with the wrong handler because you’ve used files for your journal path.

I’ll close this thread but watch for progress on the issue linked above.

Regards,
Alec Smecher
Public Knowledge Project Team