OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



not proper connection to database

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

not proper connection to database

Postby gordan » Fri Jul 11, 2014 12:27 am

I am running OJS 2.4.3 on hostinger free server with 4 journals within the database. Everything was working fine until few days ago when something went wrong with connection to the database (http://www.ojs-hipzg.hol.es) namely web page is loading but in "about" section list of journals is missing. Similarly when anyone tries to log in, gets only blank page (seems that script is encountering an error).
My web provider unfortunately does not provide error logs on free servers but I was able to find some error php logs with following contents:
"[05-Jul-2014 19:52:04 UTC] ojs2: 404 Not Found
[07-Jul-2014 07:57:50 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[07-Jul-2014 07:58:01 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[07-Jul-2014 08:06:55 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[07-Jul-2014 08:11:56 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[07-Jul-2014 08:16:35 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[07-Jul-2014 08:16:35 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[07-Jul-2014 08:16:35 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[07-Jul-2014 08:16:35 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[07-Jul-2014 08:24:02 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a
href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte
sequence in argument
In file:
/home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69"

I was searching through forum but was not able to find solution, nor explanation whether such kind of character interpretation error can cause such
difficulties I have.
Please could anyone guide me where to find solution of my problem with OJS.
I did not do any modification to the initial installation which was running smoothly for 6 months, and my web provider claims that they did not do any php or apache upgrade.
It seems to me that the problem is connected with one of the journals (http://www.ojs-hipzg.hol.es/ojs-2.4.3/index.php/CSP/) while I can access to other journals if I type correct address directly (i.e. http://www.ojs-hipzg.hol.es/ojs-2.4.3/index.php/PP/).
Please any kind of help would be appreciated since my web provider told me that they do not know enough about scripts of OJS and that they cannot offer me any further help. I was thinking even of making re-install of OJS but I am afraid of loosing data (articles, reviews etc.) from all 4 journals.
thank you in advance
Gordan
gordan
 
Posts: 7
Joined: Wed Dec 25, 2013 3:10 am
Location: Zagreb, Croatia

Re: not proper connection to database

Postby gordan » Fri Jul 11, 2014 4:01 am

Please help ... since it seems things are getting worse
namely now I found this info in php error log
[11-Jul-2014 06:29:02 UTC] ojs2: DB Error: MySQL server has gone away
[11-Jul-2014 06:29:03 UTC] ojs2 has produced an error
Message: WARNING: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument
In file: /home/u587768466/public_html/ojs-2.4.3/lib/pkp/lib/smarty/plugins/modifier.escape.php
At line: 26
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.3.28
Apache Version: N/A
DB Driver: mysql
DB server version: 5.1.69
[11-Jul-2014 06:29:03 UTC] ojs2: DB Error: MySQL server has gone away
[11-Jul-2014 06:29:03 UTC] ojs2: DB Error: MySQL server has gone away

thank you in advance
gordan
 
Posts: 7
Joined: Wed Dec 25, 2013 3:10 am
Location: Zagreb, Croatia

Re: not proper connection to database

Postby asmecher » Fri Jul 11, 2014 9:49 am

Hi gordan,

It looks like you're encountering two problems: one is the warning messages about multibyte sequences, and the other is trouble related to the MySQL server.

To resolve the first, check if the charset_normalization option is turned On in your config.inc.php configuration file. If so, turn it off. Also ensure that you've got your installation fully set for UTF-8 operation (see again your config.inc.php file). These warnings are cosmetic and after a while of working with content in a properly configured UTF-8 environment they should go away. If they're disrupting users, you can configure your PHP environment not to present them via the browser, but your ability to do this will depend on your server environment.

The second problem ("MySQL server has gone away") is something you'll have to fix with your provider. Usually it means that the MySQL service is not reliable and there's little you can do to fix it as an end user of their hosting services.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9071
Joined: Wed Aug 10, 2005 12:56 pm

Re: not proper connection to database

Postby gordan » Fri Jul 11, 2014 11:51 am

Thanks for reply
but in my config file charset_normalization is off and client charset is set to utf8 ... as it is by default ... still I get above errors ... and my page (www.ojs-hipzg.hol.es) stopped working properly as I've described above ...
regarding loosing mysql server ... I'll contact provider again.
could it be repaired by reinstalling the ojs, but without loosing existing files (articles, reviews etc.)?
thank you in advance
gordan
 
Posts: 7
Joined: Wed Dec 25, 2013 3:10 am
Location: Zagreb, Croatia

Re: not proper connection to database

Postby asmecher » Fri Jul 11, 2014 2:13 pm

Hi gordan,

What are your config.inc.php settings for database_charset and connection_charset?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9071
Joined: Wed Aug 10, 2005 12:56 pm

Re: not proper connection to database

Postby gordan » Sat Jul 12, 2014 10:48 am

Hi Alec and thanx for reply
database_charset and connection_charset are both set to off
do you have any idea what could get wrong ... since the initial installation I did not change anything ... and everything was working fine for exactly six months ... then on 1st July collapse .... but it seems to me only with one of the journals ... but since I have 4 journals in one installation it affects all
thank you in advance
gordan
 
Posts: 7
Joined: Wed Dec 25, 2013 3:10 am
Location: Zagreb, Croatia

Re: not proper connection to database

Postby asmecher » Mon Jul 14, 2014 10:23 am

Hi gordan,

Your database_charset and connection_charset being set to "Off" means you're not using a fully UTF-8 environment. However, converting it to a full UTF-8 environment will require you to transcode your database contents, which is something I won't be able to walk you through here. There are guides for other applications e.g. here; the process is the same.

Regardless -- and aside from the "MySQL server has gone away" message -- what is specifically not working in your current installation?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9071
Joined: Wed Aug 10, 2005 12:56 pm

Re: not proper connection to database

Postby gordan » Tue Jul 15, 2014 12:48 am

Thanx for the guide ... I'll certainly try but first I would like to ask another thing ... how comes that everything worked fine and even I did not change anything in the config files, now it does not work ... what could went wrong? I have asked all the users about their activities regarding our ojs database on the 1st July (when database started to give us trouble) .. and it seems that one of the reviewers wanted to download / access peer-review form but he stalled for a rather long time and after that we were not able to load index page of that journal.

Regarding the problems of database / webpage ... since I host 4 journals in one installation of ojs, and it seems that only one journal has problems, the problem is that when you try to load index page everything seems to work (http://www.ojs-hipzg.hol.es) but if you log in or click about (the page where ojs should list included journals) you get this section with journals blank (seems that script is encountering error)http://www.ojs-hipzg.hol.es/ojs-2.4.3/index.php/index/about ... i.e if you log in you have only blank page.
I have tried to access each journal individually and it is possible to load page of each of them (ie. http://www.ojs-hipzg.hol.es/ojs-2.4.3/index.php/PP) but problems of loading is connected only with one of them http://www.ojs-hipzg.hol.es/ojs-2.4.3/index.php/CSP/ which is the journal on which the above reviewer has worked ...
I have to state that I am not programmer nor expert in IT ... just historian who often uses advantages of IT world in my investigations. So, I am afraid what if I do the suggested conversion of database and then loose all the articles and reviews in all 4 journals. Is this conversion "safe" thing since in the guide you have sent it is said that I should dump and backup database which would not be problem if the database works properly, and I could make proper backup which I could use later if smth goes wrong. But I am afraid that if smth goes wrong that my backup won't be of any use since I have checked my backup logs and backup from March is app. 90 MB and backup from July is only 1.2 MB !!!!
And I have to repeat myself .... I did nothing regarding configuration or addition of plugins after the initial installation which worked smoothly for six months. And cannot understand how (if this is the case) reviewer's work / actions could make such trouble with database.
gordan
 
Posts: 7
Joined: Wed Dec 25, 2013 3:10 am
Location: Zagreb, Croatia

Re: not proper connection to database

Postby gordan » Tue Jul 15, 2014 1:40 am

And one more question ... would upgrade to the latest version help? Namely, I do not know how upgrade script works ... does it patch database or builds new one and then copy relations/files in the new database? :?:
thank you in advance
gordan
 
Posts: 7
Joined: Wed Dec 25, 2013 3:10 am
Location: Zagreb, Croatia

Re: not proper connection to database

Postby asmecher » Tue Jul 15, 2014 11:43 am

Hi gordan,

A blank page almost always indicates a PHP error in the error log. Your log has so far contained warnings (these won't cause the site to stop entirely) and MySQL errors (these will). If you're seeing more errors in the error log, please post them.

I couldn't comment yet on whether an upgrade would fix the issue -- but regardless, you can find instructions on upgrading in docs/UPGRADE.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9071
Joined: Wed Aug 10, 2005 12:56 pm

Re: not proper connection to database

Postby gordan » Mon Jul 21, 2014 8:14 am

Thank you for the info
I have tried to repair database with phpMyAdmin. Still, though repair process did not report any error, the situation remains the same ...
I am afraid that I will have to try upgrading/patching database ... from the upgrade documentation seems that smth like that is possible but I still have some reservations ... what if ...
anyway I'll keep updating and if anyone has any idea it would be more that welcome
gordan
 
Posts: 7
Joined: Wed Dec 25, 2013 3:10 am
Location: Zagreb, Croatia


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 3 guests