# Beets constantly crashing | ValueError: empty album for album id 142

**URL:** <https://discourse.beets.io/t/beets-constantly-crashing-valueerror-empty-album-for-album-id-142/1550>\
**Category:** Help\
**Created:** [October 25, 2020, 4:12pm UTC](https://discourse.beets.io/t/beets-constantly-crashing-valueerror-empty-album-for-album-id-142/1550 "2020-10-25T16:12:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cs\_legend\_93](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/cs_legend_93/32/482_2.png) [@cs\_legend\_93](https://discourse.beets.io/u/cs_legend_93)\
**Post date:** [October 25, 2020, 4:12pm UTC](https://discourse.beets.io/t/beets-constantly-crashing-valueerror-empty-album-for-album-id-142/1550/1 "2020-10-25T16:12:44Z")

</div>

My beets is constantly crashing on import on many different albums of mine, its becoming an issue and is preventing me from using Beets properly.

My issue is in detail here:  
[https://www.reddit.com/r/musichoarder/comments/jb8sjy/beets\_constantly\_erroring\_and\_crashing\_what\_is/](https://www.reddit.com/r/musichoarder/comments/jb8sjy/beets_constantly_erroring_and_crashing_what_is/)

and here is latest error:

> **[beets-error-1 hosted at ImgBB](https://ibb.co/GR4QwBc)**
>
> Image beets-error-1 hosted in ImgBB

I found a similar topic in Beets Discourse here, I disabled fetart and it did not solve the issue:

> [@ValueError: Empty album](https://discourse.beets.io/t/valueerror-empty-album/625):
>
> Hi, Every now and then I get the following error and Beets exits during import and I have to start over again. What could cause this problem? I’ve looked on Github but didn’t find a bug that seemed to be connected to this error. Thanks for any ideas, Jan Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/bin/beet", line 11, in \<module\> load\_entry\_point('beets==1.4.8', 'console\_scripts', 'beet')() File "/Library/Frameworks/Python.framework/Versi…

Here is my config:

> **[\# Beets configuration --------------------------------------------------------...](https://pastebin.com/2Y63PLCm)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

This is really frustrating and im sure its something small… but this is continuously plaguing me.

If anyone can help I’d appreciate it!

---

<div class="post-metadata">

**Author:** ![cs\_legend\_93](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/cs_legend_93/32/482_2.png) [@cs\_legend\_93](https://discourse.beets.io/u/cs_legend_93)\
**Post date:** [October 25, 2020, 4:16pm UTC](https://discourse.beets.io/t/beets-constantly-crashing-valueerror-empty-album-for-album-id-142/1550/2 "2020-10-25T16:16:35Z")

</div>

I manually delete the empty albums in the database by first searching for them like this:  
`select count(*) from albums left join items on items.album_id = albums.id WHERE items.id IS NULL`

Then there is always `1` which is empty after this error.

Then i delete them by running this command:  
`delete from albums where id IN (select albums.id from albums left join items on items.album_id = albums.id WHERE items.id IS NULL)`

–  
After that, I run it again, and the error shows up again… Quite draining to be honest

---

<div class="post-metadata">

**Author:** ![wisp3rwind](https://avatars.discourse-cdn.com/v4/letter/w/f0a364/32.png) [@wisp3rwind](https://discourse.beets.io/u/wisp3rwind)\
**Post date:** [November 1, 2020, 4:19pm UTC](https://discourse.beets.io/t/beets-constantly-crashing-valueerror-empty-album-for-album-id-142/1550/3 "2020-11-01T16:19:57Z")

</div>

As someone on Reddit stated, your database seems to be damaged. Unless you have an idea how that happened, what exactly is wrong about the database and how to undo it, I can’t think of a reliable way to restore the database to a consistent state. If you can, restore from a working backup or rebuild the database, as also suggested on Reddit. Manually modifying some of the Sqlite tables is probably a good way to bring the database into an inconsistent state in the first place.

Here are some things to try:

- disable plugins (not just `fetchart` or any other single plugin), in particular the non-official plugins. The traceback posted on reddit probably is an issue with a plugin (can’t tell which, though, see the next point.) That is not necessarily the underlying problem, though.
- run beets in verbose mode (`-v`), see whether it gives any further clues.
- try to reproduce on a new database: If you manage to do so, we’d have an actual starting point to debug the issue

Next time, please don’t scatter the information about your problem across three external websites, and don’t screenshot error messages but copy the text.
