PostgreSQL problems on macOS 12.1(Apple Silicon)

toby07toby07 Posts: 4

When I install DAZStudio and try to start it, I get the message "a valid PostgreSQL CMS connection could not be established..." message appears.
There are similar discussions in this forum, so I tried reinstalling and changing permissions based on them, but it did not work.

macOS 12.1 (Apple M1 Max)
DAZ Studio 4.16 (Mac 64-bit)
DAZ3DIM

what I tried:
- I reinstalled using DIM.
- When reinstalling, I deleted these caches.

/Applications/DAZ 3D/
~/Library/Application Support/DAZ 3D

 

- Changed permissions on "~/Library/Application Support/DAZ 3D/cms" and "ContentCluster" folders to "read/write".
But, when I start DAZStudio, the permissions on the "ContentCluster" folder change to "No permissions" for "everyone" while the permissions for "User" remain "Read/Write".
And there are no log files or anything in the "ContentCluster" folder.

By the way, there are some applications that I can't use due to the change of processor from intel to ARM on the new Mac, does that have anything to do with it?

Thank you for any help you can provide.

スクリーンショット 2022-01-04 11.16.43.png
1064 x 596 - 336K
スクリーンショット 2022-01-04 14.06.25.png
1354 x 1280 - 1017K
Post edited by toby07 on

Comments

  • Same issue and I've tried everything as well, with no luck. I submitted a support ticket last year ( hehe) and im waiting to hear back from them.

  • toby07toby07 Posts: 4

    Oh,  I see it was still unsupported...
    I'll give up working on macOS for a while. Thanks a lot.

  • TotteTotte Posts: 13,510

    I run DS and the Postgres CMS on my M1 Mac mini , so it works. The question is why doesn't it for some.

    There are a few things that might cause this , One is if to the machine is formatted with case sensitive file system.

     

    Another thing is to allow Postgres to be run in one of ether system security dialogs, I will screenshot when at my machine. 

  • TotteTotte Posts: 13,510
    edited January 2022

    toby07 said:

    - Changed permissions on "~/Library/Application Support/DAZ 3D/cms" and "ContentCluster" folders to "read/write".
    But, when I start DAZStudio, the permissions on the "ContentCluster" folder change to "No permissions" for "everyone" while the permissions for "User" remain "Read/Write".
    And there are no log files or anything in the "ContentCluster" folder.

    That's because postgresql requires the dtabase files to only be accesible by itself to prevent someone or something to corrupt the integrity of the daabase files.

    This is the path to the cms data:



    This is the cms diectory, here is the dblog.txt file, which maight contain hints to why the cms doesn't start correctly


    start there.

    ss2.png
    204 x 240 - 26K
    ss1.png
    242 x 525 - 38K
    Post edited by Totte on
  • toby07toby07 Posts: 4

    Thank you for your response.
    I heard your M1 Mac Mini was working, so I tried again and finally got it working!
    Your previous posts were also very helpful in solving the problem.

    I will leave the steps later for others who have the same problem.
    I had a lot of trouble, so it may take a while.

  • toby07toby07 Posts: 4
    edited January 2022

    Here are the steps I was able to get working on my M1 Mac.
    Of course there are some useless steps, but I don't know what's useless, so I'll describe them all.

    1. Create a "ContentCluster" folder in a location other than ~/Library/.
    I created a "cms" folder on my desktop for testing, and on DAZ Studio, click "Preferences...> "CMS Settings" and change "Cluster Directory" to the newly created path.
    Just in case, I changed the permissions of the "ContentCluster" folder to 700 using the "chmod" command.
    When I reinstalled DAZ Studio and PostgreSQL CMS after doing this, dblog.txt was generated in the "ContentCluster" folder for the first time.

    2. Change the shared memory parameters
    I got the following error in dblog.txt. 

    FATAL: could not create shared memory segment: Cannot allocate memory
    DETAIL: Failed system call was shmget(key=17237001, size=40, 03600).

    Execute the following command in the Terminal

    sudo sysctl kern.sysv.shmmax=536870912
    sudo sysctl kern.sysv.shmseg=1024
    sudo sysctl kern.sysv.shmall=131072

    Reboot computer.

     

    3. Install postgresql via homebrew, and create a symbolic link to refer to the newly installed PostgreSQL.
    Next, I got the following error in dblog.txt. 

    FATAL: Database files are incompatible with server
    DETAIL: The database cluster was initialized without USE_FLOAT8_BYVAL but the server was compiled with USE_FLOAT8_BYVAL.
    HINT: It looks like you need to recompile or initdb.

    I thought it would be difficult to recompile, so I tried to refer to the PostgreSQL that was working fine.
    Install PostgreSQL with the following command 

    brew install postgresql

    Delete the folders "bin", "include", "lib", "share" in "/Applications/DAZ 3D/PostgreSQL CMS/".
    Create a symbolic link like this and do the same for "bin", "include", "lib", and "share" respectively.

    ln -s /opt/homebrew/Cellar/postgresql/14.1_1/bin /Applications/DAZ\ 3D/PostgreSQL\ CMS/bin

    image

     

    4. Initializing the Database

    Next, initialize the database in the "ContentCluster" folder that you initially created.

    initdb --locale=C -E UTF-8 ~/Desktop/cms/ContentCluster

    If there are any files left in the ContentCluster folder, please delete them all. (It took me a while to realize that ".DS_Store" was still there).

    Next, right-click on the Smart Content pane in DAZ Studio. Select "Content DB Maintenance". Check "Reset database" and press "Accept".

     

    5. change the settings in "pg_hba.conf".
    The following error is displayed in dblog.txt 

    FATAL: pg_hba.conf rejects connection for host "[local]", user "USERNAME", database "postgres", SSL off

    Open pg_hba.conf in the ContentCluster folder.

    # "local" is for Unix domain socket connections only
    local   all             all                                     reject

    Change "reject" to "trust" in this line.

    After restarting DAZ Studio, the error disappeared and the login was successful.
    If any part of this process does not work, try reinstalling DAZ Studio (or PostgreSQL CMS) from DIM or restarting the application.
    I hope this helps others who have the same problem.

     

    スクリーンショット 2022-01-06 1.45.40.png
    1908 x 742 - 245K
    スクリーンショット 2022-01-06 2.44.03.png
    3524 x 2474 - 5M
    Post edited by toby07 on
  • TotteTotte Posts: 13,510
    edited January 2022

    FATAL: could not create shared memory segment: Cannot allocate memory
    DETAIL: Failed system call was shmget(key=17237001, size=40, 03600).

    These errors usually tells you "you need to restart your mac". Some program do leak shared memory as there is a "bug" / "implementation issue" with shared memory in macOS and apps that crashes without handing back their allocated shared memory, or apps leaking shared memory

     

    Post edited by Totte on
  • toby07toby07 Posts: 4

    Thanks for letting me know.


    There is a hint in the rest of log data, I just looked up that message and resized the shared memory. But I rebooted my computer after making the change, so I may not have needed to any other command.

    HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMALL parameter. You might need to reconfigure the kernel with larger SHMALL.
        You might need to reconfigure the kernel with a larger SHMALL. The PostgreSQL documentation contains more information about shared memory configuration.

     
     

Sign In or Register to comment.