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

sqlite3.OperationalError: no such table: meta #918

Closed
kura opened this issue Jan 9, 2020 · 4 comments
Closed

sqlite3.OperationalError: no such table: meta #918

kura opened this issue Jan 9, 2020 · 4 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists
Milestone

Comments

@kura
Copy link

kura commented Jan 9, 2020

Describe the bug
Since coverage 5.0.2 an sqlite exception is being thrown on Python 3.6 and 3.7. I have not tested 3.8 or any earlier versions.

Traceback (most recent call last):
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/coverage/sqldata.py", line 1033, in execute
    return self.con.execute(sql, parameters)
sqlite3.OperationalError: no such table: meta

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/nose/__main__.py", line 8, in <module>
    run_exit()
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/nose/core.py", line 121, in __init__
    **extra_args)
  File "/usr/lib64/python3.6/unittest/main.py", line 95, in __init__
    self.runTests()
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/nose/core.py", line 207, in runTests
    result = self.testRunner.run(self.test)
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/nose/core.py", line 66, in run
    result.printErrors()
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/nose/result.py", line 110, in printErrors
    self.config.plugins.report(self.stream)
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/nose/plugins/cover.py", line 183, in report
    self.coverInstance.stop()
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/coverage/control.py", line 670, in combine
    self.get_data()
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/coverage/control.py", line 696, in get_data
    if self._collector and self._collector.flush_data():
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/coverage/collector.py", line 425, in flush_data
    self.covdata.add_lines(self.mapped_file_dict(self.data))
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/coverage/sqldata.py", line 436, in add_lines
    self._choose_lines_or_arcs(lines=True)
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/coverage/sqldata.py", line 496, in _choose_lines_or_arcs
    ('has_arcs', str(int(arcs)))
  File "/media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/coverage/sqldata.py", line 1048, in execute
    raise CoverageException("Couldn't use data file {!r}: {}".format(self.filename, msg))
coverage.misc.CoverageException: Couldn't use data file '/media/workspace/APPNAME/tests/.coverage': no such table: meta

To Reproduce
How can we reproduce the problem? Please be specific.

  1. What version of Python are you using?
    3.6.8 and 3.7.6

  2. What version of coverage.py are you using? The output of coverage debug sys is helpful.
    5.0.2

-- sys -------------------------------------------------------
                        version: 5.0.2
                       coverage: /media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages/coverage/__init__.py
                         tracer: -none-
                        CTracer: available
           plugins.file_tracers: -none-
            plugins.configurers: -none-
      plugins.context_switchers: -none-
              configs_attempted: .coveragerc
                                 setup.cfg
                                 tox.ini
                                 pyproject.toml
                   configs_read: -none-
                    config_file: None
                config_contents: -none-
                      data_file: -none-
                         python: 3.6.8 (default, Aug  7 2019, 17:28:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
                       platform: Linux-3.10.0-957.27.2.el7.x86_64-x86_64-with-centos-7.6.1810-Core
                 implementation: CPython
                     executable: /media/workspace/APPNAME/tests/venv/bin/python3
                   def_encoding: utf-8
                    fs_encoding: utf-8
                            pid: 20026
                            cwd: /media/workspace/APPNAME/tests
                           path: /media/workspace/APPNAME/tests/venv/bin
                                 /usr/lib64/python36.zip
                                 /usr/lib64/python3.6
                                 /usr/lib64/python3.6/lib-dynload
                                 /media/workspace/APPNAME/tests/venv/lib64/python3.6/site-packages
                                 /media/workspace/APPNAME/tests/venv/lib/python3.6/site-packages
                    environment: PYENV_ROOT = /home/developer/.pyenv
                                 PYENV_SHELL = zsh
                                 PYENV_VIRTUALENV_INIT = 1
                   command_line: /media/workspace/APPNAME/tests/venv/bin/coverage debug sys
                sqlite3_version: 2.6.0
         sqlite3_sqlite_version: 3.7.17
  1. What versions of what packages do you have installed? The output of pip freeze is helpful.
beautifulsoup4==4.8.2
bottle==0.12.18
coverage==5.0.2
entrypoints==0.3
flake8==3.7.9
liblpm==0.0.4
mccabe==0.6.1
mysqlclient==1.4.6
nose==1.3.7
pycodestyle==2.5.0
pyflakes==2.1.1
six==1.13.0
soupsieve==1.9.5
SQLAlchemy==1.3.12
waitress==1.4.2
WebOb==1.8.5
WebTest==2.0.33
  1. What code are you running? Give us a specific commit of a specific repo that we can check out.
    I cannot provide a repo, sorry. It's not an open source project.

  2. What commands did you run?
    python3 -m "nose" --with-coverage --cover-erase --cover-html -s -w unit -v

Expected behavior
An error shouldn't be thrown.

Additional context
It's fine on 5.0.1, just broken on 5.0.2.

@kura kura added the bug Something isn't working label Jan 9, 2020
@kura kura changed the title coverage.misc.CoverageException: Couldn't use data file '/media/workspace/APPNAME/tests/.coverage': no such table: meta coverage.misc.CoverageException: Couldn't use data file '.../coverage': no such table: meta Jan 9, 2020
@kura kura changed the title coverage.misc.CoverageException: Couldn't use data file '.../coverage': no such table: meta coverage.misc.CoverageException: Couldn't use data file '../.coverage': no such table: meta Jan 9, 2020
@kura kura changed the title coverage.misc.CoverageException: Couldn't use data file '../.coverage': no such table: meta coverage.misc.CoverageException: Couldn't use data file '.coverage': no such table: meta Jan 9, 2020
@kura kura changed the title coverage.misc.CoverageException: Couldn't use data file '.coverage': no such table: meta sqlite3.OperationalError: no such table: meta Jan 9, 2020
@13steinj
Copy link

13steinj commented Jan 9, 2020

Issue also occurring with Py2.7 (yes, I know it's EoL, but with the release in April I won't get the green light to upgrade until March at minimum).

@13steinj
Copy link

13steinj commented Jan 9, 2020

Some investigation: The table meta is indeed there, at least for me. Or at least, if I open up the file in sqlite3 I can see meta as one of the tables, and it does indeed have data, and it is accessible from Python via the sqlite3 package. E: Fix mentioned in #916

@nedbat
Copy link
Owner

nedbat commented Jan 9, 2020

I believe this is the problem reported in #916, and since fixed on master. Can you try that fix? Please re-open this issue if it isn't solved.

@nedbat nedbat closed this as completed Jan 9, 2020
@nedbat nedbat added this to the 5.0.3 milestone Jan 9, 2020
@nedbat nedbat added the duplicate This issue or pull request already exists label Jan 9, 2020
@nedbat
Copy link
Owner

nedbat commented Jan 12, 2020

This is now available in 5.0.3: https://pypi.org/project/coverage/5.0.3/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants