Flower: Container built from Dockerfile fails on startup

Created on 8 Mar 2018  路  6Comments  路  Source: mher/flower

When attempting to run Flower in a Docker container using the provided Dockerfile, the container fails on startup. I get the following stack trace:

Traceback (most recent call last):
  File "/usr/local/bin/flower", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/flower/__main__.py", line 11, in main
    flower.execute_from_commandline()
  File "/usr/local/lib/python3.6/site-packages/celery/bin/base.py", line 281, in execute_from_commandline
    return self.handle_argv(self.prog_name, argv[1:])
  File "/usr/local/lib/python3.6/site-packages/flower/command.py", line 59, in handle_argv
    return self.run_from_argv(prog_name, argv)
  File "/usr/local/lib/python3.6/site-packages/flower/command.py", line 43, in run_from_argv
    flower = Flower(capp=self.app, options=options, **settings)
  File "/usr/local/lib/python3.6/site-packages/flower/app.py", line 42, in __init__
    max_tasks_in_memory=self.options.max_tasks)
  File "/usr/local/lib/python3.6/site-packages/flower/events.py", line 77, in __init__
    state = shelve.open(self.db)
  File "/usr/local/lib/python3.6/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/usr/local/lib/python3.6/shelve.py", line 227, in __init__
    Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
  File "/usr/local/lib/python3.6/dbm/__init__.py", line 94, in open
    return mod.open(file, flag, mode)
_gdbm.error: [Errno 13] Permission denied

I figured this was because the flower process was running with restricted access privileges. When I remove the following line in the Dockerfile, it works without any issues:

USER nobody
docker

Most helpful comment

@fropert solution is update https://github.com/mher/flower/blob/master/Dockerfile#L18 and stop using nobody user, because it does not have system permissions to create files, such a flower.db.

All 6 comments

The same error is returned with --persistent=True

@fropert : Is there a solution for this error with the persistent=True flag ?

@fropert solution is update https://github.com/mher/flower/blob/master/Dockerfile#L18 and stop using nobody user, because it does not have system permissions to create files, such a flower.db.

I am still getting the same issue with the latest version

I am still getting the same issue with the latest version

command: ["flower", "--broker=redis://:seismic@redis:6379/0", "--basic_auth=petrec:seismic", "--port=5555", "--persistent=True"]

_gdbm.error: [Errno 13] Permission denied: 'flower'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Darkheir picture Darkheir  路  3Comments

lukik picture lukik  路  6Comments

pnijhara picture pnijhara  路  3Comments

vahdani picture vahdani  路  5Comments

mtahirtariq picture mtahirtariq  路  7Comments