An unexpected error has occurred. Please reload the page and try again. POPUP

Does anyone know what is causing this error or have a solution on ojs version 3.1.2-1? I get a pop up saying what in the title and most of my submissions are missing from the site list but still present on the server. The error log says:

[Thu Sep 12 21:36:28.363090 2019] [php7:notice] [pid 11357] Slim Application Error:\nType: RuntimeException\nCode: 5\n
Message: Malformed UTF-8 characters, possibly incorrectly encoded\nFile: /lib/pkp/lib/vendor/slim/slim/Slim/Http/Response.php\nLine: 359\nTrace: #0 /lib/pkp/api/v1/_submissions/PKPBackendSubmissionsHandler.inc.php(167): Slim\Http\Response->withJson(Array)\n#1 [internal function]: PKPBackendSubmissionsHandler->getSubmissions(Object(Slim\Http\Request), Object(APIResponse), Array)\n#2 /lib/pkp/lib/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Array, Object(Slim\Http\Request), Object(APIResponse), Array)\n#3 /lib/pkp/lib/vendor/slim/slim/Slim/Route.php(356): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(APIResponse), Array)\n#4 /lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(APIResponse))\n#5 /lib/pkp/lib/vendor/slim/slim/Slim/Route.php(334): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))\n#6 /lib/pkp/lib/vendor/slim/slim/Slim/App.php(516): Slim\Route->run(Object(Slim\Http\Request), Object(APIResponse))\n#7 /lib/pkp/classes/security/authorization/internal/ApiAuthorizationMiddleware.inc.php(74): Slim\App->__invoke(Object(Slim\Http\Request), Object(APIResponse))\n#8 [internal function]: ApiAuthorizationMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))\n#9 /lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(ApiAuthorizationMiddleware), Array)\n#10 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))\n#11 /var/www/html/ojs3121.library.unt.edu/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))\n#12 /lib/pkp/classes/security/authorization/internal/ApiTokenDecodingMiddleware.inc.php(82): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#13 [internal function]: ApiTokenDecodingMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#14 /lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(ApiTokenDecodingMiddleware), Array)\n#15 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#16 /lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#17 /lib/pkp/classes/handler/APIHandler.inc.php(66): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#18 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#19 /lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Closure), Array)\n#20 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#21 /lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#22 /lib/pkp/classes/handler/APIHandler.inc.php(88): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#23 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#24 /lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Closure), Array)\n#25 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#26 /lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))\n#27 /lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))\n#28 /lib/pkp/lib/vendor/slim/slim/Slim/App.php(407): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))\n#29 /lib/pkp/lib/vendor/slim/slim/Slim/App.php(315): Slim\App->process(Object(Slim\Http\Request), Object(APIResponse))\n#30 /lib/pkp/classes/core/APIRouter.inc.php(109): Slim\App->run()\n#31 /lib/pkp/classes/core/Dispatcher.inc.php(134): APIRouter->route(Object(Request))\n#32 /lib/pkp/classes/core/PKPApplication.inc.php(252): Dispatcher->dispatch(Object(Request))\n#33 /index.php(68): PKPApplication->execute()\n#34 {main}\nView in rendered output by enabling the “displayErrorDetails” setting.\n

In dev tools, I get a 500 error for the link:
/api/v1/submissions?status=1&searchPhrase=&count=20&offset=0&=1568318713534

and a blank page that says:

Slim Application Error

A website error has occurred. Sorry for the temporary inconvenience.

thanks

Hi @Jeremy_Jones,

It sounds like you have some bad UTF-8 data in your database, or your OJS is not configured to connect to the database properly. Have you changed anything in your installation recently, e.g. an upgrade, database move, or configuration file change?

Regards,
Alec Smecher
Public Knowledge Project Team

Hello,

I updated from 3.1.2 to 3.1.2-1. I ran the install package and did not get any errors.

Hi @Jeremy_Jones,

Is it possible that you accidentally changed the character set parameters in config.inc.php in the process?

Regards,
Alec Smecher
Public Knowledge Project Team

No, I did not touch that portion of the config file. I only updated the database connection and point it to the uploads file as I always do with every update. Should I try a re-reinstall or is there a way to repair the database?

Hi @Jeremy_Jones,

What options do you have in config.inc.php for client_charset, connection_charset, and database_charset?

Regards,
Alec Smecher
Public Knowledge Project Team

client_charset = utf-8
connection_charset = Off
database_charset = Off

Hi @Jeremy_Jones,

The “ideal” set-up would be (inconsistencies intentional)…

client_charset = utf-8
connection_charset = utf8
database_charset = utf8

However, if your data is not encoded with those settings in place it may also be necessary to transcode your database. I’d suggest making a quick test with those settings enabled; if it doesn’t fix the issue, return them to what they were and we can consider next steps.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

That seems to have fixed it. Thank you. I am not the administrator of the site but I am told that everything is looking good now. I will make note of this and ensure I implement it in future updates. Thank you again.

I have a similar problem, but it happens for some submissionsLista de artigos

show variables like ‘%character%’
| — | — | — |
|character_set_client|utf8mb4|
|character_set_connection|utf8mb4|
|character_set_database|latin1|
|character_set_filesystem|binary|
|character_set_results|utf8mb4|
|character_set_server|latin1|
|character_set_system|utf8|
|character_sets_dir|/usr/share/mysql/charsets/|