OAI Error badVerb in OJS 3.0.2

Hi @asmecher,

I did the trace and the setIds comes right from the construction of the DAO class. It’s taking from the Request the journal and getting the id from there. This is the trace. So far as I see the logic of the code it’s Ok and is working.

classes/oai/ojs/JournalOAI.inc.php

39	function __construct($config) {
40		parent::__construct($config);
41
42		$this->site = Request::getSite();
43		$this->journal = Request::getJournal();
44		$this->journalId = isset($this->journal) ? $this->journal->getId() : null;
45		$this->dao = DAORegistry::getDAO('OAIDAO');
46		$this->dao->setOAI($this);
47	}

[43] $this->journalId = NULL
[44] $this->journalId = string(1) “5”

classes/oai/ojs/JournalOAI.inc.php

108	function repositoryInfo() {
109		$info = new OAIRepository();
110
111		if (isset($this->journal)) {
112			$info->repositoryName = $this->journal->getLocalizedName();
113			$info->adminEmail = $this->journal->getSetting('contactEmail');
114
115		} else {
116			$info->repositoryName = $this->site->getLocalizedTitle();
117			$info->adminEmail = $this->site->getLocalizedContactEmail();
118		}
119
120		$info->sampleIdentifier = $this->articleIdToIdentifier(1);
121		$info->earliestDatestamp = $this->dao->getEarliestDatestamp(array($this->journalId));
122
123		$info->toolkitTitle = 'Open Journal Systems';
124		$versionDao = DAORegistry::getDAO('VersionDAO');
125		$currentVersion = $versionDao->getCurrentVersion();
126		$info->toolkitVersion = $currentVersion->getVersionString();
127		$info->toolkitURL = 'http://pkp.sfu.ca/ojs/';
128
129		return $info;
130	}

[121] array($this->journalId) = array(1) { [0]=> string(1) “5” }

classes/oai/ojs/OAIDAO.inc.php

52	/**
53	 * @see lib/pkp/classes/oai/PKPOAIDAO::getEarliestDatestamp()
54	 */
55	function getEarliestDatestamp($setIds = array()) {
56		return parent::getEarliestDatestamp('SELECT	CASE WHEN COALESCE(dot.date_deleted, a.last_modified) > i.last_modified THEN i.last_modified ELSE COALESCE(dot.date_deleted, a.last_modified) END', $setIds);
57	}

[56] $setIds = array(1) { [0]=> string(1) “5” }

/lib/pkp/classes/oai/PKPOAIDAO.inc.php

051   	function getEarliestDatestamp($selectStatement, $setIds = array()) {
052   		$params = $this->getOrderedRecordParams(null, $setIds);

264 	function getOrderedRecordParams($dataObjectId = null, $setIds = array(), $set = null) {
265 		$params = array();
266 
267 		if (isset($dataObjectId)) {
268 			$params[] = $dataObjectId;
269 		}
270 
271 		$notNullSetIds = array();
272 		if (is_array($setIds) && !empty($setIds)) {
273 			foreach($setIds as $id) {
274 				// Avoid null values.
275 				if (is_null($id)) continue;
276 				$notNullSetIds[] = (int) $id;
277 				$params[] = (int) $id;
278 			}
279 		}
280 
281 		// Add the data object id again.
282 		if (isset($dataObjectId)) {
283 			$params[] = $dataObjectId;
284 		}
285 
286 		// Add the set specification, if any.
287 		if (isset($set)) {
288 			$params[] = $set;
289 		}
290 
291 		// Add the set ids again, so they can be used in the tombstone JOIN part of the sql too.
292 		$params = array_merge($params, $notNullSetIds);
293 
294 		return $params;
295 	}

[264] $dataObjectId: NULL
$setIds: array(1) { [0]=> string(1) “4” }
$set: NULL

[265] $params: array(0) { }

[269] $dataObjectId: NULL
$params: array(0) { }

[271] $setIds: array(1) { [0]=> string(1) “4” }

[277] $id:4

[279] $params: array(1) { [0]=> int(4) }
$notNullSetIds: array(1) { [0]=> int(4) }

[289] $params: array(1) { [0]=> int(4) }

[294] $params: array(2) { [0]=> int(4) [1]=> int(4) }

This is a detailed debug information from the request “site/index.php/journal/oai?verb=Identify”

(postgres7): SELECT * FROM sessions WHERE session_id = ?   [ (0=>'fk09use9kf4lgjk39sj7842rh6') ]
(postgres7): INSERT INTO sessions (session_id, ip_address, user_agent, created, last_used, remember, data, domain) VALUES (?, ?, ?, ?, ?, ?, ?, ?)   [ (0=>'fk09use9kf4lgjk39sj7842rh6') (1=>'181.61.104.145') (2=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KH...') (3=>'1515562558') (4=>'1515562558') (5=>'0') (6=>'') (7=>'site') ]
(postgres7): SELECT * FROM journals WHERE path = ?   [ (0=>'journal') ]
(postgres7): SELECT * FROM journal_settings WHERE journal_id = ?   [ (0=>'5') ]
(postgres7): SELECT * FROM site  
(postgres7): SET TIME ZONE INTERVAL '-5:00' HOUR TO MINUTE  
(postgres7): SELECT v.* FROM versions v LEFT JOIN plugin_settings ps ON lower(v.product_class_name) = ps.plugin_name AND ps.setting_name = 'enabled' AND (context_id = ? OR v.sitewide = 1) WHERE v.current = 1 AND (ps.setting_value = '1' OR v.lazy_load <> 1)   [ (journal=>'5') ]
(postgres7): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ? AND context_id = ?   [ (0=>'defaultthemeplugin') (1=>'5') ]
(postgres7): SELECT * FROM journals WHERE path = ?   [ (0=>'journal') ]
(postgres7): SELECT * FROM journal_settings WHERE journal_id = ?   [ (0=>'5') ]
(postgres7): UPDATE plugin_settings SET setting_value='1',setting_type='bool' WHERE context_id='5' and plugin_name='google_academico' and setting_name='enabled'  
(postgres7): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ? AND context_id = ?   [ (0=>'google_academico') (1=>'5') ]
(postgres7): UPDATE plugin_settings SET setting_value='1',setting_type='bool' WHERE context_id='5' and plugin_name='bases_indices' and setting_name='enabled'  
(postgres7): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ? AND context_id = ?   [ (0=>'bases_indices') (1=>'5') ]
(postgres7): UPDATE plugin_settings SET setting_value='1',setting_type='bool' WHERE context_id='5' and plugin_name='cupon_suscripcion' and setting_name='enabled'  
(postgres7): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ? AND context_id = ?   [ (0=>'cupon_suscripcion') (1=>'5') ]
(postgres7): UPDATE plugin_settings SET setting_value='1',setting_type='bool' WHERE context_id='5' and plugin_name='clusrtmapingenierias' and setting_name='enabled'  
(postgres7): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ? AND context_id = ?   [ (0=>'clusrtmapingenierias') (1=>'5') ]
(postgres7): UPDATE plugin_settings SET setting_value='1',setting_type='bool' WHERE context_id='5' and plugin_name='addthis' and setting_name='enabled'  
(postgres7): SELECT setting_name, setting_value, setting_type FROM plugin_settings WHERE plugin_name = ? AND context_id = ?   [ (0=>'addthis') (1=>'5') ]
(postgres7): SELECT last_run FROM scheduled_tasks WHERE class_name = ?   [ (0=>'plugins.generic.usageStats.UsageStatsLoader') ]
(postgres7): SELECT last_run FROM scheduled_tasks WHERE class_name = ?   [ (0=>'plugins.importexport.crossref.CrossrefInfoSender') ]
(postgres7): SELECT last_run FROM scheduled_tasks WHERE class_name = ?   [ (0=>'plugins.importexport.datacite.DataciteInfoSender') ]
(postgres7): SELECT last_run FROM scheduled_tasks WHERE class_name = ?   [ (0=>'plugins.importexport.medra.MedraInfoSender') ]
(postgres7): SELECT last_run FROM scheduled_tasks WHERE class_name = ?   [ (0=>'lib.pkp.classes.task.ReviewReminder') ]
(postgres7): SELECT * FROM static_pages WHERE context_id = ? AND path = ?   [ (0=>'5') (1=>'oai') ]

(postgres7): SELECT	CASE WHEN COALESCE(dot.date_deleted, a.last_modified) > i.last_modified THEN i.last_modified ELSE COALESCE(dot.date_deleted, a.last_modified) END FROM mutex m LEFT JOIN published_submissions pa ON (m.i=0) LEFT JOIN submissions a ON (a.submission_id = pa.submission_id AND a.context_id = ?) LEFT JOIN issues i ON (i.issue_id = pa.issue_id) LEFT JOIN sections s ON (s.section_id = a.section_id) LEFT JOIN journals j ON (j.journal_id = a.context_id) LEFT JOIN data_object_tombstones dot ON (m.i = 1) LEFT JOIN data_object_tombstone_oai_set_objects tsoj ON (tsoj.tombstone_id = dot.tombstone_id AND tsoj.assoc_type = 256) LEFT JOIN data_object_tombstone_oai_set_objects tsos ON tsos.assoc_id = null WHERE ((s.section_id IS NOT NULL AND i.published = 1 AND j.enabled = 1 AND a.status <> 4) OR (dot.data_object_id IS NOT NULL))   [ (0=>'5') (1=>'5') ]

-1: ERROR: bind message supplies 2 parameters, but prepared statement “” requires 1
                                    ADOConnection._Execute(SELECT	CASE WHEN COALESCE(dot.date_deleted, a.last_modified) > i.last_modified THEN i.last_modified ELSE COALESCE(dot.date_delet..., Array[2]) % line 1047, file: adodb.inc.php
                                 ADOConnection.Execute(SELECT	CASE WHEN COALESCE(dot.date_deleted, a.last_modified) > i.last_modified THEN i.last_modified ELSE COALESCE(dot.date_delet..., Array[2]) % line   99, file: DAO.inc.php
                              DAO.retrieve(SELECT	CASE WHEN COALESCE(dot.date_deleted, a.last_modified) > i.last_modified THEN i.last_modified ELSE COALESCE(dot.date_delet..., Array[2]) % line   59, file: PKPOAIDAO.inc.php
                           PKPOAIDAO.getEarliestDatestamp(SELECT	CASE WHEN COALESCE(dot.date_deleted, a.last_modified) > i.last_modified THEN i.last_modified ELSE COALESCE(dot.date_delet..., Array[1]) % line   56, file: OAIDAO.inc.php
                        OAIDAO.getEarliestDatestamp(Array[1]) % line  120, file: JournalOAI.inc.php
DB Error: ERROR: bind message supplies 2 parameters, but prepared statement “” requires 1

(postgres7): UPDATE sessions SET user_id = ?, ip_address = ?, user_agent = ?, created = ?, last_used = ?, remember = ?, data = ?, domain = ? WHERE session_id = ?   [ (0=>null) (1=>'181.61.104.145') (2=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KH...') (3=>'1515562558') (4=>'1515562558') (5=>'0') (6=>'') (7=>'revistas.uis.edu.co') (8=>'fk09use9kf4lgjk39sj7842rh6') ]

I still think the problem might me related to Postgres ( % line 1047, file: adodb.inc.php).
I read that Postgresql needs BindParams like $1, $2, $3 for prepared statements instead of ? like most of the other supported databases. Maybe the adodb library that handles the db request

My current version of DB is Postgres 9.2.21.

Anyway, just let me know what you think to provide further insight. As always, thank you

Hi @hekutoru2kx,

The ADODB library takes care of making sure that standard ? bindings work for the databases it supports; I’m pretty sure that’s not the issue (and it would also break pretty much every query in the system).

I’m afraid I still can’t duplicate this locally. Would you be willing to provide me with temporary (ideally SSH) access to your installation? If so, send me a private message with details.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher @hekutoru2kx The access data will be sent, by private message

Hi @asmecher,

We gladly want to inform you that we found and solved the problem.

After receiving your feedback and accepting your advice we discarded the option that the problem was related to any postgres database and decided to make a detailed file by file test and comparison with the original clean instalation. We disabled all the plugins and restore file by file the file that were changed/patched/updated/customized and the problem persisted.

So we ran some test on files and found out that one of the files (/lib/pkp/classes/oai/PKPOAIDAO.inc.php) was corrupted. The file showed all the content of the original file and metadata. But the application we used tagged the file as different for some reason (unknown reason). After we restored the file with the clean original this problem was solved.

After that, we only had problem with the DRIVER plugin compatibility and we let them disabled.

Thanks as always for your patience and support. Keep it up,

Héctor Hernández

Hi @hekutoru2kx,

Glad to hear the issue is resolved!

Regards,
Alec Smecher
Public Knowledge Project Team

Me ayudas? help me. https://ciidjournal.com/index.php/abstract/oai

Me ayudas? help me. https://ciidjournal.com/index.php/abstract/oai
https://ciidjournal.com/index.php/abstract/oai?verb=ListRecords&metadataPrefix=oai_dc

Me ayudas? help me. https://ciidjournal.com/index.php/abstract/oai
https://ciidjournal.com/index.php/abstract/oai?verb=ListRecords&metadataPrefix=oai_dc

Hello @Efren_Lobo,

This is quite an older post. Can you create a new post and describe the issue you are facing in more detail? Please include your version number of your OJS instance and feel free to link back to this post if it is similar to the issue you are encountering.

Best regards,

Roger
PKP Team