错误:执行失败;`/bin/launchctl bootstrap gui/501 /Users/josh/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist` 退出并显示 5

Jos*_*ens 10 postgresql macos homebrew

当尝试启动 postgresql 时

\n
\xe2\x9e\x9c  ~ brew services start postgresql\nWarning: Use postgresql@14 instead of deprecated postgresql\nBootstrap failed: 5: Input/output error\nTry re-running the command as root for richer errors.\nError: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/josh/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist` exited with 5.\n
Run Code Online (Sandbox Code Playgroud)\n

运行 brew services list 时获取“错误”状态

\n
\xe2\x9e\x9c  ~ brew services list\nName          Status     User File\npostgresql@14 error  256 root ~/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist\n
Run Code Online (Sandbox Code Playgroud)\n

PSQL 工作得很好,关闭我的笔记本电脑(没有更新),当我第二天打开它时,psql 不工作。我使用的是 OSX 版本 12.6(蒙特雷)。

\n

小智 9

今天我的 Mac Ventura 13.0 上出现了同样的错误。执行了这些步骤并有所帮助。

  1. 运行rm /usr/local/var/postgresql@{YOUR_VERSION}/postmaster.pid以删除postmaster.pid文件。这通常是由文件中的错误引起的postmaster.pid
  2. 运行brew services stop postgresql以停止当前的 postgresql 服务。
  3. 最后运行,会生成brew services start postgresql一个新文件。postmaster.pid

如果这不起作用,您可以运行brew doctor并查看它是否会返回Your system is ready to brew。如果有警告,您可以在此处与社区分享以获取更多详细信息。


jbk*_*jbk 9

我在 M1 pro 的 13.0 上遇到了同样的问题,所做的就是brew services restart postgresql@14关闭,重新启动并运行良好,问题消失了。