{"record":{"id":"b69d2aa1a16db992","repo":"MHSanaei/3x-ui","slug":"failed-to-get-inbounds","errorCode":null,"errorMessage":"❌ Failed to get inbounds.","messagePattern":"❌ Failed to get inbounds\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/web/service/tgbot/tgbot_client.go","lineNumber":119,"sourceCode":"\t\tif label == \"\" {\n\t\t\tlabel = fmt.Sprintf(\"#%d\", id)\n\t\t}\n\t\tparts = append(parts, label)\n\t}\n\treturn strings.Join(parts, \", \")\n}\n\n// SubmitAddClient sends the in-progress client to ClientService.Create with\n// the full set of attached inbound ids. Per-inbound fillProtocolDefaults on\n// the panel generates UUID/password/auth per protocol, so the bot only\n// supplies the universal fields it actually collected.\nfunc (t *Tgbot) SubmitAddClient() (bool, error) {\n\tinboundIDs := receiver_inbound_IDs\n\tif len(inboundIDs) == 0 && receiver_inbound_ID > 0 {\n\t\tinboundIDs = []int{receiver_inbound_ID}\n\t}\n\tif len(inboundIDs) == 0 {\n\t\treturn false, errors.New(t.I18nBot(\"tgbot.answers.getInboundsFailed\"))\n\t}\n\n\ttgIDInt, _ := strconv.ParseInt(client_TgID, 10, 64)\n\tclient := model.Client{\n\t\tEmail:      client_Email,\n\t\tEnable:     client_Enable,\n\t\tLimitIP:    client_LimitIP,\n\t\tTotalGB:    client_TotalGB,\n\t\tExpiryTime: client_ExpiryTime,\n\t\tSubID:      client_SubID,\n\t\tComment:    client_Comment,\n\t\tReset:      client_Reset,\n\t\tTgID:       tgIDInt,\n\t}\n\n\treturn t.clientService.Create(&t.inboundService, &service.ClientCreatePayload{\n\t\tClient:     client,\n\t\tInboundIds: inboundIDs,","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/MHSanaei/3x-ui/blob/ad32144c42455696ea9f14e12168beac3e25f5d2/internal/web/service/tgbot/tgbot_client.go#L101-L137","documentation":"SubmitAddClient (the Telegram bot's add-client flow) fails when no inbound was selected: receiver_inbound_IDSs is empty AND the legacy single receiver_inbound_ID is not positive. The bot cannot create a client without at least one inbound to attach it to, and per-inbound protocol defaults (UUID/password generation) are derived from the inbound. The message comes from bot i18n key tgbot.answers.getInboundsFailed.","triggerScenarios":"Bot conversation flow where the user skips the inbound-selection step; the inbound list message was never answered (timeout/canceled); receiver state reset between steps.","commonSituations":"Users typing /addclient then submitting without picking inbounds; state cleared by a bot restart mid-conversation.","solutions":["Restart the add-client flow and explicitly select at least one inbound before submit","If the inbound picker showed nothing, verify inbounds exist and are enabled in the panel first","Bot maintainers: guard the submit callback with a 'select an inbound' prompt instead of erroring"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(receiver_inbound_IDs) == 0 && receiver_inbound_ID <= 0 {\n    // prompt user to select inbounds instead of submitting\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Block the submit step in the bot flow until at least one inbound is selected","Verify the panel has enabled inbounds before starting the add-client flow"],"tags":["telegram","bot","client","validation"],"backgroundTag":null,"analyzedSha":"ad32144c42455696ea9f14e12168beac3e25f5d2","analyzedAt":"2026-08-15T11:13:23.905Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}