mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5911] [Question]: how delete remained deleted client log #4098
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#4098
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 @sajadfaith on GitHub (Jul 12, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5911
What are you trying to do?
I see warning log about not found client in master panel and these client are not in master or any of nodes and these are deleted client how can clean my database from this warning? (database postgre)
2026/07/12 20:56:02 WARNING - X-UI: [GET /3v2cwgF7R1i2CwyiDC/panel/api/clients/get/leon_4214084 handler=controller.(*ClientController).get client.go:112] Failed: record not found
2026/07/12 20:56:02 ERROR - X-UI: Failed to localize message: message "get" not found in language "en-US"
2026/07/12 20:56:02 WARNING - X-UI: [GET /3v2cwgF7R1i2CwyiDC/panel/api/clients/get/shayan_1869610 handler=controller.(*ClientController).get client.go:112] Failed: record not found
2026/07/12 20:56:02 ERROR - X-UI: Failed to localize message: message "get" not found in language "en-US"
2026/07/12 20:55:02 WARNING - X-UI: [GET /3v2cwgF7R1i2CwyiDC/panel/api/clients/get/210571524_ae43 handler=controller.(*ClientController).get client.go:112] Failed: record not found
2026/07/12 20:55:02 ERROR - X-UI: Failed to localize message: message "get" not found in language "en-US"
2026/07/12 20:54:01 WARNING - X-UI: [GET /3v2cwgF7R1i2CwyiDC/panel/api/clients/get/amir14_6031593 handler=controller.(*ClientController).get client.go:112] Failed: record not found
2026/07/12 20:54:01 ERROR - X-UI: Failed to localize message: message "get" not found in language "en-US"
2026/07/12 20:54:01 WARNING - X-UI: [GET /3v2cwgF7R1i2CwyiDC/panel/api/clients/get/ali_3895256 handler=controller.(*ClientController).get client.go:112] Failed: record not found
What have you already tried?
No response
3x-ui version
3.5
How did you install 3x-ui?
install.sh script
Operating system
ubuntu22
Screenshots or config snippets
No response
Before submitting
@github-actions[bot] commented on GitHub (Jul 12, 2026):
These lines are not leftover data in the database — there is nothing to "clean."
record not foundis generated live, per request, only when something asks the panel for a client email that no longer has a matching row. Since those clients are already deleted, the lookup correctly fails and gets logged; nothing is stored anywhere that a cleanup action could remove.Confirmed in the source:
GetRecordByEmail(internal/web/service/client_lookup.go:14-24) does a plainWhere("email = ?", email).First(&row). GORM's miss is literally the error stringrecord not found, which is what the warning reports (logged generically for any failed API call byjsonMsgObj,internal/web/controller/util.go:157-183) — this is identical on SQLite and PostgreSQL.GET /panel/api/clients/get/:emailanywhere in this codebase is thehydrate()helper infrontend/src/hooks/useClients.ts:298-304, used only when an admin explicitly opens "Edit"/"Info"/"QR" or toggles enable/disable for a row in the Clients table (frontend/src/pages/clients/ClientsPage.tsx:462,503,509,useClients.ts:520). There is no background job anywhere in the repo that polls this endpoint by itself.So the repeated hits for
leon_4214084,shayan_1869610, etc. mean something that already has access to your panel (the URL contains your actual random web base path, so this isn't Xray or the nodes) is still asking about those specific emails — most likely a browser tab/session where the Clients table was left open from before they were deleted (a stale cached list still showing those rows), or an external script/integration hard-coded with those emails. Reloading that session/page stops the requests, and with them the log lines; there's no server-side row to purge.If you were thinking of "Delete Orphans" (Clients page → bulk-actions menu →
POST /panel/api/clients/delOrphans,ClientService.DeleteOrphans,internal/web/service/client_portable.go:168): that removesclient_recordsrows that still exist but aren't attached to any inbound, which is a different situation — your emails already return "record not found" (no row at all), so it won't find anything to act on here.Separately, while investigating I confirmed a real, unrelated bug in the same code path:
Title: Wrong i18n key ("get") used for error messages in several GET handlers
Severity: Low
Category: Correctness
Why this matters: the
gethandler builds its error message withI18nWeb(c, "get")(internal/web/controller/client.go:112,117,122,127), and the same literal keygetis reused ininternal/web/controller/inbound.go:137,446,451,internal/web/controller/node.go:92,108,158,195,208,298,338, andinternal/web/controller/host.go:61(15 call sites). No locale file underinternal/web/translation/(checked all 13) defines a message with IDget, so every time any of these handlers hits that error branch,internal/web/locale/locale.go:96-103fails to localize it and logsFailed to localize message: ...at ERROR level — exactly the second line paired with each warning in your log. It also degrades the API response itself:jsonMsgObj(internal/web/controller/util.go:173) builds the message asmsg + " (" + err + ")", and withmsgresolving to""you get both the double space visible in your log (client.go:112] Failed: ...) and a client-facing message reduced to" (record not found)"instead of a proper prefix.Recommendation: replace
I18nWeb(c, "get")at those 15 call sites with an existing, already-translated key such assomethingWentWrong(used by nearly every sibling error branch in the same files), or add a dedicatedgetkey to all 13 locale JSON files underinternal/web/translation/if a more specific message is preferred.@MHSanaei for awareness — a fix touches 4 controller files (and optionally 13 locale files), so I'm leaving the approach to a maintainer rather than opening a PR.
This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jul 23, 2026):
Fixed in #6083. Uses a real i18n key in the client get handler, removing the 'message "get" not found' log spam (the record-not-found warnings themselves are benign).