# "RepeatingFeed requires a database connection" error with prodigy 1.10.4

**URL:** https://support.prodi.gy/t/repeatingfeed-requires-a-database-connection-error-with-prodigy-1-10-4/3490
**Category:** Uncategorized
**Tags:** solved, database
**Created:** [October 6, 2020, 7:31pm UTC](https://support.prodi.gy/t/repeatingfeed-requires-a-database-connection-error-with-prodigy-1-10-4/3490 "2020-10-06T19:31:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![darya](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/darya/32/1625_2.png) [@darya](https://support.prodi.gy/u/darya)
#### Post date: [October 6, 2020, 7:31pm UTC](https://support.prodi.gy/t/repeatingfeed-requires-a-database-connection-error-with-prodigy-1-10-4/3490/1 "2020-10-06T19:31:45Z")

</div>

I have a recipe that used to work with previous prodigy version (1.9 something). It looks like this:

```python
import prodigy
from playhouse.postgres_ext import PostgresqlExtDatabase
from prodigy.components.db import Database
from prodigy.recipes.generic import mark
import config

db = PostgresqlExtDatabase(**config.PRODIGY_DB)
prodigy_db = Database(db, "postgresql", "custom_pg")

@prodigy.recipe("vad",
                dataset=('Dataset name to save annotations to', 'positional', None, str),
                file_path=("Path to wav files", "positional", None, str)
                )
def vad(dataset, file_path):
    components = mark(dataset, file_path, label=config.task_labels, loader='audio-server', view_id='audio_manual')
    components["db"] = prodigy_db
    components["config"]["exclude_by"] = "input"
    components["config"]["batch_size"] = config.batch_size
    return components

```

We've just updated to prodigy 1.10.4, and this recipe now gives a `AssertionError: RepeatingFeed requires a database connection.` error on `/get_session_questions`.

I've seen a similar problem in another topic [Losing samples on browser refresh](https://support.prodi.gy/t/losing-samples-on-browser-refresh/3450/4), but there it seems to work sometimes (with `force_stream` set to `False`), while in my case it doesn't work at all.

I tried the solution @ines suggested in topic [https://support.prodi.gy/t/losing-samples-on-browser-refresh/3450/4:](https://support.prodi.gy/t/losing-samples-on-browser-refresh/3450/4:)

```python
from prodigy.util import registry

db = PostgresqlExtDatabase(...) # etc.
registry.databases("custom_postgres", func=db)

```

but it results in another error:

```python
Traceback (most recent call last):
        File "/../../.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
          " __main__", mod_spec)
        File "/../../.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 85, in _run_code
          exec(code, run_globals)
        File "/../../.pyenv/versions/prodigy/lib/python3.7/site-packages/prodigy/ __main__.py", line 60, in <module>
          controller = recipe(*args, use_plac=True)
        File "cython_src/prodigy/core.pyx", line 327, in prodigy.core.recipe.recipe_decorator.recipe_proxy
        File "cython_src/prodigy/core.pyx", line 116, in prodigy.core.Controller. __init__
        File "cython_src/prodigy/core.pyx", line 285, in prodigy.core.Controller.connect_db
      TypeError: argument of type 'PostgresqlExtDatabase' is not iterable

```

---

<div class="post-metadata">

### Author: ![darya](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/darya/32/1625_2.png) [@darya](https://support.prodi.gy/u/darya)
#### Post date: [October 6, 2020, 8:00pm UTC](https://support.prodi.gy/t/repeatingfeed-requires-a-database-connection-error-with-prodigy-1-10-4/3490/3 "2020-10-06T20:00:33Z")

</div>

UPDATE:

I probably made a typo when I was first testing `force_stream_order` solution.  
It does work for me if it's set to False without typos 😄

```python
    components["config"]["force_stream_order"] = False

```

---

<div class="post-metadata">

### Author: ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)
#### Post date: [October 7, 2020, 8:27am UTC](https://support.prodi.gy/t/repeatingfeed-requires-a-database-connection-error-with-prodigy-1-10-4/3490/4 "2020-10-07T08:27:01Z")

</div>

Thanks for the update and glad to hear it worked! 🙂

Btw, I also just realised that I forgot a line in the proposed solution to register the DB: the database needs to be a Prodigy `Database` object as [shown here](https://prodi.gy/docs/api-database#init) so there's just one line missing that calls `Database around it` 🤦‍♀️

```python
psql_db = PostgresqlExtDatabase(...)
db = Database(psql_db, "custom_postgres", "Custom PostgreSQL Database")
registry.databases("custom_postgres", func=db)

```
