PostgreSQL Connection Error

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

PostgreSQL Connection Error

PostMon Jun 14, 2021 2:30 pm

Hi, I'm getting this error message whenever I attempt to create a shared database no matter what computer I'm working on:

"Failed to connect to the database server as the connection was refused. Please ensure that the database server is configured to allow connections from this device."

I installed DaVinci Resolve Project Server, but it gives me an error message on startup:

"The PostgreSQL server is either not running or the password is incorrect."

I have tried installing various versions of PostgreSQL, and nothing seems to work. What am I missing?
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostMon Jun 14, 2021 11:12 pm

You need to let the Project Server app install PostgreSQL.

Note that if the Project Server app does not install PostgreSQL, and you install it yourself, the postgres password MUST be DaVinci, or the Project Server will not launch.

Are you on Mac or Windows? What PostgreSQL version do you have installed? What is the postgres password?
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 3:03 pm

Currently, none. I tried to install 4 or 5 different versions of PostgreSQL, and none of them seemed to make the error message go away. How do you make the Project Server app perform the installation of PostgreSQL? (Especially when that program refuses to start up because of this error message.)
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 3:07 pm

Also, if I do need to install PostgreSQL manually, what version do I need to install?
Last edited by Matthew Simonson on Fri Jun 25, 2021 9:35 pm, edited 1 time in total.
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 4:34 pm

Are you on Mac or Windows?

The Project Server APP does not install Postgres. The Project Server INSTALLER installs Postgres.

So run the Project Server 17.1 INSTALLER, and it should have an option to install Postgres. If it doesn't, or if that option is grayed out, then it detects Postgres is already on the system. You would need to remove that, then the Project Server installer should offer to install PostgreSQL.
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 4:44 pm

I'm on Mac.

How do I completely purge Postgres from the system?
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 5:19 pm

I deleted everything PostgreSQL I could find on my Mac, uninstalled DaVinci Resolve Project Server, re-installed it, and checked the box for the installer to install Postgres.

I still get the same error message when I attempt startup. "The PostgreSQL server is either not running or the password is incorrect."

How do I edit the password like you previously suggested?
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 6:07 pm

If the Project Server installer installed PostgreSQL, it will use the correct password.

Open the Mac Activity Monitor, and in the View menu, select All Processes.

Now on the CPU tab, sort on the Process Name column.

If PostgreSQL is running, you should see several postgres processes running.

If you don't see the postgres processes, then PostgreSQL is not running for some reason.

Trouble shooting why that is involves some low level Terminal sleuthing. I can give guidance on that, if needed.

If you see postgres processes running, then PostgreSQL is running, and the Project Server should connect to it when launched. If it doesn't, it could be a Firewall permissions issue. To test that, turn off the firewall in System Preferences - Security and Privacy - Firewall, and see if the Project Server app works then.
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 9:34 pm

I checked the activity monitor. There's no sign of PostgreSQL when I open either DaVinci Resolve or the Project Server app. Looks like the Terminal sleuthing will be necessary.
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 11:26 pm

Open a Terminal window.

Type:

sudo su<RETURN> (<RETURN> means to press the Return key)

It will ask for a password. Should be your Admin password.

You'll get a "sh-3.2#" prompt.

Then type:

cd /Library/PostgreSQL/9.5/data/pg_log<RETURN>

Type:

pwd<RETURN>

This will show the current directory. Verify its /Library/PostgreSQL/9.5/data/pg_log

Assuming it is, type:

ls -altr<RETURN>

This will display a list of the .log files. There may be lots, but if PostgreSQL has never run on the system, probably just a few, or maybe one.

The last log file in the list, which will be named something like this: postgresql-2021-06-25_000000.log will have the most recent PostgreSQL errors logged.

To see what's in the file type:

cat filename<RETURN>

Using my example filename above, that would be:

cat postgresql-2021-06-25_000000.log<RETURN> but use your filename.

If there is nothing in the log, look at the next few most recent logs, if any, to see what they show.

Send a screen shot of what's in the file(s).
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostFri Jun 25, 2021 11:34 pm

And just to clarify about the Activity Monitor and PostgreSQL:

PostgreSQL should launch immediately after the Project Server installer installs it.

And it should automatically start when the Mac starts up.

i.e. it should ALWAYS be running.

And what you are looking for in the Activity Monitor Process Name list is not PostgreSQL, but specifically, multiple processes (usually 6 or more) named this:

"postgres"
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostMon Jun 28, 2021 4:42 pm

Attached is a screenshot. It's odd that when I pulled up this log, it seems to indicate that PostgreSQL was, in fact, running, but didn't show up on the activity monitor.
Attachments
Screen Shot 2021-06-28 at 11.41.34 AM.png
Screen Shot 2021-06-28 at 11.41.34 AM.png (429.35 KiB) Viewed 3087 times
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostMon Jun 28, 2021 5:06 pm

It does look like it's running.

In the Activity Monitor View menu, make sure All Processes is selected:

postgres_view_mode.png
postgres_view_mode.png (167.78 KiB) Viewed 3080 times


Then have a look in the Process Name column again for the postgres processes:

postgres_processes.png
postgres_processes.png (243.54 KiB) Viewed 3080 times
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostMon Jun 28, 2021 6:05 pm

Ah. Yes, I see numerous instances of postgres in the activity monitor now.

Just tried deactivating the firewall to run the Project Server app, but it gives me the same error message. "The PostgreSQL server is either not running or the password is incorrect."
Attachments
Screen Shot 2021-06-28 at 12.58.49 PM.png
Screen Shot 2021-06-28 at 12.58.49 PM.png (817.4 KiB) Viewed 3066 times
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostMon Jun 28, 2021 6:30 pm

That's a lot more postgres processes than I would expect to be running.

If you restart the Mac, are there still that many postgres processes running?
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostMon Jun 28, 2021 9:08 pm

Yes. I restarted the machine, and it shows a similar laundry-list of postgres processes.

This might have something to do with the fact that I had previously attempted to install several versions of PostgreSQL in a previous attempt to get DaVinci Resolve collaboration working (to no avail).
Attachments
Screen Shot 2021-06-28 at 4.05.21 PM.png
Screen Shot 2021-06-28 at 4.05.21 PM.png (802.54 KiB) Viewed 3044 times
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostMon Jun 28, 2021 9:34 pm

That's what worries me. I thought you said you had removed all that, but I wonder if some other version remains and is running. That would explain the Project Server not being able to connect.
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostTue Jun 29, 2021 2:06 pm

I thought I removed them all by de-installing each time, and (of course) I didn't see the processes on Activity Monitor previously, so I thought the purge was successful. How would you recommend purging these from the system?

But aside from that, I'm skeptical about the idea that the multiple versions of postgres is the problem, because the error messages in DaVici and Project Server popped up before I started attempting any solutions that involved manually installing any versions of PostgreSQL.

Unless one of these redundant versions was running before I installed any... but I have no way of knowing. So it might be good to purge them all, re-install Project Server, and see if that helps. How do I do that?
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostTue Jun 29, 2021 6:28 pm

I don't have a good suggestion for how to find and purge other potential postgres installs.

Other than building a new system drive.
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostTue Jun 29, 2021 7:54 pm

After doing other research, I used "sudo pkill -u postgres" and "pkill postgres" on the terminal, and that killed 9 of the 15 instances. Not sure why it successfully terminated some but not others. But is that helpful?

Also, again, I'm not convinced that these other instances of postgres is the problem, since they most likely appeared after I started attempting to solve the problem.
Attachments
Screen Shot 2021-06-29 at 2.52.09 PM.png
Screen Shot 2021-06-29 at 2.52.09 PM.png (689.78 KiB) Viewed 2982 times
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostTue Jun 29, 2021 8:11 pm

Yes, that indicates that there is indeed another version of postgres running, that wasn't killed.
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostTue Jun 29, 2021 8:20 pm

Restart the Mac.

In the Terminal window as root (sudo su), type this:

ps -ale | grep postmaster

Assuming postmaster is running for the postgres instances, that should show you the path of the postgres installs.

postmaster_process.png
postmaster_process.png (41.46 KiB) Viewed 2968 times
Dwaine Maggart
Blackmagic Design DaVinci Support
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostWed Jun 30, 2021 2:17 pm

Did it. I'm not seeing any directories listed.
Last edited by Matthew Simonson on Thu Jul 01, 2021 6:58 pm, edited 1 time in total.
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostWed Jun 30, 2021 2:20 pm

First attempt was with sudo -s, second with sudo su. Not seeing any directory path either time.
Attachments
Screen Shot 2021-06-30 at 9.19.24 AM.png
Screen Shot 2021-06-30 at 9.19.24 AM.png (535.09 KiB) Viewed 2946 times
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostWed Jun 30, 2021 2:47 pm

I think I may have traced it to its source. I found some postgres files in /usr/local and deleted them. All of the instances have disappeared from the activity monitor!

However, I'm still getting the same "The PostgreSQL server is either not running or the password is incorrect" error message. What should I try now that all of the other postgres processes are purged?

Strangely enough, activity monitor isn't showing any instances of postgres at all, even after re-installing Project Server with the PostgreSQL check-box enabled.
Offline

Matthew Simonson

  • Posts: 15
  • Joined: Mon Jun 14, 2021 2:19 pm
  • Real Name: Matthew Simonson

Re: PostgreSQL Connection Error

PostThu Jul 08, 2021 6:14 pm

Update for anyone viewing this thread: I did a TeamViewer session with Dwayne, and the problem was resolved! This was his conclusion:

"Probably the key was this command:

sudo dscl . delete /users/postgres

If you have had previous postgres installs on a system, and you want to do a clean from scratch install, the above process removes any existing postgres user data.

If that's not done, it could prevent the new install from working."
Offline

mrpaulakin

  • Posts: 1
  • Joined: Thu Sep 14, 2023 5:30 pm
  • Real Name: Paul Akin

Re: PostgreSQL Connection Error

PostThu Sep 14, 2023 5:34 pm

Hi All,

I've run into a similar issue wanted to know if you had any advice?

I've the steps up to here:

Open a Terminal window.

Type:

sudo su<RETURN> (<RETURN> means to press the Return key)

It will ask for a password. Should be your Admin password.

You'll get a "sh-3.2#" prompt.

Then type:

cd /Library/PostgreSQL/9.5/data/pg_log<RETURN>

--

However my system returns: No such file or directory

Any help would be much appreciated.

Thanks.
Offline
User avatar

Dwaine Maggart

Blackmagic Design

  • Posts: 11296
  • Joined: Wed Aug 22, 2012 2:53 pm

Re: PostgreSQL Connection Error

PostThu Sep 14, 2023 9:38 pm

What folder is under /Library/PostgreSQL? If you've installed a newer version of Resolve Project Server, it could be 13, instead of 9.5.

And at any rate, the important question is: Is PostgreSQL running? You check that by opening the Mac Activity Monitor app, and in it's View menu, selecting All Processes, then sort on the Process Name column, and see if there are any postgres processes. If PostgreSQL is running, there should be several postgres processes running. If there are no postgres processes running, then PostgreSQL is not running, and that needs to be sorted.
Dwaine Maggart
Blackmagic Design DaVinci Support

Return to DaVinci Resolve

Who is online

Users browsing this forum: Google [Bot], martyeu, Mathematics, panos_mts and 190 guests