HUE desktop_document_cleanup failed

Hello
I’m trying to clean the HUE database with the command ‘sudo /opt/application/hue/current/build/env/bin/hue desktop_document_cleanup’ and I get the following error:

Traceback (most recent call last):
File “/opt/application/hue/current/build/env/bin/hue”, line 11, in
load_entry_point(‘desktop’, ‘console_scripts’, ‘hue’)()
File “/opt/application/hue/4.6.0/desktop/core/src/desktop/manage_entry.py”, line 225, in entry
execute_from_command_line(sys.argv)
File “/opt/application/hue/4.6.0/build/env/local/lib/python2.7/site-packages/Django-1.11.22-py2.7.egg/django/core/management/init.py”, line 364, in execute_from_command_line
utility.execute()
File “/opt/application/hue/4.6.0/build/env/local/lib/python2.7/site-packages/Django-1.11.22-py2.7.egg/django/core/management/init.py”, line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/opt/application/hue/4.6.0/build/env/local/lib/python2.7/site-packages/Django-1.11.22-py2.7.egg/django/core/management/base.py”, line 283, in run_from_argv
self.execute(*args, **cmd_options)
File “/opt/application/hue/4.6.0/build/env/local/lib/python2.7/site-packages/Django-1.11.22-py2.7.egg/django/core/management/base.py”, line 330, in execute
output = self.handle(*args, **options)
File “/opt/application/hue/4.6.0/desktop/core/src/desktop/management/commands/desktop_document_cleanup.py”, line 115, in handle
LOG.warn(“HUE_CONF_DIR: %s” % os.environ[‘HUE_CONF_DIR’])
File “/opt/application/hue/4.6.0/build/env/lib/python2.7/UserDict.py”, line 40, in getitem
raise KeyError(key)
KeyError: ‘HUE_CONF_DIR’

It seems to be due to the variable HUE_CONF_DIR.
Do I have to set this variable before ? If yes, with which value ?
Thanks in advance for your help

tried with the set of the env var HUE_CONF_DIR before, but there’s no result of the clean !

export HUE_CONF_DIR=/opt/application/hue/4.6.0/desktop/conf
echo $HUE_CONF_DIR
/opt/application/hue/current/build/env/bin/hue desktop_document_cleanup

Have you tried with the option?

--keep-days KEEP_DAYS
                        Number of days of history data to keep.