sudden enrollment sync error in moodle 2.2.3

sudden enrollment sync error in moodle 2.2.3

by Brian Gold -
Number of replies: 1

We've been using moodle 1 for a few years and have decided to move to moodle 2 recently. I was able to get this working on a test server without any major issues. We are using an external postgres database for course dat a & enrolment and the sync for this has been working just fine for about 4 weeks. As of yesterday though, we started getting the following errors in the sync:

[root@moodle-test ~]# /usr/bin/php -c /etc/php.ini -d memory_limit=512M -d log_errors=1 -d error_reporting=E_ALL -d display_errors=0 -d html_errors=0 /var/www/moodle/enrol/database/cli/sync.php
Default exception handler: Error reading from database Debug: ERROR: invalid input syntax for integer: "Arts"
SELECT 'x' FROM mdl_course_categories WHERE id = $1 LIMIT 1 OFFSET 0
[array (
0 => 'Arts',
)]
* line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
* line 637 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 1591 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_recordset_sql()
* line 1576 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql()
* line 1560 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_select()
* line 619 of /enrol/database/lib.php: call to moodle_database->record_exists()
* line 78 of /enrol/database/cli/sync.php: call to enrol_database_plugin->sync_courses()

!!! Error reading from database !!!
!! ERROR: invalid input syntax for integer: "Arts"
SELECT 'x' FROM mdl_course_categories WHERE id = $1 LIMIT 1 OFFSET 0
[array (
0 => 'Arts',
)] !!
!! Stack trace: * line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
* line 637 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 1591 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_recordset_sql()
* line 1576 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql()
* line 1560 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_select()
* line 619 of /enrol/database/lib.php: call to moodle_database->record_exists()
* line 78 of /enrol/database/cli/sync.php: call to enrol_database_plugin->sync_courses()
!!

 

Any clue as to what might be causing this?

Average of ratings: -
In reply to Brian Gold

Re: sudden enrollment sync error in moodle 2.2.3

by Luca Testoni -

I've the same issue with a SELECT of a Webservice


When i do a SELECT with id = course shortname i receive the same error

$result = $DB->get_record('course', array('shortname'=>$course['shortname']));

ERROR: invalid input syntax for integer: "icm-9(20-267)" SELECT * FROM mdl_course WHERE id = $1 [array ( 0 => 'icm-9(20-267)', )]