Error writing to database !!!! when running sync.php for Enrolments via External Database

Error writing to database !!!! when running sync.php for Enrolments via External Database

by Sali Kaceli -
Number of replies: 4
I am hoping someone could help with this. All of a sudden, our external database sync script is not running on our Moodle installation. When even running it manually via command line, we are getting error: !!! Error writing to database !!! and that is is. 


The test settings under the Admin GUI interface for the External Database Connection is successful. And we are running the script as root equivalent. Any ideas anyone on what where the issue might be. 


We are using Moodle 3.0.1 on Ubuntu. 



Average of ratings: Useful (1)
In reply to Sali Kaceli

Re: Error writing to database !!!! when running sync.php for Enrolments via External Database

by Sali Kaceli -

I am finding that the same error happens also when running the user sync with MS Active Directory. 

In reply to Sali Kaceli

Re: Error writing to database !!!! when running sync.php for Enrolments via External Database

by Sali Kaceli -

Also, we are using LDAPs for authentication which works fine on the GUI login. Anyone else running Moodle 3 can confirm that the CLI       sync.php scripts run for user and course enrolments? 

In reply to Sali Kaceli

Re: Error writing to database !!!! when running sync.php for Enrolments via External Database

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
You can now set up the user sync through the task manager.  If it is set up to run through that, it will not run from cli.  However, this only applies to the user sync.  The enrolment sync is still run from cli.
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Error writing to database !!!! when running sync.php for Enrolments via External Database

by Sali Kaceli -

Thank you for getting back to me regarding this. We spent most of the day on this and found that some of our course names for some reason had a funky dash as part of the course long name in our external table for synching. Then the moodle script was somehow translating it as \x968 as in the image below. 

So the actual name of the course in line 11 below woudl have been SP17-EDU342-00-Science 4-8, Moodle was seeing it as 48 and then giving error \x968 as you can see at the top of the image. 

sdfdsdf