Open thehuze opened 3 days ago
$marzban-cli user list
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /code/cli/user.py:41 in list_users │
│ │
│ 38 │ │ │ │ "ID", "Username", "Status", "Used traffic", │
│ 39 │ │ │ │ "Data limit", "Reset strategy", "Expires at", "Owner", │
│ 40 │ │ │ ), │
│ ❱ 41 │ │ │ rows=[ │
│ 42 │ │ │ │ ( │
│ 43 │ │ │ │ │ str(user.id), │
│ 44 │ │ │ │ │ user.username, │
│ │
│ ╭─────────────────────────────── locals ───────────────────────────────╮ │
│ │ admins = [] │ │
│ │ db = <sqlalchemy.orm.session.Session object at 0x7172767db2e0> │ │
│ │ limit = None │ │
│ │ offset = None │ │
│ │ search = None │ │
│ │ status = None │ │
│ │ username = [] │ │
│ │ users = [ │ │
│ │ │ <app.db.models.User object at 0x7172766d0670>, │ │
│ │ │ <app.db.models.User object at 0x7172766d0940>, │ │
│ │ │ <app.db.models.User object at 0x7172766d09d0>, │ │
│ │ │ <app.db.models.User object at 0x7172766d0a30>, │ │
│ │ │ <app.db.models.User object at 0x7172766d0a90> │ │
│ │ ] │ │
│ ╰──────────────────────────────────────────────────────────────────────╯ │
│ │
│ /code/cli/user.py:49 in <listcomp> │
│ │
│ 46 │ │ │ │ │ readable_size(user.used_traffic), │
│ 47 │ │ │ │ │ readable_size(user.data_limit) if user.data_limit else "Unlimited", │
│ 48 │ │ │ │ │ user.data_limit_reset_strategy.value, │
│ ❱ 49 │ │ │ │ │ utils.readable_datetime(user.expire, include_time=False), │
│ 50 │ │ │ │ │ user.admin.username if user.admin else '' │
│ 51 │ │ │ │ ) │
│ 52 │ │ │ │ for user in users │
│ │
│ ╭─────────────────────── locals ───────────────────────╮ │
│ │ .0 = <list_iterator object at 0x7172767db130> │ │
│ │ user = <app.db.models.User object at 0x7172766d09d0> │ │
│ ╰──────────────────────────────────────────────────────╯ │
│ │
│ /code/cli/utils.py:85 in readable_datetime │
│ │
│ 82 │ │ return dt_format │
│ 83 │ │
│ 84 │ if isinstance(date_time, int): │
│ ❱ 85 │ │ date_time = datetime.fromtimestamp(date_time) │
│ 86 │ │
│ 87 │ return date_time.strftime(get_datetime_format()) if date_time else "-" │
│ 88 │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ date_time = 1730155373016 │ │
│ │ get_datetime_format = <function readable_datetime.<locals>.get_datetime_format at │ │
│ │ 0x7172766828c0> │ │
│ │ include_date = True │ │
│ │ include_time = False │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: year 56796 is out of range
Send json
Describe the bug I use API to manage users. After executing POST
/api/user
, all tries to get created user / all users return to me 500 HTTP. Viewing logs, seems like i send incorrect unix timestamps for fieldsexpire
/on_hold_timeout
. (logs below)My user has random generated
username
, so now i unable to delete this user (cuz i dont know his name) and i unable get all my users.To Reproduce Steps to reproduce the behavior:
expire
/on_hold_timeout
in timestamp is msExpected behavior I suggest add these fixes:
Screenshots
Machine details (please complete the following information):