OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Having troubles upgrading the OJS from 2.4.2 to 2.4.3

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.

Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Tue Jan 07, 2014 2:45 am

Hi!
Having troubles upgrading the OJS from 2.4.2 to 2.4.3.
The IT administrator have applied all recommended patches with upgrade patch (from 2.4.2 version).
Also he have ran the DB upgrade patch from this section:
Code: Select all
If you have the CLI version of PHP installed (e.g., /usr/bin/php), you can
upgrade the database as follows:

     - Edit config.inc.php and change "installed = On" to "installed = Off"
     - Run the following command from the OJS directory (not including the $):
       $ php tools/upgrade.php upgrade
     - Re-edit config.inc.php and change "installed = Off" back to
        "installed = On"


So in the result the DB structure is unchanged and I still see the updgrade notice message:
Code: Select all
There is a new version of OJS available! You are currently using OJS 2.4.2.0. The most recent version is OJS 2.4.3.0. Please contact your Site Administrator () to notify them of this new release. More information can be found here.


What should we do?
Thank you!
Last edited by Garant on Tue Jan 07, 2014 10:23 am, edited 1 time in total.
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby asmecher » Tue Jan 07, 2014 6:26 am

Hi Garant,

If your system is still reporting the old version, then the database upgrade did not complete successfully. When it fails, it should give you an error message. Be aware that a failed upgrade will leave your database in an indeterminate state between the two versions, so it's best to restore from backup before trying the upgrade again.

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

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Wed Jan 08, 2014 1:08 am

Hi, Alec!
It's very weird. The upgrade script doesn't do anything with DB. It outputs no errors and makes no changes in DB structure.
The file system upgrade was done though GIT and then upgrade.php script was ran.

Now I have opened the full archive and saw that there is a dbscripts folder and there are 2.4.3_xxx XML files.
As I understand this is the DB upgrade scripts which should be run with tools/dbXMLtoSQL.php script
Am I right?
In such case with which argument this tool should be run?
Need fast solution, as file system is upgraded and DB no...
Thank you!


Update:

[ojs@www3 ojs]$ php tools/upgrade.php check
Code version: 2.4.3.0
Database version: 2.4.2.0
Latest version: 2.4.3.0
Database version is older than code version
Run "tools/upgrade.php upgrade" to update

Running the script gives such view:

Code: Select all
[ojs@www3 ojs]$ php -ddisplay_errors=On -ddisplay_startup_errors=On
-derror_reporting=E_ALL tools/upgrade.php upgrade
[ojs@www3 ojs]$

And :

[ojs@www3 ojs]$ php tools/upgrade.php upgrade
[ojs@www3 ojs]$


Empty output :(
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby JasonNugent » Wed Jan 08, 2014 10:54 am

Hi Garant,

Can you check to make sure that the patches went on cleanly and that there are no syntax errors now? You can do this with the following command:

Code: Select all
find . -name "*.php" -exec php -l {} \; | grep -v 'No syntax errors'


Run it from the root of your OJS installation. If there are no errors, it won't print anything. I have seen this before, once, when a class that was improperly patched was required() and because it was broken the process failed.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 893
Joined: Tue Jan 10, 2006 6:20 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Wed Jan 08, 2014 11:01 am

Hi Jason!
Thank you!
As I will get the answer I will post it here.
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Wed Jan 08, 2014 11:44 am

No errors :(
Code: Select all
[ojs@www3 ojs-WORK]$ find . -name "*.php" -exec php -l {} \; | grep -v
'No syntax errors'
[ojs@www3 ojs-WORK]$
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Thu Jan 09, 2014 2:31 am

Now I can't even create a new issue:
Code: Select all
DB Error: Unknown column 'last_modified' in 'field list'

:(


The found in the forum query
Code: Select all
SELECT COUNT(*) FROM event_log_settings WHERE setting_name='old_log_id';

Gives the result:
Code: Select all
1099
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby JasonNugent » Thu Jan 09, 2014 7:53 am

Hi Garant,

Okay, let's try something else. Can you download a completely stock OJS 2.4.3 distribution, and replace the config.inc.php file with the one from your current install. Then, from the base of the stock distribution, run the upgrade tool?

I'm worried that something that came down out of git has corrupted something. There are a few plugins that use symlinks to share class files and I wonder if those were preserved with github. The stock distribution should not contain any code problems, and if you point it at your existing database it should upgrade it.

Failing all of this, do you have a backup of your 2.4.2 install that you can roll back to?

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 893
Joined: Tue Jan 10, 2006 6:20 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Thu Jan 09, 2014 7:55 am

HI Jason!
Thank you for your answer.
I will ask server admin to iniciate such update. I as will receive answer - I will post it here.
I hope that we have the back up :)
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Thu Jan 09, 2014 8:26 am

Hi!
At last the admin found the problem. Here is the description:

He has compared the ojs-2.4.3.tar.gz from git and found out that it has empty lib/pkp/lib/swordappv2 catalogue.
He found out that this catalogue is filling from another repository (such a change in 2.4.3 version).
It's a very pity that this change has not been written in upgrade docs.

Once he has filled this catalogue the test version has bee updated with this log:

Code: Select all
[ojs@www3 ojs-WORK]$ php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.3.0]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics2.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/comments.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/gifts.xml]
[schema: lib/pkp/xml/schema/mutex.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[schema: plugins/generic/usageStats/schema.xml]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml]
[code: Installer Installer::migrateCounterPluginUsageStatistics]
[note: docs/release-notes/GeoLocalizationToolRequired]
[code: Installer Installer::migrateTimedViewsUsageStatistics]
[code: Installer Installer::migrateDefaultUsageStatistics]
[data: dbscripts/xml/upgrade/2.4.3_postUsageStatsMigration.xml]
[data: dbscripts/xml/upgrade/2.4.3_postUsageStatsMigration2.xml]
[data: dbscripts/xml/upgrade/2.4.3_postCounterMigration.xml]
[data: dbscripts/xml/upgrade/2.4.3_postTimedViewsMigration.xml]
[code: Installer Installer::addPluginVersions]
[post-install]
ojs2 has produced an error
   Message: WARNING: Cannot use a scalar value as an array
   In file:
/var/www/html/ojs-WORK/classes/journal/JournalSettingsDAO.inc.php
   At line: 83
   Stacktrace:
   Server info:
    OS: Linux
    PHP Version: 5.3.3
    Apache Version: N/A
    DB Driver: mysql
ojs2 has produced an error
   Message: WARNING: Cannot use a scalar value as an array
   In file:
/var/www/html/ojs-WORK/classes/journal/JournalSettingsDAO.inc.php
   At line: 83
   Stacktrace:
   Server info:
    OS: Linux
    PHP Version: 5.3.3
    Apache Version: N/A
    DB Driver: mysql

Release Notes
----------------------------------------
The geo localization database was not found. The system can continue
with the
statistics migration process, but no geo localization data will be
retrieved. If
you want to install the missing resource, read the UPGRADE file under
the "Stats
Migration" heading.


Successfully upgraded to version 2.4.3.0

[ojs@www3 ojs-WORK]$ php tools/upgrade.php check
Code version:      2.4.3.0
Database version:  2.4.3.0
Latest version:    2.4.3.0
Your system is up-to-date


What about those warning? Could we ignore them? Or they should be fixed somehow?
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Fri Jan 10, 2014 12:58 am

Additional problems still exist :(
The update process for working database has been successfully completed, the log:
Code: Select all
[ojs@www3 ojs-WORK]$ php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.3.0]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics2.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/comments.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/gifts.xml]
[schema: lib/pkp/xml/schema/mutex.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[schema: plugins/generic/usageStats/schema.xml]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml]
[code: Installer Installer::migrateCounterPluginUsageStatistics]
[note: docs/release-notes/GeoLocalizationToolRequired]
[code: Installer Installer::migrateTimedViewsUsageStatistics]
[code: Installer Installer::migrateDefaultUsageStatistics]
[data: dbscripts/xml/upgrade/2.4.3_postUsageStatsMigration.xml]
[data: dbscripts/xml/upgrade/2.4.3_postUsageStatsMigration2.xml]
[data: dbscripts/xml/upgrade/2.4.3_postCounterMigration.xml]
[data: dbscripts/xml/upgrade/2.4.3_postTimedViewsMigration.xml]
[code: Installer Installer::addPluginVersions]
[post-install]

Release Notes
----------------------------------------
The geo localization database was not found. The system can continue
with the
statistics migration process, but no geo localization data will be
retrieved. If
you want to install the missing resource, read the UPGRADE file under
the "Stats
Migration" heading.

But once I open any of journals the error occurs:
Code: Select all
DB Error: Unknown column 'pa.views' in 'where clause'


The debug:
Code: Select all
(mysql): SELECT a.article_id FROM published_articles pa INNER JOIN articles a ON (a.article_id = pa.article_id) WHERE a.journal_id = 1 AND pa.views > 0 ORDER BY pa.views DESC LIMIT 5   1054: Unknown column 'pa.views' in 'where clause'

                                                                        ADOConnection._Execute(SELECT a.article_id
               FROM published_articles pa INNER JOIN articles a ON (a.article_id = pa.article_id)
               WHERE a.journal..., false) % line  864, file: adodb.inc.php
                                                                     ADOConnection.Execute(SELECT a.article_id
               FROM published_articles pa INNER JOIN articles a ON (a.article_id = pa.article_id)
               WHERE a.journal..., Array[0]) % line  487, file: adodb-mysql.inc.php
                                                                  ADODB_mysql.SelectLimit(SELECT a.article_id
               FROM published_articles pa INNER JOIN articles a ON (a.article_id = pa.article_id)
               WHERE a.journal..., 5, -1, Array[0]) % line  162, file: DAO.inc.php
                                                               DAO.retrieveLimit(SELECT a.article_id
               FROM published_articles pa INNER JOIN articles a ON (a.article_id = pa.article_id)
               WHERE a.journal..., Array[0], 5) % line   51, file: PopularArticlesDAO.inc.php
                                                            PopularArticlesDAO.getPopularArticles(1, 5) % line   38, file: PopularArticlesBlockPlugin.inc.php


It was a bit modified popular articles plugin. Now I've disabled it. What should be changed inside the code to make it work?
PopularArticlesDAO.inc.php:
Code: Select all
<?php

/**
 * @file PopularArticlesDAO.inc.php
 *
 * Copyright (c) 2000-2008 John Willinsky
 * Edited by Andreas Ihrig
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @class PopularArticlesDAO
 * @ingroup plugins_blocks_popularArticles
 *
 * @brief Class for Popular Article Block plugin
 */
 
//import('db.DAO');

class PopularArticlesDAO extends DAO {
   
   /*
    * Gets the $num popular articles in the last $months months.
    * If $months = null it shows articles of all time
    */
   function getPopularArticles( $journalId, $num = 10, $months = null){
      $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
      
      $returner = array();
      //$returner[] =& $journalId;
      
      if ( $months ) {
         $result =& $this->retrieveLimit(
               sprintf('SELECT a.article_id
               FROM published_articles pa INNER JOIN articles a ON (a.article_id = pa.article_id)
               WHERE a.journal_id = %s AND
               pa.date_published > %s
               AND pa.views > 0
               ORDER BY pa.views DESC',
               $journalId,
               $this->datetimeToDB(strtotime('-' . $months . ' months'))),
               array(), //$journalId,
               $num);
      } else {
         $result =& $this->retrieveLimit(
               sprintf('SELECT a.article_id
               FROM published_articles pa INNER JOIN articles a ON (a.article_id = pa.article_id)
               WHERE a.journal_id = %s AND
               pa.views > 0
               ORDER BY pa.views DESC',
               $journalId),
               array(), //$journalId,
               $num);
      }
            
      while (!$result->EOF) {
         $row = $result->GetRowAssoc(false);
         $returner[] =& $publishedArticleDao->getPublishedArticleByArticleId($row['article_id']);
         $result->moveNext();
      }
      
      $result->Close();
      unset($result);

      return $returner;
   }

}

?>




+ the COUNTER statistics plugin has dissapeared. The top menu has a link to it, when I press it - the message appears:
Code: Select all
ERROR:: to activate it, the plugin "COUNTER Statistics" must be activated

But I can't find a COUNTER plugin in plugins section...
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby JasonNugent » Fri Jan 10, 2014 4:32 am

Hi Garant,

The issue with the Sword app is probably something specific to github. Sword isn't our product -- we include the library from another developer. When we build our installation distributions we include it, but you'd probably need to include it manually or make it a submodule if you track OJS via github.

The Popular Articles plugin is not something that comes with OJS by default, I believe. There was a huge amount of work put into statistics in 2.4.3, and as such the way stats are stored is not the same. The 'views' column that used to be in the published_articles table no longer exists, so the plugin will need to be re-written or at least fixed to look at the new way of collecting statistics. Don't worry, your stats are still there, but they are just stored in a different set of database tables.

Is this the only problem for you after the upgrade?

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 893
Joined: Tue Jan 10, 2006 6:20 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Fri Jan 10, 2014 4:58 am

Hi Jason!
Upgrade problem has been resolved. I'd suggest you to fix GIT version or place some notes about it in the UPGRADE instruction.
Because with our example we have spent many hours searching for the problem which should not exist in normal state.

Could you suggest how to modificate existing SQL query in the Popular Articles plugin ? In order to force it to work? It was slightly modificated to our needs.

Currently I'm testing this OJS version. The additional problem is with COUNTER statistics plugin as I've mentioned. Is this plugin downloadable as separate installation file?
Plus I've noticed that my described bugs on the tracker still hasn't been resolved:
What comes first into my mind - the problem with static pages plugin, where language switch doesn't work.
Best regards

P.S. The "counter" folder in generic folder is empty! It only contains locale files!!!
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby Garant » Mon Jan 13, 2014 4:09 am

Any information?
Garant
 
Posts: 219
Joined: Wed May 30, 2012 8:53 am

Re: Having troubles upgrading the OJS from 2.4.2 to 2.4.3

Postby bbeghelli » Mon Jan 13, 2014 5:28 am

Hi Garant,

The most popular articles fix is available here: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8514

The Counter plugin report is still available, at Management, Statistics & Reports, under Report Generator section. There you can generate COUNTER reports for both new stats generated by the new OJS version and your old stats. This documentation has a lot more details, if you are interested in better understanding the stats structure: http://pkp.sfu.ca/wiki/index.php?title= ... _Framework

The counter locale folder inside generic is my mistake. It shouldn't be there anymore, you can delete it. The counter plugin now is a report plugin only. And it has it's own locale files there. I will fix this too, thanks for noticing this.

Regards.
bbeghelli
 
Posts: 123
Joined: Tue Jun 25, 2013 2:22 pm

Next

Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 5 guests