Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReplayGainPlugin throws false alarm sqlite3.OperationalError in test suite #3809

Closed
ybnd opened this issue Dec 15, 2020 · 1 comment · Fixed by #3817
Closed

ReplayGainPlugin throws false alarm sqlite3.OperationalError in test suite #3809

ybnd opened this issue Dec 15, 2020 · 1 comment · Fixed by #3817
Assignees
Labels
bug bugs that are confirmed and actionable

Comments

@ybnd
Copy link
Contributor

ybnd commented Dec 15, 2020

Problem

The tests in test_replaygain.py work with an in-memory SQLite database, which doesn't seem to play well with the parallelization introduced in #3478.

  • item.store() raises

    Exception in thread Thread-90:
    Traceback (most recent call last):
      File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
        self.run()
      File "/home/ybnd/code/beets/beets/beetsplug/replaygain.py", line 1198, in run
        six.reraise(exc[0], exc[1], exc[2])
      File "/home/ybnd/.local/share/venve/beets/lib/python3.8/site-packages/six.py", line 703, in reraise
        raise value
      File "/home/ybnd/code/beets/beets/beetsplug/replaygain.py", line 1510, in wfunc
        return func(*args, **kwargs)
      File "/home/ybnd/code/beets/beets/beetsplug/replaygain.py", line 1460, in _store_track
        store_track_gain(item, track_gains[0])
      File "/home/ybnd/code/beets/beets/beetsplug/replaygain.py", line 1324, in store_track_gain
        self._store(item)
      File "/home/ybnd/code/beets/beets/beetsplug/replaygain.py", line 1319, in _store
        item.store()
      File "/home/ybnd/code/beets/beets/beets/library.py", line 347, in store
        super(LibModel, self).store(fields)
      File "/home/ybnd/code/beets/beets/beets/dbcore/db.py", line 516, in store
        tx.mutate(query, subvars)
      File "/home/ybnd/code/beets/beets/beets/dbcore/db.py", line 838, in mutate
        cursor = self.db._connection().execute(statement, subvals)
    sqlite3.OperationalError: no such table: items
    

    on the first call, but just succeeds on the second call

  • Occurs on every call to item.store()

  • Doesn't depend on the ReplayGain backend you use

Reproducing

  1. Make sure test_replaygain.py actually runs some of the tests (most are skipped in the CI build)
  2. Comment out the _store_retry_once patch
  3. Run the tests

Setup

  • OS: 5.8.18-1-MANJARO
  • Python version: 3.8.6
  • beets version: 8645f56
  • Turning off plugins made problem go away (yes/no): N/A

My configuration (output of beet config) is:

directory: ~/code/beets/library
library: ~/code/beets/library/library.db

threaded: yes
parallel_threads: 2
original_year: yes

paths:
    default: $albumartist/%if{$original_year,$original_year,$year} - $album%aunique{}/$track $title
    singleton: $artist/singles/%if{$original_year,$original_year,$year} - $title
    comp: compilations/%if{$original_year,$original_year,$year} - $albumartist - $album%aunique{}/$track $artist - $title

pluginpath:
    - ~/code/beets/beets-copyartifacts/build/lib/beetsplug
    - ~/code/beets/beets-link/beetsplug
    - ~/.local/lib/python3.8/site-packages/beetsplug

plugins: discogs convert missing embedart info types duplicates edit fromfilename copyartifacts link replaygain lyrics artistcountry

replaygain:
#    backend: command
    backend: ffmpeg
#    backend: bs1770gain
#    backend: gstreamer
#    backend: audiotools

convert:
    dest: library/converted

replace:
    '^\.': _
    '[\x00-\x1f]': _
    '[<>"\*\|\\]': '_'
    ':': '-'
    '\?': '_'
    '\.$': '.'
    '\s+$': ''
    '^\s+': ''
    '^-': '_'

aunique:
    keys: albumartist album
    disambiguators: albumdisambig country albumtype year label catalognum releasegroupdisambig
    bracket: '()'
@sampsyo sampsyo added the bug bugs that are confirmed and actionable label Dec 15, 2020
@sampsyo
Copy link
Member

sampsyo commented Dec 15, 2020

Thanks for the detailed account!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants