Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: "key: expected bytes or bytearray, but got 'NoneType'" #4517

Open
1 task done
fuwaking opened this issue Jan 17, 2025 · 0 comments
Open
1 task done

[Bug]: "key: expected bytes or bytearray, but got 'NoneType'" #4517

fuwaking opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@fuwaking
Copy link

Is there an existing issue for the same bug?

  • I have checked the existing issues.

RAGFlow workspace code commit ID

i don't know how to get th commit ID

RAGFlow image version

v0.15.1

Other environment information

CPU:intel i7 11850h
memory:32G
os:synology(群晖)

Actual behavior

注册后无法正常登录,出现以下错误提示:“key: expected bytes or bytearray, but got 'NoneType'”

错误日志如下:

ypeError: key: expected bytes or bytearray, but got 'NoneType'

2025/01/17 13:18:57 | stderr | raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).name)
2025/01/17 13:18:57 | stderr | File "/usr/lib/python3.10/hmac.py", line 53, in init
2025/01/17 13:18:57 | stderr | return HMAC(key, msg, digestmod)
2025/01/17 13:18:57 | stderr | File "/usr/lib/python3.10/hmac.py", line 184, in new
2025/01/17 13:18:57 | stderr | return hmac.new(key, payload.encode("utf-8"), sha512).hexdigest()
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 380, in _cookie_digest
2025/01/17 13:18:57 | stderr | if hmac.compare_digest(_cookie_digest(payload, key=key), digest):
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 62, in decode_cookie
2025/01/17 13:18:57 | stderr | user_id = decode_cookie(cookie)
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/login_manager.py", line 414, in _load_user_from_remember_cookie
2025/01/17 13:18:57 | stderr | user = self._load_user_from_remember_cookie(cookie)
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/login_manager.py", line 376, in _load_user
2025/01/17 13:18:57 | stderr | current_app.login_manager._load_user()
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 370, in _get_user
2025/01/17 13:18:57 | stderr | current_user = LocalProxy(lambda: _get_user())
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 25, in 
2025/01/17 13:18:57 | stderr | return get_name(local())
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/werkzeug/local.py", line 526, in _get_current_object
2025/01/17 13:18:57 | stderr | obj = instance._get_current_object()
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/werkzeug/local.py", line 318, in get
2025/01/17 13:18:57 | stderr | elif not current_user.is_authenticated:
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 284, in decorated_view
2025/01/17 13:18:57 | stderr | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
2025/01/17 13:18:57 | stderr | rv = self.dispatch_request()
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
2025/01/17 13:18:57 | stderr | Traceback (most recent call last):
2025/01/17 13:18:57 | stderr | 2025-01-17 13:18:57,962 ERROR    22 key: expected bytes or bytearray, but got 'NoneType'
2025/01/17 13:18:57 | stderr | TypeError: key: expected bytes or bytearray, but got 'NoneType'
2025/01/17 13:18:57 | stderr | raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).name)
2025/01/17 13:18:57 | stderr | File "/usr/lib/python3.10/hmac.py", line 53, in init
2025/01/17 13:18:57 | stderr | return HMAC(key, msg, digestmod)
2025/01/17 13:18:57 | stderr | File "/usr/lib/python3.10/hmac.py", line 184, in new
2025/01/17 13:18:57 | stderr | return hmac.new(key, payload.encode("utf-8"), sha512).hexdigest()
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 380, in _cookie_digest
2025/01/17 13:18:57 | stderr | if hmac.compare_digest(_cookie_digest(payload, key=key), digest):
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 62, in decode_cookie
2025/01/17 13:18:57 | stderr | user_id = decode_cookie(cookie)
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/login_manager.py", line 414, in _load_user_from_remember_cookie
2025/01/17 13:18:57 | stderr | user = self._load_user_from_remember_cookie(cookie)
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/login_manager.py", line 376, in _load_user
2025/01/17 13:18:57 | stderr | current_app.login_manager._load_user()
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 370, in _get_user
2025/01/17 13:18:57 | stderr | current_user = LocalProxy(lambda: _get_user())
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 25, in 
2025/01/17 13:18:57 | stderr | return get_name(local())
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/werkzeug/local.py", line 526, in _get_current_object
2025/01/17 13:18:57 | stderr | obj = instance._get_current_object()
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/werkzeug/local.py", line 318, in get
2025/01/17 13:18:57 | stderr | elif not current_user.is_authenticated:
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask_login/utils.py", line 284, in decorated_view
2025/01/17 13:18:57 | stderr | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
2025/01/17 13:18:57 | stderr | rv = self.dispatch_request()
2025/01/17 13:18:57 | stderr | File "/ragflow/.venv/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
2025/01/17 13:18:57 | stderr | Traceback (most recent call last):
2025/01/17 13:18:57 | stderr | 2025-01-17 13:18:57,961 ERROR    22 key: expected bytes or bytearray, but got 'NoneType'

Expected behavior

No response

Steps to reproduce

docker compose -f docker-compose-base.yml -f docker-compose.yml up -d

Additional information

“key: expected bytes or bytearray, but got 'NoneType'”

@fuwaking fuwaking added the bug Something isn't working label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant