Skip to content

NoSuchPatchError for graphviz, unable to build anything #19649

@adamjstewart

Description

@adamjstewart

It seems like my Spack database got corrupted somehow? Anytime I try to build any package, I see:

==> Error: Failed to install re2c due to NoSuchPatchError: Couldn't find patch for package builtin.graphviz with sha256: 99962eb1a491bbaa8afc6d8d238f3edb3b45badf1c1f9af026ed52c6c28d2d8a

even for packages that don't depend on graphviz. I tried both spack clean -m and spack clean -p and neither fixed it. spack reindex crashes with the same error.

Steps to reproduce the issue

$ spack reindex
$ spack install re2c

Error Message

$ spack -d install re2c
...
  Fetch: 0.02s.  Build: 1m 40.30s.  Total: 1m 40.32s.
[+] /Users/Adam/spack/opt/spack/darwin-catalina-x86_64/apple-clang-12.0.0/re2c-1.2.1-7eg6bjrpxpiackuur7ruknhsbjz2wikq
==> [2020-10-31-21:56:25.779818] NoSuchPatchError: Couldn't find patch for package builtin.graphviz with sha256: 99962eb1a491bbaa8afc6d8d238f3edb3b45badf1c1f9af026ed52c6c28d2d8a
==> [2020-10-31-21:56:25.780602] Error: Failed to install re2c due to NoSuchPatchError: Couldn't find patch for package builtin.graphviz with sha256: 99962eb1a491bbaa8afc6d8d238f3edb3b45badf1c1f9af026ed52c6c28d2d8a
==> [2020-10-31-21:56:25.780758] Flagging re2c as failed: Couldn't find patch for package builtin.graphviz with sha256: 99962eb1a491bbaa8afc6d8d238f3edb3b45badf1c1f9af026ed52c6c28d2d8a
==> [2020-10-31-21:56:25.788636] NoSuchPatchError: Couldn't find patch for package builtin.graphviz with sha256: 99962eb1a491bbaa8afc6d8d238f3edb3b45badf1c1f9af026ed52c6c28d2d8a
==> [2020-10-31-21:56:25.788763] Error: Couldn't find patch for package builtin.graphviz with sha256: 99962eb1a491bbaa8afc6d8d238f3edb3b45badf1c1f9af026ed52c6c28d2d8a
Traceback (most recent call last):
  File "/Users/Adam/spack/lib/spack/spack/main.py", line 762, in main
    return _invoke_command(command, parser, args, unknown)
  File "/Users/Adam/spack/lib/spack/spack/main.py", line 490, in _invoke_command
    return_val = command(parser, args)
  File "/Users/Adam/spack/lib/spack/spack/cmd/install.py", line 405, in install
    install_spec(args, kwargs, abstract, concrete)
  File "/Users/Adam/spack/lib/spack/spack/cmd/install.py", line 256, in install_spec
    spec.package.do_install(**kwargs)
  File "/Users/Adam/spack/lib/spack/spack/package.py", line 1602, in do_install
    builder.install(**kwargs)
  File "/Users/Adam/spack/lib/spack/spack/installer.py", line 1591, in install
    self._install_task(task, **kwargs)
  File "/Users/Adam/spack/lib/spack/spack/installer.py", line 1210, in _install_task
    explicit=explicit)
  File "/Users/Adam/spack/lib/spack/spack/database.py", line 120, in converter
    return function(self, spec_like, *args, **kwargs)
  File "/Users/Adam/spack/lib/spack/spack/database.py", line 1135, in add
    self._add(spec, directory_layout, explicit=explicit)
  File "/Users/Adam/spack/lib/spack/llnl/util/lock.py", line 584, in __exit__
    if self._exit(release_fn):
  File "/Users/Adam/spack/lib/spack/llnl/util/lock.py", line 605, in _exit
    return self._lock.release_write(release_fn)
  File "/Users/Adam/spack/lib/spack/llnl/util/lock.py", line 461, in release_write
    result = release_fn()
  File "/Users/Adam/spack/lib/spack/llnl/util/lock.py", line 578, in release_fn
    return self._release_fn(type, value, traceback)
  File "/Users/Adam/spack/lib/spack/spack/database.py", line 978, in _write
    self._write_to_file(f)
  File "/Users/Adam/spack/lib/spack/spack/database.py", line 613, in _write_to_file
    for k, v in self._data.items())
  File "/Users/Adam/spack/lib/spack/spack/database.py", line 613, in <genexpr>
    for k, v in self._data.items())
  File "/Users/Adam/spack/lib/spack/spack/database.py", line 212, in to_dict
    rec_dict.update({'spec': self.spec.node_dict_with_hashes()})
  File "/Users/Adam/spack/lib/spack/spack/spec.py", line 1654, in node_dict_with_hashes
    node[self.name]['full_hash'] = self.full_hash()
  File "/Users/Adam/spack/lib/spack/spack/spec.py", line 1464, in full_hash
    return self._cached_hash(ht.full_hash, length)
  File "/Users/Adam/spack/lib/spack/spack/spec.py", line 1431, in _cached_hash
    hash_string = self._spec_hash(hash)
  File "/Users/Adam/spack/lib/spack/spack/spec.py", line 1404, in _spec_hash
    node_dict = self.to_node_dict(hash=hash)
  File "/Users/Adam/spack/lib/spack/spack/spec.py", line 1562, in to_node_dict
    d['package_hash'] = self.package.content_hash()
  File "/Users/Adam/spack/lib/spack/spack/package.py", line 1437, in content_hash
    for p in self.spec.patches)
  File "/Users/Adam/spack/lib/spack/llnl/util/lang.py", line 197, in _memoized_function
    func.cache[args] = func(*args)
  File "/Users/Adam/spack/lib/spack/spack/spec.py", line 3090, in patches
    patch = index.patch_for_package(sha256, self.package)
  File "/Users/Adam/spack/lib/spack/spack/patch.py", line 350, in patch_for_package
    % (pkg.fullname, sha256))
spack.patch.NoSuchPatchError: Couldn't find patch for package builtin.graphviz with sha256: 99962eb1a491bbaa8afc6d8d238f3edb3b45badf1c1f9af026ed52c6c28d2d8a

Information on your system

  • Spack: 0.15.4-1753-51a9473bf8
  • Python: 3.8.5
  • Platform: darwin-catalina-ivybridge

I also tried with Python 2 but same error.

Additional information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThe issue needs to be prioritized

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions