Best practice forum (Archived)

Sync error with updating users with sync

 
Sarah Cao
Sync error with updating users with sync
by Sarah Cao - Thursday, 11 April 2013, 8:43 AM
 

I've having an issue with Totara Sync updating existing users, where I'm getting "cannot create user [username] - Error writing to database" on the Sync log.

On the csv file, we have the fields that we need and have previously uploaded new users and updated existing users successfully. We do not have the city and country fields on the csv.

This time, we are creating/updating around 15 users, of which two existing users had been manually created and had their city and country filled out. When uploaded, the sync stops at these  two users and doesn't get to the rest of the users on the csv. Once these two users are removed, the upload/update goes smoothly for the other users.

I've ticked off the Totara Sync checkbox in their profiles to let them be updated via Totara Sync but it is still repeating the error.

Here are some things I've tried to get it working with the two users isolated on a separate csv:

  • Added city and country to the CSV, and enabled it in the User - CSV source settings (in case anyone asks, I used the 2-character ISO country code: GB and US)
    • 1. Left both fields blank to overwrite the existing city and country
    • 2. Filled in the fields with new information to overwrite the existing city and country
    • 3. Filled in the same information for city and country
Additional info: Debug doesn't show any messages, although we are also having an issue with cron (but Totara Sync cron runs fine; don't know if this is related). We have Totara 2.2.15. Only one of the users that we are having an issue with has logged in, the other hasn't accessed the LMS yet. 
If anyone can point me in the right direction, I'd appreciate it.

? ?
Re: Sync error with updating users with sync
by ? ? - Thursday, 11 April 2013, 11:48 AM
 
I have seen "Error writing to database" messages from Totara sync as well. Just wanted add a "me too" to the mix and will update if I can gather any additional diagnostic information.
me
Re: Sync error with updating users with sync
by George Angus - Thursday, 11 April 2013, 4:09 PM
Group Totara

Hi Sarah,

Can you send me a copy of the CSV? Are the two users at the top of the list?

cheers,

George.

me
Re: Sync error with updating users with sync
by George Angus - Sunday, 14 April 2013, 2:24 PM
Group Totara

Hi Sarah,

Thanks for the email - the csv appears to be OK. I think what the error message is indicating is a discrepancy between the user IDs, or usernames in the upload file - that is it cant match the user properly with the new data - can you check ID, Username & email addr?

cheers,

George.

Sarah Cao
Re: Sync error with updating users with sync
by Sarah Cao - Monday, 15 April 2013, 12:42 PM
 

Thank you for your suggestion George! As it turned out, the two users didn't have their ID numbers assigned to them when they were created manually. I added it and the sync is working properly again. Many thanks for helping me find the simple but elusive solution!