mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5991] [Bug]: tgId Error in 3x-ui #4151
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#4151
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 @ariardiansyahputraz0 on GitHub (Jul 16, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5991
Describe the bug
Solution: tgId Error in 3x-ui When Integrating with Telegram Bot
After extensive debugging and experimentation, the root cause turned out to be a version incompatibility in 3x-ui, not a bot code issue.
The error was:
cannot unmarshal string into Go struct field Client.tgId of type int64
cannot unmarshal string into Go struct field Client.tgId of type int64
The panel rejected all client creation/update requests with the tgId field, regardless of whether it was a string or integer.
How to reproduce the problem
cannot unmarshal string into Go struct field Client.tgId of type int64
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.5.0
Xray-core version
No response
How did you install 3x-ui?
Other (please describe in the bug body)
Operating system
API
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jul 16, 2026):
This is the same underlying bug as #5934: same error (
cannot unmarshal string into Go struct field Client.tgId of type int64) and same version (3.5.0).Confirmed in the source:
model.Client.TgID(internal/database/model/model.go:817) is a strictint64with no tolerant unmarshal, so any inbound whose storedsettings.clients[]contains a non-numeric legacytgId(e.g. an old""value) fails to parse inParseInboundSettingsClients(internal/web/service/inbound_settings_clients.go:28). BothaddInboundClientandUpdateInboundClientreload the target inbound's existing clients first (internal/web/service/client_inbound_apply.go:322and:546), so one un-migrated client on an inbound breaks every subsequent add/update request on that inbound — independent of thetgIdvalue you actually submit. That matches what you saw.Please follow and continue on #5934, which has the full root-cause writeup and an immediate SQL workaround for unblocking an affected inbound. Closing this one as a duplicate to keep the discussion in one place.
This reply was generated automatically. A maintainer may follow up.