Yet another "cannot connect to database" question

vwranglervwrangler Posts: 4,980

And I do not get this at all. This is a new computer, yes, but Studio connected to the database just fine the first few times I started it. Then today, randomly, this started happening and happening consistently.

Using Studio 4.12 and Windows 10 1903

Relevant part from the log file:

2019-12-01 23:44:43.070 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in CloudFIle::lookupFromDb: Unable to connect to the database
2019-12-01 23:44:43.070 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in CloudFIle::lookupFromDb: Unable to connect to the database
2019-12-01 23:44:43.070 Total class factories: 2168
2019-12-01 23:44:43.070 Iray [VERBOSE] - IRAY:RENDER ::   1.1   IRAY   rend stat : Environment cache size capacity: 5.
2019-12-01 23:44:43.070 Creating Script Engine...
2019-12-01 23:44:43.086 WARNING: 3DConnexion Plug-in Error: Could not create Device, CoCreateInstance failed
2019-12-01 23:44:43.086 3D mouse support library could not be loaded.
2019-12-01 23:44:43.086 Creating Main Window...
2019-12-01 23:44:43.086 Creating Viewport Manager...
2019-12-01 23:44:43.132 Successfully created OpenGL viewport for Viewport1.
2019-12-01 23:44:43.242 Successfully created OpenGL viewport for Viewport2.
2019-12-01 23:44:43.304 Successfully created OpenGL viewport for Viewport3.
2019-12-01 23:44:43.382 Successfully created OpenGL viewport for Viewport4.
2019-12-01 23:44:43.461 Creating Action Manager...
2019-12-01 23:44:43.461 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in getAllAccounts: Unable to connect to the database, can not quote
2019-12-01 23:44:43.461 Creating Pane Manager...
2019-12-01 23:44:43.476 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.476 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.476 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.492 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.492 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.492 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.523 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.523 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.523 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.588 Successfully created OpenGL viewport for AuxViewportView.
2019-12-01 23:44:43.697 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.697 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.713 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.713 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.713 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.713 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.728 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.728 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.728 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.744 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.745 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.745 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.745 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:43.745 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentFilterPathsToCloudInstalledContent: Unable to connect to the database
2019-12-01 23:44:43.745 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentFilterPathsToCloudInstalledContent: Unable to connect to the database
2019-12-01 23:44:43.761 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.069 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.072 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.075 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.077 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.079 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.081 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.091 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.116 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.118 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in categoryGetRoot: Unable to connect to the database
2019-12-01 23:44:44.149 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in CloudFIle::lookupFromDb: Unable to connect to the database
2019-12-01 23:44:44.157 WARNING: QLayout::addChildLayout: layout "" already has a parent
2019-12-01 23:44:44.157 WARNING: QLayout::addChildLayout: layout "" already has a parent
2019-12-01 23:44:44.160 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentGetBySubdir: Unable to connect to the database, can not quote
2019-12-01 23:44:44.161 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentGetBySubdir: Unable to connect to the database, can not quote
2019-12-01 23:44:44.245 WARNING: ..\..\..\..\..\src\sdksource\interface\actions\dzactionmgr.cpp(1711): Index out of range in DzActionMgr::getCustomAction()
2019-12-01 23:44:44.247 Executing startup script...
2019-12-01 23:44:44.289 Started in: C:/Program Files/DAZ 3D/DAZStudio4
2019-12-01 23:44:44.289 DAZ Studio Started
2019-12-01 23:44:44.289 Creating Pixel Buffer
2019-12-01 23:44:44.336 Pixel buffer - Width: 1024 Height: 1024
2019-12-01 23:44:44.336 Compiling OpenGL Shader...
2019-12-01 23:44:44.338 Fragment Shader:
Fragment Shader compiled successfully.
Linking Shader:
Shader Program successfully linked.

2019-12-01 23:44:44.345 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentGetBySubdir: Unable to connect to the database, can not quote
2019-12-01 23:44:44.346 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentGetBySubdir: Unable to connect to the database, can not quote
2019-12-01 23:44:44.346 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentGetBySubdir: Unable to connect to the database, can not quote
2019-12-01 23:44:44.504 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentGetByRelativePath: Unable to connect to the database, can not quote
2019-12-01 23:44:44.819 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in CloudFIle::lookupFromDb: Unable to connect to the database
2019-12-01 23:44:44.834 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in needMigrate: Unable to connect to the database, can not quote
2019-12-01 23:44:44.834 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in runNextTask-runTask: Unable to connect to the database
2019-12-01 23:44:44.917 Migration failed.
2019-12-01 23:44:44.934 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentFilterPathsToCloudInstalledContent: Unable to connect to the database
2019-12-01 23:44:44.934 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentFilterPathsToCloudInstalledContent: Unable to connect to the database
2019-12-01 23:44:44.984 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentGetByRelativePath: Unable to connect to the database, can not quote
2019-12-01 23:44:53.451 A valid PostgreSQL CMS connection could not be established.  Several DAZ Studio features that require a valid PostgreSQL CMS connection, such as context aware content views and loading content installed using the Daz Connect service, will not be available.  Check your network, anti-virus, and firewall settings for conflicts.
2019-12-01 23:44:53.451 Loading Startup Scene : G:/DAZ 3D/Studio3/content/! DEFAULT SY 3DL 3 Advanced 1 Spot IRAY 3 spots.duf
2019-12-01 23:44:53.451 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in contentGetByRelativePathAndFilename: Unable to connect to the database
2019-12-01 23:44:53.513 *** Scene Cleared ***
2019-12-01 23:44:53.513 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in CloudFIle::lookupFromDb: Unable to connect to the database
2019-12-01 23:44:53.513 WARNING: ..\..\..\..\..\src\sdksource\cloud\dzcloudtasknotifier.cpp(178): Unexpected exception in CloudFIle::lookupFromDb: Unable to connect to the database
2019-12-01 23:44:53.513 WARNING: Invalid render time file name passed to DzShaderLight::setDefinitionFile().

 

Anyone have any idea what any of that would be in layman's terms, and what I can do about it?

It seems to be unable to find the database, but that hasn't moved. In fact, I made absolutely sure to keep the relative paths the same on the new system as my old. And as I say, it was just fine the first few times I started Studio after reinstalling.

Since this error appeared, I've reinstalled Studio 4.12, reinstalled DIM, restarted the computer, and nothing helps. DIM itself seems to be fine, as far as I can tell -- because it's set to install to a different location than where I have Studio content, it pretty much never ever started the database on my old system, and that appears to be continuing on the new one, so that's not an issue as such.

I don't care about Smart Content, but I do use Transfer Utility and the RSSY/RiversoftArt scripts that depend on the metadata, so I really do need this to get back up.

Would using the standalone PostgreSQL installer be a good idea?

Any help will be much appreciated.

Post edited by vwrangler on

Comments

  • vwranglervwrangler Posts: 4,980
    edited December 2019

    Addendum: I've seen one odd thing studio is doing, but I don't know why it started doing it.

    Studio started looking for the database inside itself. It started looking in \AppData\Roaming\DAZ 3D\cms\ContentCluster\ContentCluster.

    I reset the database location inside Studio so that it was looking only at \AppData\Roaming\DAZ 3D\cms\ContentCluster but that doesn't seem to have helped.

    The firewall is serenely ignoring Studio, so that doesn't seem to be the issue. (I added exceptions for Studio and postgresql.exe just in case, but according to its logs, it wasn't blocking them. And it was allowing Studio to work just fine yesterday anyway.)

    As far as I can tell, both Studio and postgresql are using port 1024.

    Went ahead and tried the standalone PostgreSQL installer. Didn't help.

    Tried uninstalling and dropping back to Studio 4.11. Didn't help, so I reinstalled 4.12.

    Using the "Start CMS" and "Stop CMS" commands don't seem to do anything at all, but then, if that worked, the database would be starting normally.

     

    ADDITIONAL ADDENDUM:

    I just tried emptying out the CMS directory completely by moving the ContentCluster directory and cmscfg.json to another place on the disk. For some reason, that let me log into the Daz server, but as far as I can tell from Windows Task Manager, PostgreSQL didn't seem to start. (EDIT: Ah. Windows 10 bundles processes together, so instead of being listed separately, it's now considered part of Studio. So it did start.) And, of course, since the database itself wasn't there, there wasn't any metadata.

    I then tried moving the content cluster back to the cms directory -- but NOT the cmscfg.json file -- and immediately on the next Studio start, I got the "Valid connection could not be established."

    So I guess this means the database is corrupted. Pfeh. Importing stuff from the server shouldn't be a problem, but I don't know if any of my user generated metadata survived. Tried reimporting metadata, and that got to 100% in, like, less than a minute ... and then stayed there for at least 10 minutes without closing the metadata import process windows, which is worrisome. (Also, have never seen that many PostgreSQL processes running at the same time; it was up to 16 at last count.)

     

    Post edited by vwrangler on
  • It's hard to tell what is going on, or what effect your chnages have had. Did you say this was a new system? Had PostgreSQL been working on that before, and failed now?

  • vwranglervwrangler Posts: 4,980
    edited December 2019

    I did figure it out, sort of. It looks like the database itself was somehow corrupted. When I moved the ContentCluster directory and the cmscfg.json file out of the cms directory and let Studio regenerate the files, everything worked fine. When I put the old ContentCluster back and deleted the one that Studio had generated, it was an instant "cannot connect to database" error. So I moved the files out again, and again, Studio was happy. I had it reimport metadata from Daz, which worked.

    It is a new system, but PostgreSQL had been working just fine on Saturday, when I first reinstalled Studio. And then on Sunday, "cannot connect to database."

    It looks like everything is fine now.

    (I do hope that in Studio 5, whenever that happens, they opt for error messages that are a bit more helpful. A "your database may be corrupted" would have been *immensely* helpful here.)

    Post edited by vwrangler on
  • vwrangler said:

    I did figure it out, sort of. It looks like the database itself was somehow corrupted. When I moved the ContentCluster directory and the cmscfg.json file out of the cms directory and let Studio regenerate the files, everything worked fine. When I put the old ContentCluster back and deleted the one that Studio had generated, it was an instant "cannot connect to database" error. So I moved the files out again, and again, Studio was happy. I had it reimport metadata from Daz, which worked.

    It is a new system, but PostgreSQL had been working just fine on Saturday, when I first reinstalled Studio. And then on Sunday, "cannot connect to database."

    It looks like everything is fine now.

    (I do hope that in Studio 5, whenever that happens, they opt for error messages that are a bit more helpful. A "your database may be corrupted" would have been *immensely* helpful here.)

    The error message can't give information it doesn't have, and I am still not sure your analysis is necessarily correct.

Sign In or Register to comment.