CTFd / CTFd

CTFs as you need them

Home Page:https://ctfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python error when accessing account info from admin panel

Yatodak opened this issue · comments

Environment:

  • CTFd Version/Commit: CTFd 3.6.0
  • Operating System: Ubuntu 22.04
  • Web Browser and Version:
    Python 3.10.12
    Opera
    Gunicorn (version 20.1.0)
    mariadb Ver 15.1 Distrib 10.6.12-MariaDB

What happened?
When going to admin panel on users list, when clicking on an account the site take a long time loading

What did you expect to happen?
Page to be displayed instantly

How to reproduce your issue
start a 3.6.0 CTFd instance in ubuntu 22.04 with all dependencies fullfilled (with requirements.txt)
launching with gunicorn, command used : gunicorn --bind 0.0.0.0:8000 -t 50 -w 4 "CTFd:create_app()"

do initial setup, create another user, connect as admin and try to access user info in the admin panel

Any associated stack traces or error logs
log from gunicorn :
[2023-11-30 16:57:15 +0000] [49519] [ERROR] Error handling request Nov 30 16:57:15 ctf-demo gunicorn[49519]: Traceback (most recent call last): Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3/dist-packages/gunicorn/workers/sync.py", line 182, in handle_request Nov 30 16:57:15 ctf-demo gunicorn[49519]: resp.write_file(respiter) Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3/dist-packages/gunicorn/http/wsgi.py", line 385, in write_file Nov 30 16:57:15 ctf-demo gunicorn[49519]: if not self.sendfile(respiter): Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3/dist-packages/gunicorn/http/wsgi.py", line 375, in sendfile Nov 30 16:57:15 ctf-demo gunicorn[49519]: self.sock.sendfile(respiter.filelike, count=nbytes) Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3.10/socket.py", line 484, in sendfile Nov 30 16:57:15 ctf-demo gunicorn[49519]: return self._sendfile_use_sendfile(file, offset, count) Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3.10/socket.py", line 348, in _sendfile_use_sendfile Nov 30 16:57:15 ctf-demo gunicorn[49519]: self._check_sendfile_params(file, offset, count) Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3.10/socket.py", line 462, in _check_sendfile_params Nov 30 16:57:15 ctf-demo gunicorn[49519]: raise ValueError( Nov 30 16:57:15 ctf-demo gunicorn[49519]: ValueError: count must be a positive integer (got 0) Nov 30 16:57:15 ctf-demo gunicorn[49519]: [2023-11-30 16:57:15 +0000] [49519] [ERROR] Error handling request Nov 30 16:57:15 ctf-demo gunicorn[49519]: Traceback (most recent call last): Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3/dist-packages/gunicorn/workers/sync.py", line 182, in handle_request Nov 30 16:57:15 ctf-demo gunicorn[49519]: resp.write_file(respiter) Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3/dist-packages/gunicorn/http/wsgi.py", line 385, in write_file Nov 30 16:57:15 ctf-demo gunicorn[49519]: if not self.sendfile(respiter): Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3/dist-packages/gunicorn/http/wsgi.py", line 375, in sendfile Nov 30 16:57:15 ctf-demo gunicorn[49519]: self.sock.sendfile(respiter.filelike, count=nbytes) Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3.10/socket.py", line 484, in sendfile Nov 30 16:57:15 ctf-demo gunicorn[49519]: return self._sendfile_use_sendfile(file, offset, count) Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3.10/socket.py", line 348, in _sendfile_use_sendfile Nov 30 16:57:15 ctf-demo gunicorn[49519]: self._check_sendfile_params(file, offset, count) Nov 30 16:57:15 ctf-demo gunicorn[49519]: File "/usr/lib/python3.10/socket.py", line 462, in _check_sendfile_params Nov 30 16:57:15 ctf-demo gunicorn[49519]: raise ValueError( Nov 30 16:57:15 ctf-demo gunicorn[49519]: ValueError: count must be a positive integer (got 0)

if any other info is necessary please tell me i'll get them asap

thanks in advance

EDIT :

After more navigation in admin panel, there is some other pages that have the same error in log, seems like it's related pages where database info is displayed

I'm facing the same issue as described. Can you share how you solved it?