[Solved] Custom domain error ##api.submissions.unkownError## on OJS3.1.1

ojs3
#1

We did an upgrade from 2.4.8 to 3.1.1 (ex. Ojs.domain.com)
After some difficulties, we finally have almost everything running.
For some of our journals we have custom domains.(ex.: custom.domain.com) For these we have problems when we login and check the submissions:

We get the following 3 errors:
##api.submissions.unkownError##

after checking with developer tools on, we saw that it tries 3 api-call’s to get information from ex. following link: https://custom.domain.com//custom/api/v1/submissions?status=1&searchPhrase=&count=20&offset=0&=1524832825532 while https://ojs.domain.com/custom/api/v1/submissions?status=1&searchPhrase=&count=20&offset=0&=1524832825532 does give a result

As we could let it work without the custom domain (and then the journal name behind), we added some code in the .htaccess file that does a rewrite of the custom domain to the regular. But off course then we get another error that the script is called cross over domains and that fails again (even if we tell that it is allowed in the htacces-file:

Header set Access-Control-Allow-Origin “*”

): “ Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource “

Also we saw that in Edge the working links sometimes doesn’t work. No idea why.

Can someone help us out.
Because of this error we have the following problem:
“the submissions are not displayed not in my queue, unassigned, all active. Nothing is displayed”

Multiple Issue in OJS version 3.1.1.2
#2

I have the same problem, any guide please ???

#3

We are still having this issue. Nobody any idea what’s causing this?

Kind regards,
paul

#4

Hi @paul

Hmmm…
Do you also have the appropriate entries in the OJS config.inc.php file, concerning
base_url[index] and base_url[myJournal] ?

Best,
Bozana

#5

@ajnyga, sorry to involve you, but I believe you also have installation with different domains for different journals and you did not have this problem, correct?

#6

No problem @bozana, but we did not upgrade to 3.1.1 yet. We do have subdomains like name.journal.fi in use, so thanks for letting me know about this possible issue. I will start testing upgrade to 3.1.1.1 next week (right now on vacation)

#7

Great, thanks @ajnyga!
I don’t think that there is any difference between 3.1.0 and 3.1.1 regarding this, but… lets see…
Thanks!
Best,
Bozana

#8

I think I’ve seen this error in some of my local XAMPP test servers, but can not recall in what circumstances it occurred.

#9

the “base_url[index] and base_url[myJournal]” is there in the config.inc.php.
We only tested on 3.1.0 but without the custom domain names … so I don’t know if there is a difference between 3.1.0 and 3.1.1.

Api submission Uknown Error
#10

Hi @paul

I mean are those options/settings in the config.inc.php properly set? Did you have the same situation in OJS 2.4.8?

What do you mean, that you tested it with 3.1.0?

Thanks!
Bozana

#11

hi bozana,

We had the same situation in 2.4.8., but did’nt have any problems. Before upgrading to version 3 we ran tests in 3.1.0 … but without the custom domains.

Here is our config:
base_url[SCAD] = https://ojs.ugent.be/SCAD
base_url[BMGOG] = https://ojs.ugent.be/BMGOG
base_url[hmgog] = https://ojs.ugent.be/hmgog
base_url[OZ] = https://ojs.ugent.be/OZ
base_url[silva] = https://ojs.ugent.be/silva
base_url[deuilvanminerva] = https://ojs.ugent.be/deuilvanminerva
base_url[agora] = https://ojs.ugent.be/agora
base_url[jeps] = https://ojs.ugent.be/jeps
base_url[broodenrozen] = https://ojs.ugent.be/broodenrozen
base_url[handelingen] = https://ojs.ugent.be/handelingen
base_url[AF] = https://ojs.ugent.be/AF
base_url[documenta] = https://documenta.ugent.be
base_url[authorship] = https://www.authorship.ugent.be
base_url[ichmet] = https://ojs.ugent.be/ichmet
base_url[test] = https://ojs.ugent.be/test
base_url[gvg] = https://ojs.ugent.be/gvg
base_url[GT] = https://ojs.ugent.be/GT
base_url[VMD] = https://ojs.ugent.be/VMD
base_url[jhes] = https://ojs.ugent.be/jhes
base_url[TGTIC] = https://ojs.ugent.be/TGTIC
base_url[tic] = https://ojs.ugent.be/tic
base_url[jolcel] = https://jolcel.ugent.be

#12

After searching and searching we found that this trick solved our problem (but wasn’t needed in ojs 2.4.x)
By adding the following line: RewriteCond %{REQUEST_URI} !api/v1/ in the .htaccess file:

RewriteCond %{SERVER_NAME} ^.custom.domain.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !api/v1/
RewriteRule ^(.
)$ index.php/custom/$1 [L]

Now it seems to work. Thanks for your help!

1 Like
Api submission Uknown Error
Api submission Uknown Error
#13

Hi,

The restful_urls = On remove the index.php between localhost/ and /journal and this causes the 404 error.

http://localhost//journal/api/v1/submissions?status=1&assignedTo=-1&searchPhrase=&count=20&offset=0&=15299993396

When I put index.php manually in the request it works fine.

http://localhost/index.php/journal/api/v1/submissions?status=1&assignedTo=-1&searchPhrase=&count=20&offset=0&=15299993396

I don’t know how to repair this error in jQuery request. Could someone help me?

#14

Hi @Gecuimar,

I see you’ve already posted this on another thread. Please don’t double-post; it clutters the forum.

Regards,
Alec Smecher
Public Knowledge Project Team

#15

Hi @bozana

An update to this issue. We did run into this with the subdomains. I have updated a new version of our mod_rewrite rules here How to remove index.php in ojs 3.0.2.0. They seem to solve the problem with the api calls in subdomains.

Edit: just noticed that @paul has a similar solution above. In our case I could not get it working with a one line solution like that. The difference in our setup is that we use wildcard subdomains.

The XAMPP related problem I mentioned is occurring because of the double slash // in api url. This can be solved by adding these new lines in the mod_rewrite rules before any other rules:

RewriteCond %{REQUEST_URI} ^(.)/{2,}(.)$
RewriteRule (.*) %1/%2 [R=301,L]

[Solved] Problems with api submissions error on submissions page
#16

I also suddenly started getting this error today (OJS 3.1.1.1), however I didnt make any update or change. Using above 2 lines in mod_rewrite seems working.