# General error: 1 no such table: sqlite\_sequence

**URL:** <https://discourse.cakephp.org/t/general-error-1-no-such-table-sqlite-sequence/7819>\
**Category:** Testing\
**Created:** [May 15, 2020, 1:58am UTC](https://discourse.cakephp.org/t/general-error-1-no-such-table-sqlite-sequence/7819 "2020-05-15T01:58:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [May 15, 2020, 1:58am UTC](https://discourse.cakephp.org/t/general-error-1-no-such-table-sqlite-sequence/7819/1 "2020-05-15T01:58:47Z")

</div>

[Editied for clarity]

Lured by the elegance of [cakephp-fixture-factories](https://github.com/pakacuda/cakephp-fixture-factories) which was demo’d at the recent meetup, I did the install today.

…and ran afoul of

```auto
Exception: SQLSTATE[HY000]: 
General error:
1 no such table: sqlite_sequence
In [...cakephp/cakephp/src/Database/Driver/Sqlite.php, line 120]

```

> **Full output of test attempt**
>
> ```auto
> Testing started at 6:24 PM ...
> /usr/local/Cellar/php/7.3.9_1/bin/php 
> /Library/WebServer/Documents/ampfg4/vendor/phpunit/phpunit/phpunit 
> --configuration /Library/WebServer/Documents/ampfg4/phpunit.xml.dist 
> /Library/WebServer/Documents/ampfg4/tests --teamcity
> PHPUnit 8.5.4 by Sebastian Bergmann and contributors.
> 
> Exception: SQLSTATE[HY000]: General error: 1 no such table: sqlite_sequence
> In [/Library/WebServer/Documents/ampfg4/vendor/cakephp/cakephp/src/Database/Driver/Sqlite.php, line 120]
> 
> Process finished with exit code 1
> 
> ```

The installation instructions state explicitly “the fixtures will be created in the test database(s) defined in your [configuration](https://book.cakephp.org/4/en/development/testing.html#test-database-setup).”

My test configuration performs as expected prior to plugin install.

I’ve traced the error to the addition of a Listener in phpunit.xml. This listener is a required part of the installation of the fixture plugin. I left the original Cake listeners in place too (as allowed by the installation instructions).

```auto
<listener class="CakephpFixtureFactories\TestSuite\FixtureInjector">
    <arguments>
        <object class="CakephpFixtureFactories\TestSuite\FixtureManager" />
    </arguments>
</listener>

```

> **Full phpunit xml**
>
> ```auto
> <?xml version="1.0" encoding="UTF-8"?>
> <phpunit
> colors="true"
> processIsolation="false"
> stopOnFailure="false"
> bootstrap="tests/bootstrap.php"
> >
> <php>
> <ini name="memory_limit" value="-1"/>
> <ini name="apc.enable_cli" value="1"/>
> </php>
> 
> <!-- Add any additional test suites you want to run here -->
> <testsuites>
> <testsuite name="app">
> <directory>tests/TestCase/</directory>
> </testsuite>
> <!-- Add plugin test suites here. -->
> </testsuites>
> 
> <!-- Setup a listener for fixtures -->
> <listeners>
> <listener class="CakephpFixtureFactories\TestSuite\FixtureInjector">
> <arguments>
> <object class="CakephpFixtureFactories\TestSuite\FixtureManager" />
> </arguments>
> </listener>
> <listener class="Cake\TestSuite\Fixture\FixtureInjector">
> <arguments>
> <object class="Cake\TestSuite\Fixture\FixtureManager"/>
> </arguments>
> </listener>
> </listeners>
> 
> <!-- Ignore vendor tests in code coverage reports -->
> <filter>
> <whitelist>
> <directory suffix=".php">src/</directory>
> <directory suffix=".php">plugins/*/src/</directory>
> <exclude>
> <file>src/Console/Installer.php</file>
> </exclude>
> </whitelist>
> </filter>
> </phpunit>
> 
> ```

So it seems like there is something else I should be doing in the setup… But I’m out past the boundaries of my knowledge and into follow-directions-and-guess territory.

I did see some stuff around the web about tmp directory permissions and sqlite but fiddling with that has not got me working yet…

---

<div class="post-metadata">

**Author:** ![pabloelcolombiano](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/pabloelcolombiano/32/2095_2.png) [@pabloelcolombiano](https://discourse.cakephp.org/u/pabloelcolombiano)\
**Post date:** [June 1, 2020, 4:40am UTC](https://discourse.cakephp.org/t/general-error-1-no-such-table-sqlite-sequence/7819/2 "2020-06-01T04:40:26Z")

</div>

Hi,

continuing our discussion, I found where the Sqlite error came from. Though you are working on a MySQL DB, I could like you, find no reason why an Sqlite error should show up.

In your test/bootstrap.php, you probably have that piece of code, which come from the CakePHP skeleton.

```auto
// But since PagesControllerTest is run with debug enabled and DebugKit is loaded
// in application, without setting up these config DebugKit errors out.
ConnectionManager::setConfig('test_debug_kit', [
    'className' => 'Cake\Database\Connection',
    'driver' => 'Cake\Database\Driver\Sqlite',
    'database' => TMP . 'debug_kit.sqlite',
    'encoding' => 'utf8',
    'cacheMetadata' => true,
    'quoteIdentifiers' => false,
]);

ConnectionManager::alias('test_debug_kit', 'debug_kit');

```

I have amended the package in order to handle that case.
