When starting flower, I get the following: "dbm.error: db type is dbm.gnu, but the module is not available"
Asked Answered
B

1

1

I am currently trying to setup a Python monitoring tool, called Flower, to check whether tasks are being successfully processed. Currently this is my setup is as follows:

  • ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-1044-aws x86_64)
  • python 3.6.7
  • celery 4.3.0
  • flower 0.9.3
  • redis 5.0.5 (broker for celery)

When I start flower via the command line

flower -A celery_app --broker='redis://:PASSWORD@redis-endpoint:6379/2' --broker_api='redis://:PASSWORD@redis-endpoint:6379/2'

I get the following error: dbm.error: db type is dbm.gnu, but the module is not available

Full error message:

>     flower   -> flower:0.9.3 tornado:5.1.1 babel:2.5.0
>     software -> celery:4.3.0 (rhubarb) kombu:4.6.3 py:3.6.7
>                 billiard:3.6.0.0 redis:3.3.6
>     platform -> system:Linux arch:64bit
>                 kernel version:4.15.0-1044-aws imp:CPython
>     loader   -> celery.loaders.app.AppLoader
>     settings -> transport:redis results:disabled
>     
>     
>     
>     Traceback (most recent call last):
>       File "/dir/venv/bin/flower", line 10, in <module>
>         sys.exit(main())
>       File "/dir/venv/lib/python3.6/site-packages/flower/__main__.py",
> line 11, in main
>         flower.execute_from_commandline()
>       File "/dir/venv/lib/python3.6/site-packages/celery/bin/base.py",
> line 298, in execute_from_commandline
>         return self.handle_argv(self.prog_name, argv[1:])
>       File "/dir/venv/lib/python3.6/site-packages/flower/command.py",
> line 56, in handle_argv
>         return self.run_from_argv(prog_name, argv)
>       File "/dir/venv/lib/python3.6/site-packages/flower/command.py",
> line 40, in run_from_argv
>         flower = Flower(capp=self.app, options=options, **settings)
>       File "/dir/venv/lib/python3.6/site-packages/flower/app.py",
> line 42, in __init__
>         max_tasks_in_memory=self.options.max_tasks)
>       File "/dir/venv/lib/python3.6/site-packages/flower/events.py",
> line 79, in __init__
>         state = shelve.open(self.db)
>       File "/dir/.pyenv/versions/3.6.7/lib/python3.6/shelve.py", line 243,
> in open
>         return DbfilenameShelf(filename, flag, protocol, writeback)
>       File "/dir/.pyenv/versions/3.6.7/lib/python3.6/shelve.py", line 227,
> in __init__
>         Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
>       File "/dir/.pyenv/versions/3.6.7/lib/python3.6/dbm/__init__.py",
> line 91, in open
>         "available".format(result))
>     dbm.error: db type is dbm.gnu, but the module is not available

I also tried installing sudo apt-get python3-gdbm but it did not help with my problem.

Brakesman answered 9/8, 2019 at 18:37 Comment(0)
F
2

In case someone else face this error. It is problem with pyenv. Even after

sudo apt-get install python3-gdbm

the library will be installed in the system, but not in the pyenv. So the solution described here:

GDBM doesn't work with Python 3.6 and anaconda

The steps will be the same for pyenv.

Forgetmenot answered 25/3, 2021 at 10:53 Comment(1)
solved my problem under debian bulleyes and python 3.9 ; thanksBizerte

© 2022 - 2024 — McMap. All rights reserved.