Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not open Terminal #509

Open
helgaGit opened this issue Jun 11, 2019 · 21 comments
Open

Could not open Terminal #509

helgaGit opened this issue Jun 11, 2019 · 21 comments
Labels

Comments

@helgaGit
Copy link

I'm using Mojave 10.14.5. I first installed Postgres using Homebrew. Then instructions recommended removing the installation. I did that, then on first installation of Postgres.app, I didn't grant permission to my Terminal. I've tried uninstalling and reinstalling, and Resetting Postgres.app as described in the troubleshooting documentation. I don't know where to find the .profile file to edit the settings there. Regardless, I keep on receiving the message, "Make sure that Postgres.app has permission to automate Terminal."

@jakob
Copy link
Member

jakob commented Jun 11, 2019

To connect to the database, you don't need to give Postgres.app permission to automate Terminal. You can just start psql from Terminal by yourself. If you've set up your $PATH correctly (see docs), and you haven't changed the port, you can just type psql to connect to your PostgreSQL database.

If you do want to use the feature in Postgres.app where you double click on the database to connect, please open System preferences, go to "Security" -> "Privacy" -> "Automation" -> "Postgres" and enable automation of Terminal.

@helgaGit
Copy link
Author

That works, thanks Jakob.

@vose2008
Copy link

vose2008 commented Dec 9, 2019

@jakob I have same trouble. Could not open Terminal when i double click the icon to connect database. And in "Security" -> "Privacy" -> "Automation" i don't find "Postgres" or other application. Here are my screen shot.
Mac os version 10.14.6 (18G103)
PostgreSQL.app version 2.3.2 (63)
And i never install any postgreSQL application on my mac.
Thanks for your watching.
Screen Shot 2019-12-07 at 22 02 02

@davidhjones
Copy link

Same as @vose2008

@jakob
Copy link
Member

jakob commented Dec 9, 2019

If you configured your $PATH correctly (as explained on the postgres.app homepage), and you use the default port, you can just type psql in terminal to connect to Postgres.app

@vose2008
Copy link

Yes, i can use psql to connect to Postgress.app but can i just use double click to connection ?

@jakob
Copy link
Member

jakob commented Dec 10, 2019

Can you open Console.app, and then try to double click a database in Postgres.app? If the problem is a Sandbox issue, you would see an error message printed there.

Alternatively, you can also try launching Postgres.app from the command line (instead of double clicking the app, launch the binary from the command line by typing /Applications/Postgres.app/Contents/MacOS/Postgres). Then you would also see log messages from Postgres.app, maybe an error message is printed when opening Terminal.app fails.

@vose2008
Copy link

Hey, jakob. It's work double click can connect the database by launch Postgres.app from Terminal.
But I'm got you mind about open Console.app, and here are my screen shot. May can help you solve this issue. And yes! Postgres.app are really cool and useful and easy to go! Thank you and your team!

------------WORK by Terminal-------------

Screen Shot 2019-12-11 at 17 01 18

------------Fuzz about console------------

Screen Shot 2019-12-11 at 17 05 51

@jakob
Copy link
Member

jakob commented Dec 11, 2019

The last line in the console looks similar to the error message reported here:
macvim-dev/macvim#821

Maybe we just need to set NSAppleEventsUsageDescription in Info.plist

jakob added a commit that referenced this issue Dec 11, 2019
Otherwise macOS doesn't allow sending Apple Events (see issue #509).
It should not be necessary for the helper app, but we add it just to be safe.
@JMEssex
Copy link

JMEssex commented Dec 11, 2019

Thank you @jakob for showing us all the many alternative ways which we can access our postgresQL server. I believe the real issue though is that the "Feature" of double clicking the server icon, (which has been deliberately developed by the psql team) is not functioning properly and the "System Preferences" -> "Security" -> "Privacy" -> "Automation" does not allow for Terminal or iTerm2 to link with the Postgres macOS application even when the .profile file has the correct PATH.

Thank you.
image

@jakob
Copy link
Member

jakob commented Dec 11, 2019

@JMEssex Yes, I understand. I think it's because we're missing the key in the Info.plist. I'm currently working on an update to fix this.

@jakob
Copy link
Member

jakob commented Dec 11, 2019

OK, the update is released. Can you try updating to the latest version (Postgres.app 2.3.3c) and see if it fixes the problem for you?

@JMEssex
Copy link

JMEssex commented Dec 11, 2019

@jakob Thank you! It works for me and my co-worker.

@vose2008
Copy link

Cool ! Now app work very well. Thank you ~~ XD

@NerdtureUs
Copy link

NerdtureUs commented Jan 25, 2020

@jakob Might there have been some regression here? I installed 2.3.3e today
image

but I can no longer click the database and open it.
image

Before this morning it was working fine, and I am able to run psql from the terminal and connect without issue, and I've enabled Postgres automation to terminal.

@jakob
Copy link
Member

jakob commented Jan 27, 2020

@NerdtureUs Ugh, I thought I had finally fixed this issue...

  • How did you install the new version? Did you download it manually, or did you use the automatic update function? If you downloaded it manually, where did you download it from?

  • Which version of macOS are you on?

  • Which version of 2.3.3e are you using, ie. which of the three versions offered from https://postgresapp.com/downloads.html ?

@jakob jakob added the bug label Jan 27, 2020
@jakob
Copy link
Member

jakob commented Jan 27, 2020

@NerdtureUs
I just tested all three downloads from https://postgresapp.com/downloads.html, and they all work on macOS 10.14.6.

Just to make sure it's not one of those random code signing failures, can you try restarting your Mac, and see if the issue persists?

Is anything written to Console.app when you double click the database and the error is shown? (You need to open Console.app before triggering the warning to enable more detailed logging)

@NerdtureUs
Copy link

@jakob Thanks for getting back so quickly.
I installed with the automatic update and running mac os 10.15.2 (19C57) with Postgres version 2.3.3e (68)

After the reboot, there was a system confirmation that showed up, to allow Postgres access to the terminal, which wasn't there previously. Once granted, I am able to click the database to launch and connect.

@abhijitrri
Copy link

Hi I can connect to Postgres by typing psql on the therminal. I am using the fish shell. however only the \q command works. nothing else (for eg. the \l command) seems to work . The error message is as follows - sh: more: command not found

@wil93
Copy link

wil93 commented Mar 28, 2021

I can reproduce this bug when I try to use the Postgres app from a secondary user on my laptop. (The Automation is enabled so that's not the issue.)

If I paste the provided command in the terminal everything works fine, but double-clicking on the database only works from the main user, where I installed the Postgres app.

Hope this helps debugging.

@sebsoftware
Copy link

sebsoftware commented Apr 25, 2022

I had the same problem with Catalina on a MacBook Pro. I fiddled a lot, but Postgres wasn't added to the list of applications in system security. I tried this also with multiple user accounts. No luck.

Finally it was solved with the following steps.

  1. booting into recovery mode.
  2. Removed the Security Database in /Library/Application Support/com.apple.TCC
  3. Reset PRAM (Cmd+Alt+P+R)

Now it works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants