mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #6990] [Bug]: Telegram bot (v3.11.0): "Ban log" no longer sends the current 3xipl-banned.log #4609
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4609
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yukh975 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6990
Describe the bug
Since v3.11.0 (the bot rewrite in #6760) the admin's 📄 Ban log button only sends
3xipl-banned.prev.log. The current3xipl-banned.logis no longer sent.In v3.10.2,
sendBanLogs(tgbot_report.go) sent both files: prev, then current. In v3.11.0,sendBanLogsFile(internal/web/service/tgbot/screen_views.go) opens onlyxray.GetIPLimitBannedPrevLogPath().ClearLogsJobrotates current → prev only@daily, so bans from the current day are invisible in the bot until the next rotation.A second, smaller regression in the same function: the old code skipped an empty file. The new code passes it straight to
SendDocument. Telegram rejects empty documents, so when the prev log exists but is empty the admin gets only the Hostname/DateTime notice. No file arrives and no "No results" reply is sent; only aFailed to upload the ban logwarning is logged.The commit message of #6760 does not mention either change, so I assume both are unintentional.
How to reproduce the problem
3xipl-banned.log).Expected behavior
As in v3.10.2: both
3xipl-banned.prev.logand3xipl-banned.logare sent, empty files are skipped, and "No results" is shown when there is nothing to send.Actual behavior
Only
3xipl-banned.prev.logis sent. When that file is empty, nothing is sent and the admin gets no reply.3x-ui version
v3.11.0
Which parts of the panel are affected?
Telegram bot
@github-actions[bot] commented on GitHub (Oct 28, 2026):
You're right on both points. Since v3.11.0 the bot's 📄 Ban log button only sends
3xipl-banned.prev.log, so today's bans don't show up until the@dailyrotation runs. It also no longer skips an empty file. The bot rewrite in #6760 lost both behaviours, and both are still present on the default branch.Until it's fixed, the current file is still readable on the server with
x-ui banlog(x-ui.sh:99points it at${log_folder}/3xipl-banned.log), or withcat /var/log/x-ui/3xipl-banned.log.One correction to the expected behaviour you describe: v3.10.2 never sent "No results" when both files were empty. It logged a warning per file and sent only the Hostname/DateTime message. The "No results" notice in v3.11.0 is new, and it only appears when the prev file can't be opened at all.
Suggested fix: in
sendBanLogsFile, loop overGetIPLimitBannedPrevLogPath()andGetIPLimitBannedLogPath(), in that order. Skip any file that can't be opened or has size 0, and sendtgbot.noResultonly if neither file was uploaded. That fixes both regressions in their only caller.This reply was generated automatically; a maintainer may follow up.