How do you fix this mistake?
CPython 3.8.1
celery 4.4.0
pymongo 3.10.1
stacktrace:
KeyError: 'collection'
File "kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: 'database'
File "kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
OperationFailure: Authentication failed.
File "billiard/pool.py", line 1791, in safe_apply_callback
fun(*args, **kwargs)
File "celery/worker/request.py", line 526, in on_failure
self.task.backend.mark_as_failure(
File "celery/backends/base.py", line 159, in mark_as_failure
self.store_result(task_id, exc, state,
File "celery/backends/base.py", line 406, in store_result
self._store_result(task_id, result, state, traceback,
File "celery/backends/mongodb.py", line 194, in _store_result
self.collection.replace_one({'_id': task_id}, meta, upsert=True)
File "kombu/utils/objects.py", line 44, in __get__
value = obj.__dict__[self.__name__] = self.__get(obj)
File "celery/backends/mongodb.py", line 291, in collection
collection = self.database[self.taskmeta_collection]
File "kombu/utils/objects.py", line 44, in __get__
value = obj.__dict__[self.__name__] = self.__get(obj)
File "celery/backends/mongodb.py", line 286, in database
return self._get_database()
File "celery/backends/mongodb.py", line 275, in _get_database
if not db.authenticate(self.user, self.password, source=source):
File "pymongo/database.py", line 1468, in authenticate
self.client._cache_credentials(
File "pymongo/mongo_client.py", line 754, in _cache_credentials
with server.get_socket(all_credentials) as sock_info:
File "contextlib.py", line 113, in __enter__
return next(self.gen)
File "pymongo/pool.py", line 1138, in get_socket
sock_info.check_auth(all_credentials)
File "pymongo/pool.py", line 712, in check_auth
auth.authenticate(credentials, self)
File "pymongo/auth.py", line 564, in authenticate
auth_func(credentials, sock_info)
File "pymongo/auth.py", line 539, in _authenticate_default
return _authenticate_scram(credentials, sock_info, 'SCRAM-SHA-1')
File "pymongo/auth.py", line 263, in _authenticate_scram
res = sock_info.command(source, cmd)
File "pymongo/pool.py", line 603, in command
return command(self.sock, dbname, spec, slave_ok,
File "pymongo/network.py", line 165, in command
helpers._check_command_response(
File "pymongo/helpers.py", line 159, in _check_command_response
raise OperationFailure(msg % errmsg, code, response)