error message "obj.toJSON is not a function"

Hi,
I am unable to sync Zotero, the error message is "obj.toJSON is not a function" . The Report ID is 595871413 and the Debug ID is D814554620.
  • Does it go away if you restart Zotero?
  • @gaomingsorock: Also, just to check, are you purposely trying to upload a massive number of items? If not, make sure you've emptied your trash before trying to sync if, say, you've recently imported many items and deleted them.
  • @gaomingsorock: Actually, I asked you a similar question the last time you reported this, and you never responded:

    https://forums.zotero.org/discussion/83607/obj-tojson-is-not-a-function
  • @dstillman I'm sorry I didn't respond to you last time. I've not synced the library for almost half a year since there was always some problem with the sync system. I did systematically import a lot of items and organized them daily with my research going.

    Last time the web library was totally in mess and I didn't want to risk my local library. But this time I want to share part of my library to other scholars, so I need to sync it. I tried " replace onlie library", and found my library finally synced sucesfully to the web library except this error message.

    I've empted the trash in both local library and web library (manually deleted them), now the number of items in local library is 178394 while web library is 178447。Before sync there was only around 120000 items in the web library. It's almost there, but I can't solve this "obj.toJSON is not a function" .
  • Can you provide another Debug ID from Zotero startup through the error, using the "Restart with Logging Enabled…" option?
  • @dstillman the new Debug ID: D1668466003, but now I would be stucked when "downloading items in my library", you could see the screenshot at https://www.dropbox.com/s/2lnd9flxy2rybmz/CleanShot 2020-11-06 at 11.02.53@2x.png?dl=0. then I can do nothing excerpt forcing quit the app. I tried many times, but it would always been stucked. I left the computer running over a night, but It still stucked in the next morning.

    I checked my web library, the items I edited in the local library were synced sucessfully but the new items I just added were not updated to the web library.
    Should I try "replace onlie library" again?
  • Should I try "replace onlie library" again?
    No, absolutely not. That's not a troubleshooting feature.

    If you check your database integrity from the Advanced → Files and Folders pane of the Zotero preferences, does it pass?
    I can do nothing excerpt forcing quit the app
    What do you mean by that? Are you saying the app is unresponsive?

    When you sync, you're getting a conflict resolution window, right? What are you choosing in that window?

    You seem to have submitted that Debug ID in the middle of an active sync. You can use Help → Debug Output Logging → View Output to confirm that things are still happening. We'd only need a Debug ID once activity stopped.
  • @gaomingsorock: Before you do anything else, can you go to Tools → Developer → Run JavaScript, run the following code, and let me know the result?

    return await Zotero.DB.columnQueryAsync('SELECT key FROM syncQueue WHERE libraryID=? AND syncObjectTypeID IN (SELECT syncObjectTypeID FROM syncObjectTypes WHERE name=?)', [1, 'item'])
  • @dstillman after a quite long time sync, now the added items were synced to the web library. The problems that I mentioned in the last post were disappeared except the "obj.toJSON is not a function". I used the "Restart with Logging Enabled…" option and the Debug ID is D2147173807. I also run the Javascript, the result is: []. Now the total items in the local library is 178431 while the web library is 178426.
    When the conflict resolution window show, I choose "use the local version for all remaining conflicts".
Sign In or Register to comment.