Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.6k stars 12.35k forks source link

atool installation breaks postgresql services #11071

Closed dredozubov closed 7 years ago

dredozubov commented 7 years ago

10.11.6, Brew updated, brew doctor doesn't seem to show anything remotely related(you can see the log below). Atool and postgresql seem completely unrelated.

Command that introduced the issue:

% brew install atool
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/boneyard, homebrew/core, homebrew/versions).
==> New Formulae
bluepill                      homebrew/boneyard/scsh        urh
dhall-json                    homebrew/boneyard/xstow       woboq_codebrowser
grunt                         prest
gtef                          spigot
==> Updated Formulae
ack ✔                 doctl                 kafka                 ponyc
advancemame           dovecot               kobalt                psqlodbc
app-engine-java       dub                   kops                  quex
arangodb              dvm                   libarchive            readline ✔
aws-elasticbeanstalk  emp                   libffi ✔              redpen
aws-sdk-cpp           esniper               libmatroska ✔         ripgrep
awscli                etcd                  libmxml               shairport-sync
bacula-fd             fonttools             libsodium             stuntman
bagit                 fossil                lldpd                 swiftformat
boxes                 fuse-emulator         logtalk               sysbench ✔
carthage              gdbm ✔                mailutils             tbb
castxml               git-ftp               mbedtls               texmath
ccache                googler               mednafen              tinc
certigo               gti                   mesos                 ttyd
chromedriver          gxml                  miller                vim ✔
clhep                 harfbuzz ✔            mkdocs                wesnoth
cockatrice            icecast               mpd                   youtube-dl ✔
creduce               imagemagick           neo4j                 zimg
dante                 imagemagick@6         offlineimap           znc
dcmtk                 irssi                 ompl
debianutils           jenkins               openrtsp
deis                  json-glib             pcap_dnsproxy
==> Renamed Formulae
bazel02 -> bazel@0.2
bigdata -> blazegraph
bison27 -> bison@2.7
boost-python159 -> boost-python@1.59
cassandra21 -> cassandra@2.1
cassandra22 -> cassandra@2.2
clang-format38 -> clang-format@3.8
docker111 -> docker@1.11
docker171 -> docker@1.71
ffmpeg28 -> ffmpeg@2.8
freetds091 -> freetds@0.91
giflib5 -> giflib@5
glfw2 -> glfw@2
gnupg21 -> gnupg@2.1
gnuplot4 -> gnuplot@4
gradle214 -> gradle@2.14
grails25 -> grails@2.5
gsl1 -> gsl@1
gst-ffmpeg010 -> gst-ffmpeg@0.10
gst-plugins-bad010 -> gst-plugins-bad@0.10
gst-plugins-base010 -> gst-plugins-base@0.10
gst-plugins-good010 -> gst-plugins-good@0.10
gst-plugins-ugly010 -> gst-plugins-ugly@0.10
gstreamer010 -> gstreamer@0.10
postgresql94 ✔ -> postgresql@9.4
postgresql95 -> postgresql@9.5
rebar3 -> rebar@3
redis26 -> redis@2.6
redis28 -> redis@2.8
ruby187 -> ruby@1.8
ruby193 -> ruby@1.9
ruby20 -> ruby@2.0
ruby21 -> ruby@2.1
ruby22 -> ruby@2.2
ruby23 -> ruby@2.3
==> Deleted Formulae
homebrew/boneyard/dmtx-utils                 homebrew/versions/gst-plugins-bad010
homebrew/versions/bazel02                    homebrew/versions/gst-plugins-base010
homebrew/versions/bison27                    homebrew/versions/gst-plugins-good010
homebrew/versions/cassandra21                homebrew/versions/gst-plugins-ugly010
homebrew/versions/cassandra22                homebrew/versions/gstreamer010
homebrew/versions/clang-format38             homebrew/versions/postgresql94 ✔
homebrew/versions/docker111                  homebrew/versions/postgresql95
homebrew/versions/docker171                  homebrew/versions/rebar3
homebrew/versions/drush5                     homebrew/versions/redis1310
homebrew/versions/ffmpeg28                   homebrew/versions/redis26
homebrew/versions/freetds091                 homebrew/versions/redis28
homebrew/versions/giflib5                    homebrew/versions/ruby187
homebrew/versions/glfw2                      homebrew/versions/ruby193
homebrew/versions/gnupg21                    homebrew/versions/ruby20
homebrew/versions/gnuplot4                   homebrew/versions/ruby21
homebrew/versions/gradle214                  homebrew/versions/ruby22
homebrew/versions/grails25                   homebrew/versions/ruby23
homebrew/versions/gsl1                       scsh
homebrew/versions/gst-ffmpeg010              xstow
==> Migrating postgresql94 to postgresql@9.4
==> Unlinking postgresql94
Moving to: /usr/local/Cellar/postgresql@9.4
==> Linking postgresql@9.4

==> Downloading https://homebrew.bintray.com/bottles/atool-0.39.0.el_capitan.bottle.2.ta
######################################################################## 100.0%
==> Pouring atool-0.39.0.el_capitan.bottle.2.tar.gz
🍺  /usr/local/Cellar/atool/0.39.0: 21 files, 187.7KB

Demonstrating the issue

% brew services list
Name           Status  User Plist
...
postgresql     started dr   /Users/dr/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
postgresql@9.4 started dr   /Users/dr/Library/LaunchAgents/homebrew.mxcl.postgresql@9.4.plist
...

% brew services restart postgresql
Stopping `postgresql`... (might take a while)
==> Successfully stopped `postgresql` (label: homebrew.mxcl.postgresql)
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)

% brew services restart postgresql@9.4
Stopping `postgresql@9.4`... (might take a while)
==> Successfully stopped `postgresql@9.4` (label: homebrew.mxcl.postgresql@9.4)
==> Successfully started `postgresql@9.4` (label: homebrew.mxcl.postgresql@9.4)

% ps aux | grep postg
dr              25509   0.0  0.0  2434840    768 s001  S+    1:36PM   0:00.00 grep --color postg

Fixing the services was relatively straightforward after removing the stale .pid file, but i don't see any reason for homebrew to mess up this installation after the execution of brew install atool. I had to unlink updated libpq, for some reason 9.6.1 was linked.

brew doctor output

% brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: The following beta release of XQuartz is installed: 2.7.8_beta3

XQuartz beta releases include address sanitization, and do not work with
all software; notably, wine will not work with beta releases of XQuartz.
We recommend only installing stable releases of XQuartz.

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/dr/.nix-profile/bin/xml2-config

Warning: Your XQuartz (2.7.8_beta3) is outdated.
Please install XQuartz 2.7.9 (or delete the current version).
XQuartz can be updated using Homebrew-Cask by running
  brew cask reinstall xquartz

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  emacs
  openssl101
  perl
  zeromq

Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
  brew install ghc gperftools gtk-mac-integration libtool ocamlbuild openssl@1.1 shared-mime-info

Run `brew missing` for more details.
fxcoudert commented 7 years ago

It is due to the postgresql@9.4 migration:

==> Migrating postgresql94 to postgresql@9.4
==> Unlinking postgresql94
Moving to: /usr/local/Cellar/postgresql@9.4
==> Linking postgresql@9.4
dredozubov commented 7 years ago

@fxcoudert naturally, but why does it happen at all when i run the above command?

dunn commented 7 years ago

That migration is part of brew update which is run automatically before installations.

MikeMcQuaid commented 7 years ago

You'll need to investigate the contents of the postgresql log to figure out why it isn't starting.