When updating facets from an older version (~alpha4), I get this error when running update hook 8001:

'facets_facet_source' entity with ID 'search_api_views__indexed_articles__search_articles' already exists.

It seems the facets_update_8001() is not idempotent. It assumes that the existing facet sources need to be upgraded without actually examining them to ensure that's the case, so if they already match the new format for same reason the update hook will fail.

While this is pretty clearly the proximal cause of the error, I have no idea what the root cause is, i.e. why our facet sources already seem to be updated.

CommentFileSizeAuthor
#2 facets-2880948-2.patch859 bytesDane Powell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dane Powell created an issue. See original summary.

Dane Powell’s picture

Status: Active » Needs review
FileSize
859 bytes

This fixes the immediate error by simply checking if the target facet source already exists before attempting to create it. Like I mentioned earlier, I have no idea how this condition might arise or what other bugs this might cover up or create.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

capynet’s picture

#2 patch worked for me.

borisson_’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.