Json Parser syntax error in log - Genesis 8 Male Smart Content no longer working

Olo_OrdinaireOlo_Ordinaire Posts: 742

DAZ Studio 4.15.0.14 Pro Public Build  64-bit

I started troubleshooting when all Genesis 8 males stopped working with Smart Content.   In the DAZ Studio log, I see this on scene load, but there's no clue about what file it's trying to read.

2021-07-29 14:06:42.604 Json Parser (1,1): Syntax error - expected '{' or '['

By "stopped working with Smart Content" I mean that when I select a Genesis 8 Male character in a scene, the Smart Content pane instantly stops showing Poses, Wardrobe, etc -- things that are normally context sensitive by-character and that work correctly for Genesis 8 Female characters.

I have tried resetting the CMS database and have re-imported metadata several times, with no change.

I've also been re-installing products that I thought might be problems -- ones that have dependencies on other products, but I can't change the problem.

Has anyone got any suggestions ?

Thanks,

Olo

 

Post edited by Olo_Ordinaire on

Comments

  • NorthOf45NorthOf45 Posts: 5,475

    That error comes from a corrupted download, which usually results in a truncated file, which invariably throws a syntax error. Are you installing with Connect (from DAZ Studio)? Try downloading again. Resetting the database and re-importing the metadata will not help if the .duf file is no good to begin with.

  • Thanks.  The thing is, I don't know what's broken.   I get this error when just starting DAZ Studio, then loading a basic Genesis 8 Male figure with nothing else in the scene.   No error is thrown until I load G8 Male.

    On your advice, I just now tried uninstalling, deleting, then re-installing the Genesis 8 Male starter essentials, but get the same error in the log.

    I use only DIM to install and uninstall DAZ products.

    I would love for the log file to say "Json error parsing flile FLUGELMEISTER.dsx" or whatever...

     

     

  • NorthOf45NorthOf45 Posts: 5,475

    It is likely something you installed recently, if it just started. Maybe include a little more of the log file from the time you select the figure up to the error to see which files are being opened. There is usually a clue in there, even if it looks unlikely.

    What happens if you add a new G8M figure to an empty scene? Does the Smart Content work properly?

  • Thanks again for responding.

    Loading a basic G8 Male into an empty scene produces the error, so it's something  very fundamental.   The log is free of errors until I add the G8 Male figure, then the log looks like this:

     

    2021-07-29 15:27:22.744 Fragment Shader:

    Fragment Shader compiled successfully.

    Linking Shader:

    Shader Program successfully linked.

    2021-07-29 15:27:23.353 Json Parser (1,1): Syntax error - expected '{' or '['

    2021-07-29 15:27:55.013 *** Scene Cleared ***

     

    After that, there are a number of warnings regarding "Could not find output property for formula..."    referring to missing dependent figures:   Joe 8 for Furgle 8 etc.  But these are warnings, not hard errors and do not seem to effect Genesis 8 Female figures in any negative way.

     

  • PerttiAPerttiA Posts: 10,024

    If you have already downloaded and installed a fresh copy of Genesis 8 Starter Essentials, it comes down to process of elimination.

    Whenever you load a G8M based figure or the base figure, DS will read all the morphs that can be found in ...\Data\DAZ 3D\Genesis 8\Male\Morphs\ and all of it's subfolders.
    Start by moving half of those subfolders out of the content library folder tree, but do not move the ...\Data\DAZ 3D\Genesis 8\Male\Morphs\DAZ 3D\ until you have tried moving everything else.

    The best crash test dummy for this is the "Genesis 8 Male Dev Load", found in ...\People\Genesis 8 Male\Developer Kit\ as it doesn't load anything unnecessary

  • Thanks, both of you.   I'll try directory-wrangling next.

     

  • Well, I don't think it's a morph file.  Maybe something else.

    I temporarily moved all the 3rd-party add-on morph directories away from the Library directory and still got the error.  I then moved the named character subdirectories out of the DAZ 3D morph directory and still got the error.  I then had just the base figure stuff -- all about two years old, 2019, by file date.

    I even moved my 3rd party product library out of the tree so DAZ wouldn't see it when it started -- same error.

    It's either some other type of file associated with a G8M load, or some other key DAZ Studio file is corrupted.

     

  • PerttiAPerttiA Posts: 10,024

    You said you are using DIM to install products, but do you log in to DS? If you do, is there any chance that "Smart" Content/DAZ Connect has done any installing/updating?

    I am asking this because then you would find the stuff in completely different location than the traditional folder tree - Can't help with the location bacause I have never logged in to DS and never use DAZ Connect for anything. The path DAZ Connect uses is under \Data\ and has \Cloud\ in it and whatever DS finds there has priority over any and all (working) installations.
    DAZ Connect has a bad habit of corrupting donloaded files and causing "Syntax error - expected '{' or '['" errors.

  • I never log into DAZ via DAZ Studio/Connect.   I only connect via DIM.

    I'll double check that "cloud" path, though, in case there are gremlins!

     

  • Ok, I found some antique ( 2019 ) stuff in the cloud folder tree -- it was small handful 8 antique items left over from when I used DAZ Connect 2 years ago, but removing ALL the contents of  the "cloud" tree didn't change the error.

    As a second step, I removed ALL the contents of    ...\Data\DAZ 3D\Genesis 8\Male\Morphs\   -- it's completely empty.

    Loading a Genesis 8 Male Dev figure still produces the Json parser error.   There are errors regarding stuff that's missing from the morphs folders, like eyelash curl, etc., but the Json parser error occurs right at the beginning, just as it did when the libraries are configured normally.

    Is my last resort to re-install the DAZ Studio application ?

     

  • PerttiAPerttiA Posts: 10,024

    Reinstalling DS doesn't help when the problem is with the content.

    Download "IM00042071-02_Genesis8MaleStarterEssentials.zip" manually from;
    https://www.daz3d.com/downloader/customer/files#prod_42071

    Replace the "Genesis8Male.dsf" in ...\Data\DAZ 3D\Genesis 8\Male\ with the one in the installation package, start DS and try to load "Genesis 8 Male Dev Load" - Do you still get the same error?

  • I replaced "Genesis8Male.dsf"  from the manually-downloaded zip file.   The original and the downloaded one had the same file date and size ( 3500KB and 1/25/2021 ).

    The same Json error appeared in the log when I loaded the G8M Dev figure.

     

  • Okay, this gets more weird as I look deeper.

    The Json parser error is logged any time I add a G8M figure to a scene  AND  I see it on closing DAZ Studio.  

    In other words, I start DAZ Studio and do nothing.  I clear the log file,  then exit DAZ Studio:

    2021-07-30 07:27:37.625 Fragment Shader:

    Fragment Shader compiled successfully.

    Linking Shader:

    Shader Program successfully linked.

     

    2021-07-30 07:27:38.213 Json Parser (1,1): Syntax error - expected '{' or '['

    2021-07-30 07:28:01.008 Saving session layout...

    2021-07-30 07:28:01.020 Saving custom actions...

    2021-07-30 07:28:01.021 Saving session actions...

    2021-07-30 07:28:01.030 Saving session menus...

    2021-07-30 07:28:01.043 Saving session toolbars...

    2021-07-30 07:28:01.050 Begin Application cleanup...

     

     

    .

    .

    .

  • PerttiAPerttiA Posts: 10,024

    Under ...\Data\DAZ 3D\Genesis 8\Male\ there's still folders for "Projection Morphs", "Projection Templates", "Tools" and "UV Sets", move these all out of your content library and extract the data folder from the manually downloaded zip to your content library.

    If that doesn't help, I'm out of ideas.

  • Ok, I'll give that a try.   The way the "Linking Shader" messages appear with the parser error even when the application is just started, then immediately shut down, makes me think that there's a log buffer that's written, but only flushed on certain events:  the character load and application exit  events might be two such.

    So the parser error might be encountered during application startup, and sent to the log buffer, but since it's not flushed, we don't see it until one of those triggering events occurs.

    I'd love to see the exception handler log the name of the file it's stumbling on, though!

     

  • OmnifluxOmniflux Posts: 377

    In the script IDE, you can run

    App.flushLogBuffer();

    to flush the log buffer immedietly at any point.

    Would you check if you have a startup script (Preferences -> Startup -> Load File) or scene (Preferences -> Scene -> Load File) configured?

     

  • NorthOf45NorthOf45 Posts: 5,475

    Looking in my log, I see the "Fragment Shader compiled successfully. Linking Shader: Shader Program successfully linked." as the last entry after restarting (just before loading my default scene which sets a few initial values for aspect, environment, etc.), so there is nothing "wrong" up to that point. Letting it sit for a while does not produce any more messages. Loading G8M is uneventful apart from a number of warnings.

    The " Json Parser (1,1): Syntax error - expected '{' or '[' " suggests the first character it sees in some file is wrong. All .duf and .dsf files (and likely any other data-type files) start with a '{'. In the "/data/DAZ 3D/Genesis 8/Male/" folder and sub-folders, check for some file that doesn't start with that opening '{'. You've already ruled out the morphs files by temporarily disabling them, so look at the rest.

  • OmnifluxOmniflux Posts: 377

    In addition to the startup files previously mentioned, here are some other scripts that run at startup and may attempt to load data (assuming Windows)

    • %APPDATA%\Roaming\DAZ 3D\Studio 4\StartupScript.dsa
    • %APPDATA%\Roaming\DAZ 3D\Studio 4\RunOnce\*

    There are also some in C:\Program Files\DAZ 3D\DAZStudio4\scripts but they cannot be modified, only replaced and are unlikely to be causing the issue.

    If the error is showing up without loading any content, then it is likely that this error and your smart content problem are two unrelated issues.

    Would you check this thread and see if it seems like the same problem you are having with smart content?

  • Olo_OrdinaireOlo_Ordinaire Posts: 742
    edited July 2021

    I checked Preferences and there are no startup load files in either panel.

    In AppData\Roaming\...\StartupScript.dsa   there are a few lines of code regarding Puppeteer, but no opening braces. The RunOnce directory is empty.

    FYI, here is the StartupScript.dsa file, in full:

     

    // DAZ Studio version 0.0.0.0 filetype Startup Script

    /*********************************************************************/

    // Puppeteer Pane State:

    var oPuppeteerPane = MainWindow.getPaneMgr().findPane( "DzPuppeteerPane" );

    if( oPuppeteerPane != undefined ) {

    oPuppeteerPane.setPlayAudio( true )

    oPuppeteerPane.setFillFrames( true )

    oPuppeteerPane.setExtendFrames( true )

    }

    /*********************************************************************/

    // Main Window State:

    MainWindow.geometry = new Rect( 27, 52, 2478, 1317 );

    ------------------------------------------

    Ok, so that's executable code, not XML, so probably wouldn't have the opening braces, I guess...

     

    Post edited by Olo_Ordinaire on
  • The discussion about Phx Tucker in the Commons forum  (user Worlds_Edge post, July 20) sounds like what I'm seeing.  I did buy the Tucker figure, as well, though I haven't loaded an instance of him.

     

  • PerttiAPerttiA Posts: 10,024

    NorthOf45 said:

    Looking in my log, I see the "Fragment Shader compiled successfully. Linking Shader: Shader Program successfully linked." as the last entry after restarting (just before loading my default scene which sets a few initial values for aspect, environment, etc.), so there is nothing "wrong" up to that point. Letting it sit for a while does not produce any more messages. Loading G8M is uneventful apart from a number of warnings.

    The " Json Parser (1,1): Syntax error - expected '{' or '[' " suggests the first character it sees in some file is wrong. All .duf and .dsf files (and likely any other data-type files) start with a '{'. In the "/data/DAZ 3D/Genesis 8/Male/" folder and sub-folders, check for some file that doesn't start with that opening '{'. You've already ruled out the morphs files by temporarily disabling them, so look at the rest.

    Doesn't have to be the first character. The ones I have fixed have typically missed a character at the end of some line in the code. It's quite easy to spot when looking at it in Notepad++, but the difficult part is identifying the corrupted file if there is no hint inside the log. 

  • NorthOf45NorthOf45 Posts: 5,475

    Well, you'll have to backtrack and uninstall everything after the problem started. You can set the appropriate sort order in DIM -Installed tab. That might remove the problem file, then you can see if you can load G8M. Start adding products back in until it fails again. You might need to refresh the Starter Essentials if some product wrote to the database and uninstalling doesn't restore the value. Or, re-import metadata before re-installing the products you removed. In that case resetting the database first might do some good. You did it before, but if the bad apple was still being loaded, it would still mess up the data.

  • OmnifluxOmniflux Posts: 377

    Olo_Ordinaire said:

    Ok, so that's executable code, not XML, so probably wouldn't have the opening braces, I guess...

    Sorry, I didn't mean to imply one of the startup files contained the error. The error you are seeing looks like a problem loading content (usually a .dsf or .duf file) and while the startup scene could be an issue, for the rest of the startup scripts it would be something they in turn load - but it looks like that is not the case.

     

    Just to be clear, you can reproduce this error in the log by launching DS and immediately closing DS without loading any content? Because that rules out nearly all content.

     

    The next thing I would try is launch DS, go to Edit -> Preferences -> Content Directory Manager and remove all content directories (record them so you can add them back later), and exit and relaunch DS to see if the error still occurs. If not, add the content directories back one by one - but if it does still occur, then you've narrowed it down to something in your profile or the program files directory.

  • Olo_OrdinaireOlo_Ordinaire Posts: 742
    edited July 2021

    After seeing the discussion in The Commons thread about the Phx Tucker character, I thought I'd start by removing that product.  

    Smart Content for Genesis 8 Male goes back to normal behavior after removing the Phx Tucker character, so somehow, it has polluted the metadata for all the other G8 males.

    The Json parser error remains in the log, but it's good to have Smart Content behaving rationally now!

    I will try removing the content directories from the application settings and see if we can cut the problem in half.

    Thanks again for everyone's suggestions and help with this!

     

    Post edited by Olo_Ordinaire on
  • I removed the references to the DAZ Library folders in Preferences - Content and restarted DAZ Studio.  I even re-named the root directory on the source disk, so that DS couldn't find it.

    The Json parser error is still there in the log on startup, so it's very curious, indeed.

     

  • OmnifluxOmniflux Posts: 377
    edited July 2021

    Great to hear that you've resolved your primary issue!

    Also great that you've eliminated all your content as causing the JSON error.

    Could you launch DS with the following command line options?

    C:\Users\Username>"C:\Program Files\DAZ 3D\DAZStudio4\DAZStudio.exe" -instanceName Test -cleanOnExit true

    Before closing DS, check the logfile (It will be in a new location, in this example C:\Users\Username\AppData\Roaming\DAZ 3D\Studio4 [Test]\log.txt)

    This will narrow down the issue to your app settings which we will bypass in this instance, or your installed files which will be the same either way.

    Post edited by Omniflux on
  • I started a test instance as you described.   Checking the log file in the Test directory, there was no Json parser error until I executed the App.flushLogBuffer() command in the IDE window.

     

    So, it seems that the Test instance encounters the same Json parser error.

     

  • OmnifluxOmniflux Posts: 377

    Can you verify that these two files, if they exist, start with '{'?

    • C:\ProgramData\DAZ 3D\CMS\cmscfg.json
    • %APPDATA%\Roaming\DAZ 3D\cms\cmscfg.json

    After that, we're pretty much at the limit of what I can suggest you try besides reinstalling DS and any packages that install as plugins.

    Which may not be worth it if you are not seeing any problems besides the error message in the log.

  • Ok, thanks.  Both of the cmscfg.json files look intact.

    I'm going to try to avoid reinstalling DS and live with the parser error.   Thanks very much for sticking with me on this.

    Cheers,

    Olo

Sign In or Register to comment.