{"action":"created","issue":{"url":"https://api.github.com/repos/LLNL/spack/issues/1720","repository_url":"https://api.github.com/repos/LLNL/spack","labels_url":"https://api.github.com/repos/LLNL/spack/issues/1720/labels{/name}","comments_url":"https://api.github.com/repos/LLNL/spack/issues/1720/comments","events_url":"https://api.github.com/repos/LLNL/spack/issues/1720/events","html_url":"https://github.com/LLNL/spack/issues/1720","id":174863962,"number":1720,"title":"\"spack reindex\" fails with \"invalid ref count\"","user":{"login":"eschnett","id":213514,"avatar_url":"https://avatars.githubusercontent.com/u/213514?v=3","gravatar_id":"","url":"https://api.github.com/users/eschnett","html_url":"https://github.com/eschnett","followers_url":"https://api.github.com/users/eschnett/followers","following_url":"https://api.github.com/users/eschnett/following{/other_user}","gists_url":"https://api.github.com/users/eschnett/gists{/gist_id}","starred_url":"https://api.github.com/users/eschnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eschnett/subscriptions","organizations_url":"https://api.github.com/users/eschnett/orgs","repos_url":"https://api.github.com/users/eschnett/repos","events_url":"https://api.github.com/users/eschnett/events{/privacy}","received_events_url":"https://api.github.com/users/eschnett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"tgamblin","id":299842,"avatar_url":"https://avatars.githubusercontent.com/u/299842?v=3","gravatar_id":"","url":"https://api.github.com/users/tgamblin","html_url":"https://github.com/tgamblin","followers_url":"https://api.github.com/users/tgamblin/followers","following_url":"https://api.github.com/users/tgamblin/following{/other_user}","gists_url":"https://api.github.com/users/tgamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgamblin/subscriptions","organizations_url":"https://api.github.com/users/tgamblin/orgs","repos_url":"https://api.github.com/users/tgamblin/repos","events_url":"https://api.github.com/users/tgamblin/events{/privacy}","received_events_url":"https://api.github.com/users/tgamblin/received_events","type":"User","site_admin":false},"assignees":[{"login":"tgamblin","id":299842,"avatar_url":"https://avatars.githubusercontent.com/u/299842?v=3","gravatar_id":"","url":"https://api.github.com/users/tgamblin","html_url":"https://github.com/tgamblin","followers_url":"https://api.github.com/users/tgamblin/followers","following_url":"https://api.github.com/users/tgamblin/following{/other_user}","gists_url":"https://api.github.com/users/tgamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgamblin/subscriptions","organizations_url":"https://api.github.com/users/tgamblin/orgs","repos_url":"https://api.github.com/users/tgamblin/repos","events_url":"https://api.github.com/users/tgamblin/events{/privacy}","received_events_url":"https://api.github.com/users/tgamblin/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-09-02T23:17:11Z","updated_at":"2016-09-11T22:18:08Z","closed_at":null,"body":"A previous install of `git` failed, leaving a half-installed `git` ghost. This is usually remedied via `spack reindex`, but this fails here.\r\n\r\nMy original command is:\r\n```\r\n$ spack install -v julia\r\n==> Installing julia\r\n==> git is already installed in /home/eschnett/src/spack/opt/spack/linux-centos7-x86_64/gcc-6.1.0-spack/git-2.9.3-kgah4b5gurqx2rswlt44xoinshfw7doi\r\nTraceback (most recent call last):\r\n  File \"/home/eschnett/src/spack/bin/spack\", line 192, in <module>\r\n    main()\r\n  File \"/home/eschnett/src/spack/bin/spack\", line 169, in main\r\n    return_val = command(parser, args)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/cmd/install.py\", line 92, in install\r\n    explicit=True)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/package.py\", line 919, in do_install\r\n    run_tests=run_tests)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/package.py\", line 1069, in do_install_dependencies\r\n    dep.package.do_install(**kwargs)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/package.py\", line 901, in do_install\r\n    rec = spack.installed_db.get_record(self.spec)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/database.py\", line 75, in converter\r\n    return function(self, spec_like, *args, **kwargs)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/database.py\", line 521, in get_record\r\n    key = self._get_matching_spec_key(spec, **kwargs)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/database.py\", line 516, in _get_matching_spec_key\r\n    raise KeyError(\"No such spec in database! %s\" % spec)\r\nKeyError: 'No such spec in database! git@2.9.3%gcc@6.1.0-spack arch=linux-centos7-x86_64^autoconf@2.69%gcc@6.1.0-spack arch=linux-centos7-x86_64^bzip2@1.0.6%gcc@6.1.0-spack arch=linux-centos7-x86_64^curl@7.50.1%gcc@6.1.0-spack arch=linux-centos7-x86_64^expat@2.2.0%gcc@6.1.0-spack arch=linux-centos7-x86_64^gettext@0.19.8.1%gcc@6.1.0-spack+bzip2+curses+git~libunistring+libxml2+tar+xz arch=linux-centos7-x86_64^libsigsegv@2.10%gcc@6.1.0-spack arch=linux-centos7-x86_64^libxml2@2.9.4%gcc@6.1.0-spack~python arch=linux-centos7-x86_64^m4@1.4.17%gcc@6.1.0-spack+sigsegv arch=linux-centos7-x86_64^ncurses@6.0%gcc@6.1.0-spack arch=linux-centos7-x86_64^openssl@1.0.2h%gcc@6.1.0-spack arch=linux-centos7-x86_64^pcre@8.39%gcc@6.1.0-spack+utf arch=linux-centos7-x86_64^perl@5.24.0%gcc@6.1.0-spack+cpanm arch=linux-centos7-x86_64^tar@1.29%gcc@6.1.0-spack arch=linux-centos7-x86_64^xz@5.2.2%gcc@6.1.0-spack arch=linux-centos7-x86_64^zlib@1.2.8%gcc@6.1.0-spack arch=linux-centos7-x86_64'\r\n```\r\n\r\nTo remedy, I try to reindex:\r\n```\r\n$ spack reindex\r\nTraceback (most recent call last):\r\n  File \"/home/eschnett/src/spack/bin/spack\", line 192, in <module>\r\n    main()\r\n  File \"/home/eschnett/src/spack/bin/spack\", line 169, in main\r\n    return_val = command(parser, args)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/cmd/reindex.py\", line 31, in reindex\r\n    spack.installed_db.reindex(spack.install_layout)\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/database.py\", line 375, in reindex\r\n    self._check_ref_counts()\r\n  File \"/home/eschnett/src/spack/lib/spack/spack/database.py\", line 407, in _check_ref_counts\r\n    (key, found, expected, self._index_path))\r\nAssertionError: Invalid ref_count: 3f2b2nmz2brdouohnoxiik3zch7d4v7p: 31 (expected 30), in DB /home/eschnett/src/spack/opt/spack/.spack-db/index.yaml\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/LLNL/spack/issues/comments/246208548","html_url":"https://github.com/LLNL/spack/issues/1720#issuecomment-246208548","issue_url":"https://api.github.com/repos/LLNL/spack/issues/1720","id":246208548,"user":{"login":"citibeth","id":1924215,"avatar_url":"https://avatars.githubusercontent.com/u/1924215?v=3","gravatar_id":"","url":"https://api.github.com/users/citibeth","html_url":"https://github.com/citibeth","followers_url":"https://api.github.com/users/citibeth/followers","following_url":"https://api.github.com/users/citibeth/following{/other_user}","gists_url":"https://api.github.com/users/citibeth/gists{/gist_id}","starred_url":"https://api.github.com/users/citibeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citibeth/subscriptions","organizations_url":"https://api.github.com/users/citibeth/orgs","repos_url":"https://api.github.com/users/citibeth/repos","events_url":"https://api.github.com/users/citibeth/events{/privacy}","received_events_url":"https://api.github.com/users/citibeth/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T22:18:07Z","updated_at":"2016-09-11T22:18:07Z","body":"Is this fixed by #1688?\r\n"}}
{"actor":{"display_login":"citibeth"}}