[ojs][upgrade]erro atualização postgre

Ola a todos tentei fazer atualização do ojs 2.4.8.5 para 3.2.1.4 como recomendado e me deparo com esse erro:[pre-install]
[load: upgrade.xml]
[version: 3.2.1.4]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::syncSeriesAssocType]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics2.xml (skipped)]

[code: Installer Installer::removeReviewEntries]
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
[data: dbscripts/xml/upgrade/3.0.0_adaptTimedViews.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_adaptReferrals.xml]
[data: dbscripts/xml/upgrade/3.0.0_adaptBooksForReview.xml]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml]
[data: dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml]

[code: Installer Installer::migrateSubmissionCoverImages]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning_articleGalleySettings.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.xml]
[data: dbscripts/xml/upgrade/3.2.1_preupdate_subeditor_categories.xml]
[schema: lib/pkp/xml/schema/common.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/submissionFiles.xml]
[schema: lib/pkp/xml/schema/categories.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: lib/pkp/xml/schema/navigationMenus.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]

[code: Installer Installer::installDefaultNavigationMenus]
PHP Warning: Illegal string offset ‘pt_BR’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133

Warning: Illegal string offset ‘pt_BR’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Warning: Illegal string offset ‘pt_BR’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133

Warning: Illegal string offset ‘pt_BR’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Warning: copy(/var/www/files//journals/30//articles/4449/attachment/4449-385-9816-2-13-20060203.pdf): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180

Warning: copy(/var/www/files//journals/30//articles/4449/attachment/4449-385-9816-2-13-20060203.pdf): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180
PHP Warning: Illegal string offset ‘en_US’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133

Warning: copy(/var/www/files//journals/40//articles/22501/attachment/22501-313-93188-2-13-20120606.doc): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180
PHP Warning: copy(/var/www/files//journals/40//articles/22501/attachment/22501-313-93189-2-13-20120606.doc): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180

Warning: copy(/var/www/files//journals/40//articles/22501/attachment/22501-313-93189-2-13-20120606.doc): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180
PHP Warning: copy(/var/www/files//journals/40//articles/22501/attachment/22501-313-93190-2-13-20120606.doc): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180

Warning: copy(/var/www/files//journals/40//articles/22501/attachment/22501-313-93190-2-13-20120606.doc): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180
PHP Warning: copy(/var/www/files//journals/40//articles/22501/attachment/22501-313-93191-2-13-20120606.doc): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180

Warning: copy(/var/www/files//journals/40//articles/22501/attachment/22501-313-93191-2-13-20120606.doc): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180
PHP Warning: Illegal string offset ‘es_ES’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133

Warning: Illegal string offset ‘es_ES’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Warning: Illegal string offset ‘en_US’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133

Warning: Illegal string offset ‘en_US’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Warning: Illegal string offset ‘pt_BR’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133

Warning: Illegal string offset ‘pt_BR’ in /opt/data/html/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Notice: unserialize(): Error at offset 0 of 13 bytes in /opt/data/html/lib/pkp/classes/db/DAO.inc.php on line 357

Warning: copy(/var/www/files//journals/18//articles/27078/attachment/27078-781-99341-1-13-20120521.docx): failed to open stream: Arquivo ou diretório inexistente in /opt/data/html/lib/pkp/classes/file/FileManager.inc.php on line 180
PHP Fatal error: Uncaught Exception: DB Error: ERROR: invalid input syntax for integer: “” Query: INSERT INTO submission_galley_settings (galley_id, setting_name, setting_value, setting_type) VALUES (?, ?, ?, ?) in /opt/data/html/lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 /opt/data/html/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError()
#1 /opt/data/html/classes/install/Upgrade.inc.php(1454): DAO->update()
#2 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->convertSupplementaryFiles()
#3 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction()
#4 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#5 /opt/data/html/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#6 /opt/data/html/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#7 /opt/data/html/tools/upgrade.php(22): UpgradeTool->execute()
#8 {main}
thrown in /opt/data/html/lib/pkp/classes/db/DAO.inc.php on line 703

Fatal error: Uncaught Exception: DB Error: ERROR: invalid input syntax for integer: “” Query: INSERT INTO submission_galley_settings (galley_id, setting_name, setting_value, setting_type) VALUES (?, ?, ?, ?) in /opt/data/html/lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 /opt/data/html/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError()
#1 /opt/data/html/classes/install/Upgrade.inc.php(1454): DAO->update()
#2 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->convertSupplementaryFiles()
#3 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction()
#4 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#5 /opt/data/html/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#6 /opt/data/html/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#7 /opt/data/html/tools/upgrade.php(22): UpgradeTool->execute()
#8 {main}
thrown in /opt/data/html/lib/pkp/classes/db/DAO.inc.php on line 703
`

As you can see, I have missing files errors because the database searches for a file and compares it in the files_dir and in fact all the ones it compares do not exist, other errors such as illegal string offset, unserialize, but the fatal error was:

`PHP Fatal error: Uncaught Exception: DB Error: ERROR: invalid input syntax for integer: “” Query: INSERT INTO submission_galley_settings (galley_id, setting_name, setting_value, setting_type) VALUES (?, ?, ?, ?) in /opt/data/html/lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 /opt/data/html/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError()
#1 /opt/data/html/classes/install/Upgrade.inc.php(1454): DAO->update()
#2 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->convertSupplementaryFiles()
#3 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction()
#4 /opt/data/html/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#5 /opt/data/html/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#6 /opt/data/html/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#7 /opt/data/html/tools/upgrade.php(22): UpgradeTool->execute()
#8 {main}
thrown in /opt/data/html/lib/pkp/classes/db/DAO.inc.php on line 703

e sim amigos ja olhei a tabela referida article_galley_settings e os valores sao todos inteiros, nao tem sentido o ojs querer inserir valores string em um campo inteiro, teria como depurar mais? tem como resolver? preciso de uma solução…

1 curtida

@JUCIO_GABRIE ,

tenho uma pista!

como você está utilizando postgresql, creio que tem uma incompatibilidade em utilizar uma determinada função, especificamente, a função de pegar o último registro inserido na tabela submission_galleys, ele usa esse id para fazer um outro insert na tabela submission_galley_settings, utilizando esse último id adicionando.

O problema, acredito eu, que o código não está conseguindo recuperar esse último valor inserido na função $galleyId = $articleGalleyDao->getInsertId(); na linha 1456 do arquivo classes/install/Upgrade.inc.php . Desse modo a variável $galleyId fica vazia.

Pode tentar debugar esse trecho e printar as variáveis para ver se é isso mesmo?

Se sim, você deverá substituir o método $articleGalleyDao->getInsertId(); e fazer uma consulta sql pra tentar recuperar esse último id inserido da tabela submission_galleys

1 curtida

ola @diegojmacedo fiz seu teste e o resultado foi: Este é o valor do var_dump da linha 1444: bool(false)
PKP-Database-Logger 1703147530,6852: -----
(postgres8): INSERT INTO submission_galley_settings (galley_id, setting_name, setting_value, setting_type) VALUES (?, ?, ?, ?)
[ (0=>‘’) (1=>‘pub-id::publisher-id’) (2=>‘artigo substituto’) (3=>‘string’) ]

ou seja ele esta tentando inserir um valor do tipo bool como false, teria como corrigir isso?

1 curtida

alias @diegojmacedo fiz essa alteração no var_dump como pedido acima:

$galleyId = $articleGalleyDao->getInsertId();
echo "Este é o valor do var_dump da linha 1444: ";
var_dump($galleyId);

                                    $galleyId = ($galleyId === false) ? 0 : $galleyId;
                                    echo "Este agora é o valor depois da verificacao false no galleyId: ";
                                    var_dump($galleyId);

fiz isso para ver o valor a ser inserido que retornara bool(false) e se for false eu atribuo o valor 0 pois como é paleativo isso nao tem problemas pois nao temos muitos registros disso. mas se voce tiver uma ideia melhor eu aceito

1 curtida

@JUCIO_GABRIE,

Seria mais ou menos isso, isso só pra você verificar se realmente quando dá o erro qual é o valor de $galleyId que é retornado (Imagino que deva ser um valor vazio). Pq aí constatamos que pode ser problema na biblioteca ADOdb com a versão postgres.

Quando dê o erro faça um select no banco e verifica o último registro inserido na tabela submission_galleys só pra gente ver o valor do galley_id.

De todo modo, caso seja problema no $articleGalleyDao->getInsertId() , tu deves fazer uma query só pra recuperar esse o id do último registro inserido.
Acredito que esse id seja do tipo serial (autoincremento),
sendo assim tu podes tentar substituir $galleyId = $articleGalleyDao->getInsertId();por esse código :

	    $articleGalleyResult = $articleGalleyDao->retrieve('SELECT max(galley_id) as galley_id_max FROM submission_galleys');
		$articleGalleyMaxRow = $articleGalleyResult->GetRowAssoc(false);
		$galleyId = (int) $articleGalleyMaxRow['galley_id_max'];
1 curtida