Failed to parse JSON document

Discuss Moho bugs (or suspected bugs) with other users. To report bugs to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
catlover8976
Posts: 25
Joined: Sat Nov 06, 2010 2:39 pm

Failed to parse JSON document

Post by catlover8976 »

This is the first time I've ever had this error, 'Failed to parse JSON document' causing the file to become completely unreadable, but I saw looking around that some people may be able to recover it?
There's no file in the autosave folder, I'd be forever indebted to anyone who can help recover this, please. I'm using an older version, I hope that isn't an issue.

https://www.mediafire.com/file/88adi1lx ... anime/file
User avatar
synthsin75
Posts: 9979
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Failed to parse JSON document

Post by synthsin75 »

Sadly, it doesn't seem like much survived: https://ufile.io/ni6mc9ve
User avatar
catlover8976
Posts: 25
Joined: Sat Nov 06, 2010 2:39 pm

Re: Failed to parse JSON document

Post by catlover8976 »

Sigh.. Basically nothing, just links to the ref images I was using.

Thank you for trying, is there a way I could figure out how to fix this issue again on my own should it happen?

Also, for anyone potentially getting this in the future, it was likely caused by the program erroring while I was using it; I was hitting delete on some points and it wasn't deleting. I thought closing and reopening the file would fix it, but clearly it didn't save properly. Always make backups, always wait a little while after saving, and just hope you don't get unlucky.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: Failed to parse JSON document

Post by Daxel »

You mentioned you don't have the latest version. There were problems with Moho's autosave feature on previous versions and specifically corrupted saved files like yours that were solved in the latest versions. I can't guarantee all the problems were solved because since then I work with auto-save disabled just in case.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Failed to parse JSON document

Post by Greenlaw »

@catlover8977, you didn't mention which older version you are using but I recall this issue occurring with earlier versions of 12.x and 13.x. The solution at the time was to disable Auto-save.

As Daxel mentioned, Auto-save should work fine for Moho 12.5 and the current 13.5.2. FWIW, I haven't see this happen in either of these releases and I keep Auto-save enabled these days.

In any case, yes, you should save frequent versions of files as you work. I find this is necessary when working in any program, and especially animation 2D or 3D. I save a new version any time I spend a significant time (say 15 to 30 min,) or make a significant change. This way, if something goes wrong or I make a bad decision, I may only lost a few minutes of work. I keep all these backups in a folder until I'm completely finished with the task.

Workflow tip: In my project folder, I keep a work-in-progress folder (usually called 'WIP') where I do all my work, and I keep a folder there called 'old', where I discard any files I'm almost sure I no longer need to manage clutter. The file I render with sits outside of 'WIP' and is unnumbered. This system works best if you use Moho Exporter because Moho always tries to use the project file's name, and if the file uses version numbering, can prevent you from overwriting the previous render. This is an annoying 'feature' of Moho Exporter, but you can trick it this way.

Script tip: If you have trouble remembering to save multiple versions of your work, there are a couple of incremental auto-saving scripts out there that can do this for you. Syntsin75 has a pretty good one. I don't have a link handy ATM, but the script should turn in up in a search. That said, remembering to save often is a good habit to form.

Hope this helps.
User avatar
synthsin75
Posts: 9979
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Failed to parse JSON document

Post by synthsin75 »

catlover8976 wrote: Sat Feb 26, 2022 9:12 am Sigh.. Basically nothing, just links to the ref images I was using.

Thank you for trying, is there a way I could figure out how to fix this issue again on my own should it happen?

Also, for anyone potentially getting this in the future, it was likely caused by the program erroring while I was using it; I was hitting delete on some points and it wasn't deleting. I thought closing and reopening the file would fix it, but clearly it didn't save properly. Always make backups, always wait a little while after saving, and just hope you don't get unlucky.
The .moho/.anme file is actually an archive that can be open with a Zip utility (I use 7-zip). Inside is a thumbnail jpg and Project.mohoproj text file in JSON format. When Moho cannot parse the JSON file, it's usually because the end of it is missing, so there's { and [ brackets that are missing their closing bracket, } and ]. It takes some understanding of nested brackets to repair it enough for Moho to open the file again. In your case, the file only seemed to have a handful of layers, and I had to remove the last, broken one to close all the brackets.

Here's my auto-save script (that Greenlaw mentioned): https://drive.google.com/uc?export=down ... xX5gh9TCkC
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Failed to parse JSON document

Post by Greenlaw »

Hi Wes,

Do you have a dedicated post or web page for that script anywhere? Just want to add it to my list of useful scripts.
User avatar
synthsin75
Posts: 9979
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Failed to parse JSON document

Post by synthsin75 »

Since that's one I released on the now defunct AF forum, I think I've only ever posted it in replies to threads here. This is the one I have bookmarked: http://www.lostmarble.com/forum/viewtop ... 42#p199642
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Failed to parse JSON document

Post by Greenlaw »

Got it. Thanks!
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Failed to parse JSON document

Post by Greenlaw »

Oh, I just ran into a related issue.

Yesterday I whipped up a quick demo project for a post, and I must have forgotten to save it or Moho crashed when I quit. Anyway, I wanted to look at that file and all I found was a file called saving_b334b8a2-970b-4aeb-a593-f8e6954f56d5.temp, which could not be seen or directly opened by Moho.

So I changed the file name to pupils.moho, and Moho opened the file as normal. This wasn't an important file but I'm still glad I was able to recover it.

Just an FYI for any Moho 13.5.2 users who run into this situation.

Edit: Actually, I'm not even sure I had tried to properly save the file before closing Moho. That's probably why the file had such a random name. Anyway, if you see a file like that, changing the extension to .moho should fix it.
User avatar
bebemustacio
Posts: 36
Joined: Sat Mar 02, 2019 12:21 pm

Re: Failed to parse JSON document

Post by bebemustacio »

Just lost few hours of work. In Autosave- Backups folder, all files are 0 kb. And yes, I get those Failed to parse JSON document error as many times before.
This was happening with 13.5.2 and now with 13.5.3. Not sure if this happens just on my system.

Is there any solution to make autosave working?
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Failed to parse JSON document

Post by Greenlaw »

I haven't seen this issue here but when Autosave isn't working for me, I disable it. With or without autosave, I save many versions frequently while I'm working. (I do this in any program I'm working in, not just Moho. It's a good habit.)

As an alternative, Wes' incremental auto save is a good tool. He updated it recently for Moho 13.5.3.

At work we use Window's Previous Versions to make hourly backups for animation files. I think this saves hourly for the current day, and 1 backup every day up to a week. This feature saves my butt when my manually saved backups fail me.
User avatar
synthsin75
Posts: 9979
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Failed to parse JSON document

Post by synthsin75 »

Greenlaw wrote: Mon Apr 11, 2022 9:54 pm As an alternative, Wes' incremental auto save is a good tool. He updated it recently for Moho 13.5.3.
I really just updated it to work for Mac users. Nothing really changed for 13.5.3.
User avatar
bebemustacio
Posts: 36
Joined: Sat Mar 02, 2019 12:21 pm

Re: Failed to parse JSON document

Post by bebemustacio »

Greenlaw wrote: Mon Apr 11, 2022 9:54 pm With or without autosave, I save many versions frequently while I'm working. (I do this in any program I'm working in, not just Moho. It's a good habit.)
Thank you, and of course, I always save files.. but, when I'm animating, sometimes I'm lost in a flow of a process, sometimes more then an hour, and than, having an autosave will really be helpful for me.
What I found is that Moho usually crashes in animation when I try some multiple undo, probably because of rig complexity. So now I'm trying to get habit of ctrl+s always before ctrl+z.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Failed to parse JSON document

Post by Greenlaw »

bebemustacio wrote: Tue Apr 12, 2022 11:15 am ...oho usually crashes in animation when I try some multiple undo, probably because of rig complexity.
Hmm...this makes me wonder if this is a negative keyframe issue. Does this occur only in a certain project or projects that use the same animated assets? If so, check your project using Synthsin75's Delete Negative Keyframe script.

https://lostmarble.com/forum/viewtopic. ... 4&start=15

Hope this helps.
Post Reply