NidukaAkalanka / x-ui-english

English Version of X-UI, A Multi-protocol & Multi-user Xray Panel with a Web UI and a TG Bot
GNU General Public License v3.0
725 stars 238 forks source link

check_clinet_ip_job.go:195 crashes the server #140

Open VexCloudVPN opened 1 year ago

VexCloudVPN commented 1 year ago

Welcome

Description of the problem,screencshot would be good

every day at exactly same time my x-ui crashes and the server goes down , nothing works until hard reboot of server, the only thing running on my server is x-ui and the log is below : panic: runtime error: invalid memory address or nil pointer dereference /home/runner/work/x-ui/x-ui/web/job/check_clinet_ip_job.go:195 +0x241 i've checked the x-ui.db and did "SELECT * FROM inbounds WHERE settings LIKE %[EACH_USER_CLIENT_EMAIL_FROM_INBOUND_CLIENT_IPS_TABLE]% " query for each of " client_email "in " inbound_client_ips" table and it worked for all " client_email "so there is no wrong or deleted " client_email " in xui.db but the problem exist

Version of x-ui

```console $ x-ui version # ```

x-ui log or xray log

```console # Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: 2023/02/03 10:40:24 WARNING - client ip job err: database is locked Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: panic: runtime error: invalid memory address or nil pointer dereference Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x90 pc=0xad1281] Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: goroutine 489350 [running]: Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: x-ui/web/job.updateInboundClientIps(0xc00062a7b0, {0xc000735540, 0xb}, {0xc00065ed00?, 0x2, 0x2}) Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: /home/runner/work/x-ui/x-ui/web/job/check_clinet_ip_job.go:195 +0x241 Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: x-ui/web/job.processLogFile() Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: /home/runner/work/x-ui/x-ui/web/job/check_clinet_ip_job.go:100 +0x40a Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: x-ui/web/job.(*CheckClientIpJob).Run(0x1b099b8?) Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: /home/runner/work/x-ui/x-ui/web/job/check_clinet_ip_job.go:34 +0x65 Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: github.com/robfig/cron/v3.(*Cron).startJob.func1() Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: /home/runner/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:312 +0x6a Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: created by github.com/robfig/cron/v3.(*Cron).startJob Feb 03 10:40:24 1881651801271138453215 x-ui[29015]: /home/runner/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:310 +0xad Feb 03 10:40:25 1881651801271138453215 systemd[1]: x-ui.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Feb 03 10:40:25 1881651801271138453215 systemd[1]: x-ui.service: Failed with result 'exit-code'. ```
aliafshany commented 1 year ago

@NidukaAkalanka please investigate this. i have the exact problem. this is a critical bug that needs to be fixed.

aliafshany commented 1 year ago

@VexCloudVPN did you find anything useful? if you want, we can have a chat and share the experience here on telegram, https://t.me/Ali_Afshany this happens to me exactly by the night comes. i have tested some other queries also but no luck 👎