Skip to content

Postgres.app failed to verify "trust" authentication #749

Closed

Description

@MW3000

After trying to delete a database via dropdb <databasename> i received the following error message. This used to work without problems.

I use Version 2.7 (243) on macOS Ventura 13.5.2.

dropdb: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  Postgres.app failed to verify "trust" authentication
DETAIL:  An error occurred while running the helper application
HINT:  Please check the server log and submit an issue to https://github.com/PostgresApp/PostgresApp/issues

The same happens with other PostgreSQL command line tools.

Activity

  1. MW3000 commented on Jan 26, 2024

    @MW3000
    Author

    Following the instructions for "Resetting Postgres.app" on https://postgresapp.com/documentation/troubleshooting.html solved the problem.

  2. tbussmann commented on Jan 27, 2024

    @tbussmann
    Member

    Glad, you were able to solve the problem by resetting Postgres.app.

    However, I would be interested in understanding what the problem was originally. Do you have a copy of the previous data directory containing the server log? By default this is located in ~/Library/Application Support/Postgres/var-xx/postgresql.log, where xx is the major version of Postgres you were using - e.g. 16.

    Could you also try to answer the following questions? This may help us to understand the situation in which the error occurred:

    • Have you seen a dialogue like "'Terminal' wants to connect to Postgres.app without using a password"?
    • Did you run dropdb from the same machine and user as Postgres.app? Is it an admin user in MacOS?
    • Was the dropdb command run directly by you in the shell, or as part of a script or installation process of something else?
    • Did you specify a host in the dropdb command (e.g. -h localhost)?
    • Has the pg_hba.conf file been modified?

    TIA!

  3. tbussmann commented on Jan 27, 2024

    @tbussmann
    Member

    Oh and additionally:

    • Did you move or rename the Postgres.app application bundle while the PostgreSQL server was running or was it running from the Disk Image (.dmg)?
  4. jakob commented on Jan 29, 2024

    @jakob
    Member

    I checked the source, and there are 4 places in the code that show the error message "An error occurred while running the helper application". The detailed error message is only printed to the server log. Without the log (which was probably deleted) it is going to be hard to debug this issue.

    Maybe we should add more details to the message, so we get more details the next time someone reports the issue :)

    Did you move or rename the Postgres.app application bundle while the PostgreSQL server was running or was it running from the Disk Image (.dmg)?

    I don't think that is the case, because there is a check to see if the helper executable exists with a different error message.

  5. MW3000 commented on Jan 29, 2024

    @MW3000
    Author

    Have you seen a dialogue like "'Terminal' wants to connect to Postgres.app without using a password"?

    I remember having seen this or similar dialogs in the past, but when memory serves right, I always granted the rights.

    Did you run dropdb from the same machine and user as Postgres.app? Is it an admin user in MacOS?

    Yes, from the same machine. Yes, as a macOS admin user.

    Was the dropdb command run directly by you in the shell, or as part of a script or installation process of something else?

    Directly on zsh from the macOS Terminal.

    Did you specify a host in the dropdb command (e.g. -h localhost)?

    No.

    Has the pg_hba.conf file been modified?

    Certainly not manually by me.

    Did you move or rename the Postgres.app application bundle while the PostgreSQL server was running or was it running from the Disk Image (.dmg)?

    No, I did not move or rename the app, I did not run it from a disk image.

    It might have been the first time I used a command line tool after Postgres.app was updated to a new version.

    Unfortunately I did not make a copy of ~/Library/Application Support/Postgres/var-xx/postgresql.log before deleting it to reset the app. So I have no log to share. I should have thought about making a copy before removing the application support folder.

  6. jakob commented on Jan 29, 2024

    @jakob
    Member

    Thanks for the detailed info! One last thing you could check if there is anything in ~/Library/Logs/DiagnosticReports. If the helper executable crashed there should be a crash report from PostgresPermissionDialog in there.

  7. MW3000 commented on Jan 29, 2024

    @MW3000
    Author

    Thank you for taking this so seriously! No, there is no crash report from PostgresPermissionDialog in ~/Library/Logs/DiagnosticReports.

  8. atstockland commented on Feb 1, 2024

    @atstockland

    Resetting Postgress.app works for me---but, I need to reset the app every time I shut down servers and restart my computer. Once, I reset the app I'm good to go until I restart again.

    I don't need to follow the entire reset procedure---I only need to quit Postgress.app, run defaults delete com.postgresapp.Postgres2, and then start the app again.

  9. jakob commented on Feb 1, 2024

    @jakob
    Member

    @atstockland Can you check the error message in the server log and paste it here?

    To open the server log, click the "Server Settings" button and then click "Open" button next to the server log.

  10. atstockland commented on Feb 3, 2024

    @atstockland

    I verified this occurs every time I stop the rails server and then attempt to start it again. Server log file:

    024-02-02 21:22:21.795 PST [44341] FATAL:  Postgres.app failed to verify "trust" authentication
    2024-02-02 21:22:21.795 PST [44341] DETAIL:  auth_permission_dialog: /Applications/iTerm.app/Contents/MacOS/iTerm2 (via /Users/adamstockland/.frum/versions/3.3.0/bin/ruby) is not allowed to connect without a password because system('/Applications/Postgres.app/Contents/MacOS/PostgresPermissionDialog' --server-addr 127.0.0.1 --server-port 5432 --client-addr 127.0.0.1 --client-port 51917 --client-pid 44286) terminated with signal 6
    2024-02-02 21:22:21.795 PST [44341] HINT:  Please check the server log and submit an issue to https://github.com/PostgresApp/PostgresApp/issues
    2024-02-02 21:22:21.914 PST [44344] FATAL:  Postgres.app failed to verify "trust" authentication
    2024-02-02 21:22:21.914 PST [44344] DETAIL:  auth_permission_dialog: /Applications/iTerm.app/Contents/MacOS/iTerm2 (via /Users/adamstockland/.frum/versions/3.3.0/bin/ruby) is not allowed to connect without a password because system('/Applications/Postgres.app/Contents/MacOS/PostgresPermissionDialog' --server-addr 127.0.0.1 --server-port 5432 --client-addr 127.0.0.1 --client-port 51918 --client-pid 44286) terminated with signal 6
    2024-02-02 21:22:21.914 PST [44344] HINT:  Please check the server log and submit an issue to https://github.com/PostgresApp/PostgresApp/issues
    
  11. jakob commented on Feb 7, 2024

    @jakob
    Member

    @atstockland Thank you for the details! It looks like the helper app that shows the permission dialog is crashing. I'm not sure what signal 6 means in this case. It is probably a bug in the helper app, but it is interesting that it only occurs in some circumstances. Since you say that defaults delete com.postgresapp.Postgres2 fixes the bug, it's possible that there is a bug in the code that reads/writes user defaults.

    The next time this happens, can you do 3 things:

    1. Execute this command to get the user defaults and share the output with us: defaults read com.postgresapp.Postgres2
    2. Check if a crash log for PostgresPermissionDialog is written to ~/Library/Logs/DiagnosticReports
    3. Try executing the helper app directly by executing the command in the log. In this case the command would be:
      '/Applications/Postgres.app/Contents/MacOS/PostgresPermissionDialog' --server-addr 127.0.0.1 --server-port 5432 --client-addr 127.0.0.1 --client-port 51918 --client-pid 44286

    You can share debug info privately via email to jakob@eggerapps.at

  12. atstockland commented on Feb 8, 2024

    @atstockland

    Thanks!

    1.

    {
    ClientApplicationPermissions = (
    {
    path = "/Applications/iTerm.app/Contents/MacOS/iTerm2";
    policy = allow;
    }
    );
    DidCheckInitdbOSVersion = 1;
    "NSSplitView Subview Frames MainSplitView" = (
    "0.000000, 0.000000, 200.000000, 494.000000, NO, NO",
    "201.000000, 0.000000, 450.000000, 494.000000, NO, NO"
    );
    SUHasLaunchedBefore = 1;
    Servers = (
    {
    binPath = "/Applications/Postgres.app/Contents/Versions/16/bin";
    name = "PostgreSQL 16";
    port = 5432;
    startOnLogin = 0;
    varPath = "/Users/xyz/Library/Application Support/Postgres/var-16";
    }
    );
    alreadyLaunched = 1;
    }

    2.

    No crash log created

    3.

    I ran this command in the console but nothing happened. It appears an error occurred, but I'm unable to view the error.

    "/Applications/Postgres.app/Contents/MacOS/PostgresPermissionDialog" --server-addr 127.0.0.1 --server-port 5432 --client-addr 127.0.0.1 --client-port 51918 --client-pid 44286

  13. jakob commented on Feb 9, 2024

    @jakob
    Member

    @atstockland Thanks for the info. Looks like you are using iTerm 2, but that shouldn't make a difference. On my Mac iTerm works fine.

    I've tried to figure out why the helper would exit with SIGABRT and I couldn't find anything. It's not a Swift assertion like a failed force unwrap, because that would result in SIGTRAP (Signal 5).

    Can you try a few more things:

    1. Can you connect with psql using a command like this: psql -h localhost? Does it show the same error that rails shows?

    2. Can you try executing the PostgresPermissionDialog helper again, but with this command so we can see the exit code? It should print the number zero: /Applications/Postgres.app/Contents/MacOS/PostgresPermissionDialog --client-pid $$ --client-addr 127.0.0.1; echo $?

    3. Can you figure out the minimum steps necessary to "fix" the problem?

      • Does quitting and restarting Postgres.app fix the problem?
      • Does executing only defaults delete com.postgresapp.Postgres2 ClientApplicationPermissions fix the problem?
      • Does executing only defaults delete com.postgresapp.Postgres2 fix the problem?
      • Does stopping and starting the server in Postgres.app UI fix the problem?
    4. It is possible that some security tech in macOS (Gatekeeper or App Quarantine) is killing the helper app. Can you check if there are any logs in Console about that?

      • Open Console.app (In /Applications/Utilities)
      • click the "Start Streaming" button
      • trigger the problem by trying to connect to the PostgreSQL server
      • go back to console, click "Pause"
      • use the search box to search for anything related to "PostgresPermissionDialog" or "Postgres"
  14. atstockland commented on Feb 10, 2024

    @atstockland

    Hi again!

    1. ❯ psql -h localhost

    psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: Postgres.app failed to verify "trust" authentication
    DETAIL: An error occurred while running the helper application
    HINT: .....

    1. It printed the number 0

    2. ...

    • quitting and restarting does seem to fix it.
    • "defaults delete com.postgresapp.Postgres2 ClientApplicationPermissions" did not fix it
    • Running "defaults delete com.postgresapp.Postgres2" does fix it
    • stopping and starting the server in the UI does fix it
    1. The following was printed in the console during a failure. These are only the "Postgres" filtered results

    default 10:10:02.414294-0800 runningboardd Invalidating assertion 582-553-142043 (target:[app<application.com.postgresapp.Postgres2MenuHelper.15975514.15975520(501)>:36683]) from originator [osservice<com.apple.WindowServer(88)>:553]

    default 10:10:02.526328-0800 runningboardd [app<application.com.postgresapp.Postgres2MenuHelper.15975514.15975520(501)>:36683] Ignoring jetsam update because this process is not memory-managed

    default 10:10:02.526387-0800 runningboardd [app<application.com.postgresapp.Postgres2MenuHelper.15975514.15975520(501)>:36683] Ignoring suspend because this process is not lifecycle managed

    default 10:10:02.526448-0800 runningboardd [app<application.com.postgresapp.Postgres2MenuHelper.15975514.15975520(501)>:36683] Ignoring GPU update because this process is not GPU managed

    default 10:10:02.526643-0800 runningboardd [app<application.com.postgresapp.Postgres2MenuHelper.15975514.15975520(501)>:36683] Ignoring memory limit update because this process is not memory-managed

    default 10:10:02.527287-0800 runningboardd Calculated state for app<application.com.postgresapp.Postgres2MenuHelper.15975514.15975520(501)>: running-active (role: UserInteractive) (endowments: )

    default 10:10:02.528264-0800 gamepolicyd Received state update for 36683 (app<application.com.postgresapp.Postgres2MenuHelper.15975514.15975520(501)>, running-active-NotVisible

    default 10:10:18.008059-0800 kernel AMFI: Denying core dump for pid 37129 (PostgresPermissi)

    default 10:10:18.008111-0800 kernel PostgresPermissionDialog[37129] Corpse allowed 1 of 5

    default 10:10:18.136260-0800 kernel AMFI: Denying core dump for pid 37132 (PostgresPermissi)

    default 10:10:18.136332-0800 kernel PostgresPermissionDialog[37132] Corpse allowed 2 of 5

    default 10:10:18.161422-0800 ReportCrash Formulating fatal 309 report for corpse[37129] PostgresPermissionDialog

    default 10:10:18.165167-0800 osanalyticshelper creating type 309 as /Library/Logs/DiagnosticReports/.PostgresPermissionDialog-2024-02-10-101018.ips

    default 10:10:18.170001-0800 osanalyticshelper Saved type '309()' report (18 of max 25) at /Library/Logs/DiagnosticReports/PostgresPermissionDialog-2024-02-10-101018.ips

    default 10:10:18.170321-0800 osanalyticshelper xpc log creation type 309 result success: /Library/Logs/DiagnosticReports/PostgresPermissionDialog-2024-02-10-101018.ips

    default 10:10:18.170559-0800 ReportCrash client log create type 309 result success: /Library/Logs/DiagnosticReports/PostgresPermissionDialog-2024-02-10-101018.ips

    default 10:10:18.170780-0800 ReportCrash no MetricKit for process PostgresPermissionDialog type 309 bundleId (null)

    default 10:10:18.290044-0800 ReportCrash Formulating fatal 309 report for corpse[37132] PostgresPermissionDialog

    default 10:10:18.292618-0800 osanalyticshelper creating type 309 as /Library/Logs/DiagnosticReports/.PostgresPermissionDialog-2024-02-10-101018.000.ips

    default 10:10:18.296611-0800 osanalyticshelper Saved type '309()' report (19 of max 25) at /Library/Logs/DiagnosticReports/PostgresPermissionDialog-2024-02-10-101018.000.ips

    default 10:10:18.296751-0800 osanalyticshelper xpc log creation type 309 result success: /Library/Logs/DiagnosticReports/PostgresPermissionDialog-2024-02-10-101018.000.ips

    default 10:10:18.296879-0800 ReportCrash client log create type 309 result success: /Library/Logs/DiagnosticReports/PostgresPermissionDialog-2024-02-10-101018.000.ips

    default 10:10:18.296961-0800 ReportCrash no MetricKit for process PostgresPermissionDialog type 309 bundleId (null)

  15. jakob commented on Feb 10, 2024

    @jakob
    Member
  16. 10 remaining items

  17. jakob commented on Feb 19, 2024

    @jakob
    Member

    I did some more research with regard to tccd, and I think it is unrelated. I didn't find any TCC permissions related to launching apps / executables.

  18. oscadev commented on Feb 21, 2024

    @oscadev

    I had this issue. Just got an available update notification and installed it, and it works again. Will see if it holds

  19. tbussmann commented on Feb 22, 2024

    @tbussmann
    Member

    While we are still trying to understand why the helper application crashes for some users, the new v2.7.2 release should improve the situation for those affected:

    • Install the update
    • Try to connect with a client application
    • If you get the Postgres.app failed to verify "trust" authentication error:
      • Open Postges.app
      • Chose Settings... (or Preferences...) in the Postgres menu
      • Find the problematic app in the list, and change "Ask" to "Allow" from the popup menu
      • Try again to connect with the client
      • If you can't find the application in the list, or the client connection is still not allowed, please report this here.

    As a last resort, you can disable the permission dialogs altogether, but we recommend that you configure password authentication instead.

    In any case, please mention here if the permission dialogs do not work for you, and include any crashlog or details that may help us identify the root of the problem.

  20. MW3000 commented on Mar 20, 2024

    @MW3000
    Author

    I had the same or a similar issue again today. This time it was not from the Terminal but from DataGrip. I use Version 2.7.2 (255) on Ventura 13.6.5 (22G621). This time I got the log. It's only three lines:

    2024-03-20 14:52:55.796 CET [56187] FATAL:  Postgres.app failed to verify "trust" authentication
    2024-03-20 14:52:55.796 CET [56187] DETAIL:  auth_permission_dialog: /Applications/DataGrip.app/Contents/MacOS/datagrip (via /Applications/DataGrip.app/Contents/jbr/Contents/Home/bin/java) is not allowed to connect without a password because system('/Applications/Postgres.app/Contents/MacOS/PostgresPermissionDialog' --server-addr 127.0.0.1 --server-port 5432 --client-addr 127.0.0.1 --client-port 58465 --client-pid 56186) terminated with signal 6. For more information see https://postgresapp.com/l/app-permissions/
    2024-03-20 14:52:55.796 CET [56187] HINT:  You may be able to connect by editing app permission in Postgres.app settings. Please report this error to https://github.com/PostgresApp/PostgresApp/issues
    

    Following the instructions at https://postgresapp.com/l/app-permissions/ I could get it to work again. Seems more like a macOS bug?

  21. jakob commented on May 10, 2024

    @jakob
    Member

    I'm closing this issue for now since I don't see anything we can do to fix it at the moment.

    If you run into this problem again, please open a new issue!

  22. edwardloveall commented on Aug 25, 2025

    @edwardloveall
    Contributor

    Not sure if anyone still wants to work on this, but I can reliably reproduce the issue by logging out while Postgres.app is running then logging right back in to the same account. My fix is to Stop and Start the running server in Postgres.app as others have mentioned.

    psql -h localhost
    psql (17.5 (Postgres.app))
    Type "help" for help.
    
    [...] #
    

    Log out and log back in

    psql -h localhost
    psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  Postgres.app failed to verify "trust" authentication
    DETAIL:  The helper application terminated with signal 6. For more information see https://postgresapp.com/l/app-permissions/
    HINT:  You may be able to connect by editing app permission in Postgres.app settings. Please report this error to https://github.com/PostgresApp/PostgresApp/issues
    
  23. tbussmann commented on Aug 27, 2025

    @tbussmann
    Member

    Thank you very much @edwardloveall !
    With this hint, I can reproduce the issue and can confirm that the crash happens even if the helper is not attempting to show any UI (Client application is set to 'Allow' in the preferences). While I can't promise we find a solution for this quickly, having a reproducible test is a first important step to debug the issue.

  24. tbussmann commented on Sep 3, 2025

    @tbussmann
    Member

    We were able to identify the cause of the crash that occurs if the login session that has started the server is no longer existing when we try to connect to the server. In that case the APIs to read the UserDefaults and thus the previous allow/deny decisions per client app are not working and the permission dialog helper app is crashing when attempting to display the UI to ask the current user. To work around the likely case that the client app in question already has an allow or deny policy stored from an earlier attempt to connect to it, we implemented a fallback solution to read these values so no UI interaction is necessary and the connection attempt is allowed as configured in the Postgres.app settings.

    This fix will be included in the pre-release planned for tomorrow and rolled out with the next round of regular releases. Thanks again @edwardloveall for the help!

  25. tbussmann commented on Nov 13, 2025

    @tbussmann
    Member

    The aforementioned fix was rolled out in v2.9, and an improved handling of cases where there is no stored policy for the app in question was added in v2.9.1. In this situation, the crash will be caught and the client will be prompted to restart the server. (see #809)

    Now that these have been fixed, I can close the issue. If you see the error again when using v2.9.1 or a later version, please file a new issue and ensure that you allow any crash reports to be sent. This should be straightforward thanks to the crash log collector introduced in version 2.8.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions