The URLs are being formed as http://localhost/public/...
, but your access in the browser looks like http://localhost/journal/public
. Check your base_url
in config.inc.php. This should be of the form base_url = http://localhost/journal
.
I didn’t see any contents in the sendeyo.com
link, but within the log, you can generally ignore any lines with:
- PHP Notice
- PHP Deprecated
Lines with:
- PHP Warning
will be of secondary interest to lines with:
- PHP Error
- PHP Fatal
- or any non-PHP message
From the log messages provided, the ones of most interest are:
[01-Feb-2020 10:15:57 Europe/Berlin] ojs2: DB Error: MySQL server has gone away
[01-Feb-2020 13:26:13 Europe/Berlin] PHP Fatal error: Uncaught Exception: Cannot load record: invalid context id. in /opt/lampp/htdocs/journal/lib/pkp/classes/statistics/PKPMetricsDAO.inc.php:407
Stack trace:
#0 /opt/lampp/htdocs/journal/classes/statistics/MetricsDAO.inc.php(47): PKPMetricsDAO->foreignKeyLookup(256, 3)
#1 /opt/lampp/htdocs/journal/lib/pkp/classes/statistics/PKPMetricsDAO.inc.php(280): MetricsDAO->foreignKeyLookup(256, 3)
#2 /opt/lampp/htdocs/journal/classes/install/Upgrade.inc.php(568): PKPMetricsDAO->insertRecord(Array)
#3 /opt/lampp/htdocs/journal/lib/pkp/classes/install/Installer.inc.php(421): Upgrade->migrateCounterPluginUsageStatistics(Object(Upgrade), Array)
#4 /opt/lampp/htdocs/journal/lib/pkp/classes/install/Installer.inc.php(265): Installer->executeAction(Array)
#5 /opt/lampp/htdocs/journal/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#6 /opt/lampp/htdocs/journal/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#7 /opt/lampp/htdocs/journal/lib/pkp/classes/cliTool/UpgradeTool.inc.php( in /opt/lampp/htdocs/journal/lib/pkp/classes/statistics/PKPMetricsDAO.inc.php on line 407
Was this a single run of the upgrade from 10:15:57 (or before) to 14:46:08 (or after)?
Can you find associated mysql error logs relating to the first message? You may need to re-configure or add resources for mysql and retry the upgrade.
The second fatal error (above) and subsequent warnings (below) may indicate data problems:
[01-Feb-2020 13:31:49 Europe/Berlin] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/htdocs/journal/cache/t_compile/e8ea13aa559bf8604ca823015b397a28d8666486^28682bb3d6b6e750ebd3d458abc8f92b4da9ea9f_0.app.headerusernav.tpl.php on line 136
[01-Feb-2020 13:33:01 Europe/Berlin] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/htdocs/journal/cache/t_compile/e8ea13aa559bf8604ca823015b397a28d8666486^28682bb3d6b6e750ebd3d458abc8f92b4da9ea9f_0.app.headerusernav.tpl.php on line 136
[01-Feb-2020 13:33:06 Europe/Berlin] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/htdocs/journal/cache/t_compile/e8ea13aa559bf8604ca823015b397a28d8666486^28682bb3d6b6e750ebd3d458abc8f92b4da9ea9f_0.app.headerusernav.tpl.php on line 136
[01-Feb-2020 13:33:33 Europe/Berlin] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/htdocs/journal/cache/t_compile/e8ea13aa559bf8604ca823015b397a28d8666486^28682bb3d6b6e750ebd3d458abc8f92b4da9ea9f_0.app.headerusernav.tpl.php on line 136
[01-Feb-2020 13:35:49 Europe/Berlin] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/htdocs/journal/cache/t_compile/e8ea13aa559bf8604ca823015b397a28d8666486^28682bb3d6b6e750ebd3d458abc8f92b4da9ea9f_0.app.headerusernav.tpl.php on line 136
[01-Feb-2020 13:36:40 Europe/Berlin] PHP Notice: unserialize(): Error at offset 1512 of 1797 bytes in /opt/lampp/htdocs/journal/lib/pkp/classes/db/DAO.inc.php on line 352
[01-Feb-2020 13:36:40 Europe/Berlin] PHP Notice: unserialize(): Error at offset 1512 of 1797 bytes in /opt/lampp/htdocs/journal/lib/pkp/classes/db/DAO.inc.php on line 352
[01-Feb-2020 13:36:40 Europe/Berlin] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/htdocs/journal/cache/t_compile/65bfc3e024c2e9104f46e23b73376a9455e3df0e^51cfb9321c891ada9323e7942962579e7e4324d1_0.app.frontendpagesindexSite.tp.php on line 43
[01-Feb-2020 13:37:08 Europe/Berlin] PHP Warning: Creating default object from empty value in /opt/lampp/htdocs/journal/cache/t_compile/27fc9a705b4a99644bc81d26b4e3875e89a73770^52019e87b90081f2c6bfa717994d81ab7712dd1f_0.app.frontendcomponentssearchF.php on line 30
[01-Feb-2020 13:37:08 Europe/Berlin] PHP Warning: Element ‘<a><em><strong><cite><code><ul><ol><li><dl><dt><dd><b><i><u><imgsrc|alt><sup><sub><br><p><marqueebehavior|direction>’ is not supported (for information on implementing this, see the support forums) in /opt/lampp/htdocs/journal/lib/pkp/lib/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php on line 311
[01-Feb-2020 13:37:18 Europe/Berlin] PHP Warning: Creating default object from empty value in /opt/lampp/htdocs/journal/cache/t_compile/5300004d4b9142132479eea7131632ea471d5576^52019e87b90081f2c6bfa717994d81ab7712dd1f_0.app.frontendcomponentssearchF.php on line 30
[01-Feb-2020 13:37:18 Europe/Berlin] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /opt/lampp/htdocs/journal/lib/pkp/lib/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php on line 162
[01-Feb-2020 13:37:33 Europe/Berlin] PHP Warning: Creating default object from empty value in /opt/lampp/htdocs/journal/cache/t_compile/e793d7624def142603b50f54f7e2a4b20dfbc051^52019e87b90081f2c6bfa717994d81ab7712dd1f_0.app.frontendcomponentssearchF.php on line 30
[01-Feb-2020 13:37:42 Europe/Berlin] PHP Warning: Creating default object from empty value in /opt/lampp/htdocs/journal/cache/t_compile/e793d7624def142603b50f54f7e2a4b20dfbc051^52019e87b90081f2c6bfa717994d81ab7712dd1f_0.app.frontendcomponentssearchF.php on line 30
[01-Feb-2020 13:37:44 Europe/Berlin] PHP Warning: Creating default object from empty value in /opt/lampp/htdocs/journal/cache/t_compile/894d96a6367d2333e3dbd3c812964ac117ab031e^52019e87b90081f2c6bfa717994d81ab7712dd1f_0.app.frontendcomponentssearchF.php on line 30
[01-Feb-2020 13:40:46 Europe/Berlin] PHP Notice: unserialize(): Error at offset 1512 of 1797 bytes in /opt/lampp/htdocs/journal/lib/pkp/classes/db/DAO.inc.php on line 352
[01-Feb-2020 13:40:46 Europe/Berlin] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/htdocs/journal/cache/t_compile/65bfc3e024c2e9104f46e23b73376a9455e3df0e^51cfb9321c891ada9323e7942962579e7e4324d1_0.app.frontendpagesindexSite.tp.php on line 43
[01-Feb-2020 14:08:49 Europe/Berlin] PHP Warning: Creating default object from empty value in /opt/lampp/htdocs/journal/cache/t_compile/27fc9a705b4a99644bc81d26b4e3875e89a73770^52019e87b90081f2c6bfa717994d81ab7712dd1f_0.app.frontendcomponentssearchF.php on line 30
[01-Feb-2020 14:28:43 Europe/Berlin] PHP Notice: Array to string conversion in /opt/lampp/htdocs/journal/lib/pkp/lib/adodb/adodb.inc.php on line 1021
[01-Feb-2020 14:28:43 Europe/Berlin] ojs2: DB Error: Unknown column ‘Array’ in ‘field list’
[01-Feb-2020 14:33:52 Europe/Berlin] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /opt/lampp/htdocs/journal/cache/t_compile/65bfc3e024c2e9104f46e23b73376a9455e3df0e^51cfb9321c891ada9323e7942962579e7e4324d1_0.app.frontendpagesindexSite.tp.php on line 43
[01-Feb-2020 14:34:34 Europe/Berlin] PHP Notice: unserialize(): Error at offset 1512 of 1797 bytes in /opt/lampp/htdocs/journal/lib/pkp/classes/db/DAO.inc.php on line 352
Some of these would require debugging to identify what data is throwing the warning or notice. Others we can fix more easily.
This reference:
[01-Feb-2020 13:37:08 Europe/Berlin] PHP Warning: Element ‘<a><em><strong><cite><code><ul><ol><li><dl><dt><dd><b><i><u><imgsrc|alt><sup><sub><br><p><marqueebehavior|direction>’ is not supported (for information on implementing this, see the support forums) in /opt/lampp/htdocs/journal/lib/pkp/lib/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php on line 311
Indicates that you haven’t fully reconciled changes in config.inc.php for 3.x with your original settings in 2.x. As a best practice, copy the new 3.x config.TEMPLATE.inc.php to config.inc.php, and then copy your old settings from your 2.x config.inc.php into the new file, reviewing new configuration notes as you go. The allowed_html
configuration format has changed, for example, and this is the cause of this warning.
The URLs are being formed as
http://localhost/public/...
, but your access in the browser looks likehttp://localhost/journal/public
. Check yourbase_url
in config.inc.php. This should be of the formbase_url = http://localhost/journal
.
@ctgraham, Initially it was default url(provided by pkp) now i changed it to “http://localhost/journal”. Then i restarted the lampp stack. But still the same behaviour.
Was this a single run of the upgrade from 10:15:57 (or before) to 14:46:08 (or after)?
Yes it is the log from single run of the upgrade, becuse it took almost 7-8 hrs to complete.
@ctgraham from your analysis i feel that i need to restart the upgrade process again. So i will go ahead with that. Again it may take a 1-2days. I will keep you updated.
@ctgraham after tried the upgrade for couple time with console logs to find out the exact origin of fatal error.
As per the callstack it begins here.
PKPMetricsDAO->foreignKeyLookup(256, 3) which is from PKPMetricesDAO.inc.php file function insertRecord($record) and line number 281.
Where it says the:
1st parameter 256 is $assocType
2nd parameter 3 is $assocId.
What exactly these two and how will i ensure that it returns a valid context.
It throws exception at 407 of PKPMetricsDAO.php because
$context = $contextDao->getById($assocId); return null;
protected function foreignKeyLookup($assocType, $assocId) {
…
case Application::getContextAssocType():
$contextDao = Application::getContextDAO(); /* @var $contextDao ContextDAO */
$context = $contextDao->getById($assocId);
if (!$context) {
throw new Exception('Cannot load record: invalid context id.');
}
$contextId = $assocId;
break;
}
}
Do we have a better suggestion for debugging ? Because debug with console log takes a lots of time.
Note: I am doing the upgrade on 18.04 Ubuntu with lamp stack.
Am i doing the process correctly?
Do we have a code architecture to understand the design and workflow?
Regards,
Jnana.
I am upgrading from OJS 2.4 to 3.x and encountering a number of problems including;
review_assignments_tmp already exists
notes_tmp already exists
submission_galley_settings already exists
I deleted these and then encountered the following error;
DB Error: Unknown column 'assoc_type' in 'where clause' Query: UPDATE email_templates SET assoc_type = 530 WHERE assoc_type = '526'
I have then cleared data for these and re run the upgrade process but now encountering the following error;
# DB Error: Unknown column 'a.setting_type' in 'where clause' Query: SELECT a.*, b.context_id FROM submission_settings a, submissions b WHERE a.setting_name = 'fileName' AND a.locale = ? AND a.setting_value LIKE ? AND a.setting_type = 'string' AND b.submission_id = a.submission_id
Is there any way to clean/ check the database as I have the same database in the backup. How can we check if our data is good to be upgraded to OJS 3.x
Hi @esciencepress,
If those tables already exist in the database, then your database has already had a partial upgrade attempted and is an inconsistent state between your old version and your new version. It’s absolutely necessary to restore your database from a backup taken before the upgrade attempt. When you do that, make sure you DROP
the database before loading the database dump and CREATE
a fresh one – otherwise old tables from the upgrade attempt can be left lying around to interfere with the upgrade.
Regards,
Alec Smecher
Public Knowledge Project Team
@asmecher thank you for your reply. I do not have access to the old database as this was upgraded to 2.4 year before and now I want to move to 3.x. Any solution please? We have 15 journals hosted to this domain.
I have cleaned for the above errors and stuck at the following code error;
DB Error: Unknown column 'a.setting_type' in 'where clause' Query: SELECT a.*, b.context_id FROM submission_settings a, submissions b WHERE a.setting_name = 'fileName' AND a.locale = ? AND a.setting_value LIKE ? AND a.setting_type = 'string' AND b.submission_id = a.submission_id
Hi @esciencepress,
The upgrade to OJS 2.4.x a year ago shouldn’t be a problem – it’s this next upgrade to OJS 3.x. Before trying the upgrade, did you make a backup?
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @esciencepress,
Do you have the output from the first time the upgrade failed?
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @esciencepress,
The first time you tried to run the upgrade from OJS 2.x to 3.x, what error message did you get?
Regards,
Alec Smecher
Public Knowledge Project Team
@asmecher I copied the error message above ;
review_assignments_tmp already exists
I have manually removed review_assignments_tmp from phpmyadmin and then restarted the upgrade. Gradually the errors were notes_tmp already exists and submission_galley_settings already exists which I removed using the same mysql.
Now I am stuck here;
DB Error: Unknown column 'a.setting_type' in 'where clause' Query: SELECT a.*, b.context_id FROM submission_settings a, submissions b WHERE a.setting_name = 'fileName' AND a.locale = ? AND a.setting_value LIKE ? AND a.setting_type = 'string' AND b.submission_id = a.submission_id
Hi @esciencepress,
That error message can only appear on a second (or later) upgrade attempt, not a first attempt. The upgrade process creates that table, migrates its content, then deletes it; if the upgrade is interrupted partway through, it’ll leave a review_assigments_tmp
table behind. A second attempt to run the script will then crash when it tries to create the table because it already exists.
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @esciencepress,
If you have the error message from the first time the upgrade failed, that’ll help to identify where in the upgrade process the crash happened. Do you have that message?
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @esciencepress,
This is a tough one – I’m afraid you’ve run your database through a blender, several times, without a backup. I can’t walk you through correcting this in detail; we do clearly recommend that you make a backup before upgrading. If there’s any way you can recover using a known-good backup, I would strongly recommend going that route. Failing that, I would start with the earliest copy of the corrupted database you have, e.g. after the first failure happened, before you tried again. The more uncertain steps the database has gone through, the tougher it will be to clean up.
If that’s not possible, the steps that an upgrade goes through are listed in dbscripts/xml/upgrade.xml
. You could try to ascertain how far your upgrade got by looking through those steps to see which were executed and which were not. You may need to run through these by hand, but be warned, they are extensive.
Regards,
Alec Smecher
Public Knowledge Project Team
@asmecher Thanks. If I found an older version of backup, will it be possible to upgrade keeping the recent data as I have published many issues in different journals after this.