trojanpanel / install-script

Multi-user web administration panel supporting Xray/Trojan-Go/Hysteria/NaiveProxy
https://trojanpanel.github.io
1.79k stars 468 forks source link

trojan panel core crash #290

Open netsupcloud opened 1 year ago

netsupcloud commented 1 year ago

hi,

where can i check why trojan panel-core crashed ? or why it is restarted or which user restarted it in OS ?

jonssonyan commented 1 year ago

Fault detection option View error log

netsupcloud commented 1 year ago

there is nothing in it about fault!

result: ---> Start troubleshooting ---> Troubleshooting ended

Fault detection option View error log

netsupcloud commented 1 year ago

i can interact with container's shell but also those infos are blind

netsupcloud commented 1 year ago

ok i found logs in /tpdata/

{"level":"error","msg":"数据库连接异常 err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-08-20 17:21:17"} {"level":"error","msg":"process has been stoped. apiPort: 32083","time":"2023-08-20 17:24:10"} {"level":"error","msg":"process has been stoped. apiPort: 32087","time":"2023-08-20 17:24:25"} {"level":"error","msg":"process has been stoped. apiPort: 32053","time":"2023-08-20 17:24:38"} {"level":"error","msg":"process has been stoped. apiPort: 57331","time":"2023-08-20 17:24:53"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-08-24 21:49:31"} {"level":"error","msg":"xray GetUserStats err: rpc error: code = DeadlineExceeded desc = context deadline exceeded","time":"2023-08-26 23:08:55"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-08-27 15:28:29"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-08-27 15:28:29"}

these errors will make tp-core crash or an automated restart ?

netsupcloud commented 1 year ago

also new version v2.2.1 has same restart or crash

jonssonyan commented 1 year ago

The log shows a database connection error. Check whether the database you are connected to is running normally.

lottgjx commented 1 year ago

The new installation Login Trojan Panel Frontend prompt: Request failed with status code 502, Unable to log in normally The current version of Trojan Panel Frontend(trojan-panel-ui) is v2.1.6 the latest version is v2.1.6 The log is as follows: {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:48:07"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:48:10"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:48:17"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:48:30"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:13"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:13"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:14"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:14"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:15"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:17"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:21"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:27"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:49:39"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:50:05"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:50:57"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:51:57"} {"level":"error","msg":"database connection err: dial tcp 127.0.0.1:9507: connect: connection refused","time":"2023-09-05 19:52:57"}

jim55221634 commented 1 year ago

Use trojan panel core 2.2.0 not use new 2.2.1 too more bug

netsupcloud commented 1 year ago

Use trojan panel core 2.2.0 not use new 2.2.1 too more bug

i have this problem in both versions

netsupcloud commented 1 year ago

The log shows a database connection error. Check whether the database you are connected to is running normally.

its only log. crash is not related to database connection issue atleast crash and restart or normal restart is not related to it. its just a normal connection problem to db why it must be a reason for crash or automatic restart ?

netsupcloud commented 9 months ago

docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3e2d85a65c5b jonssonyan/trojan-panel-core "/bin/sh -c 'chmod 7…" 4 days ago Up 22 minutes trojan-panel-core 7ac1ba58a808 jonssonyan/trojan-panel "/bin/sh -c 'chmod 7…" 4 days ago Up 2 hours trojan-panel 40be988a1f4d jonssonyan/trojan-panel-ui "/bin/sh -c 'nginx -…" 4 days ago Up 2 hours trojan-panel-ui 64a84a43ceca redis:6.2.7 "docker-entrypoint.s…" 4 months ago Up 2 hours trojan-panel-redis 6b9d849df3a0 mariadb:10.7.3 "docker-entrypoint.s…" 4 months ago Up 2 hours trojan-panel-mariadb eb9b439adb3c caddy:2.6.2 "caddy run --config …" 4 months ago Up 2 hours trojan-panel-caddy

netsupcloud commented 9 months ago

The log shows a database connection error. Check whether the database you are connected to is running normally.

everything is on same server and it was a normal install maybe at old time restore of some backup made some issue if you want i can send schema of database

netsupcloud commented 9 months ago

at time of crash and restart of trojan-panel-core i dont get any message in its log file

netsupcloud commented 9 months ago

docker exec -it trojan-panel-core '/bin/sh'

top

PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND 52 1 root S 722m 1% 8 1% bin/xray/xray -c bin/xray/config/config-57331-trojan.json 20 1 root S 723m 1% 4 0% bin/xray/xray -c bin/xray/config/config-32087-trojan.json 26 1 root S 721m 1% 3 0% bin/xray/xray -c bin/xray/config/config-38080-vmess.json 18 1 root S 721m 1% 2 0% bin/xray/xray -c bin/xray/config/config-32082-vmess.json 17 1 root S 721m 1% 9 0% bin/xray/xray -c bin/xray/config/config-32053-vmess.json 19 1 root S 721m 1% 7 0% bin/xray/xray -c bin/xray/config/config-32086-vless.json 58 1 root S 1212m 2% 8 0% bin/hysteria2/hysteria2 -c bin/hysteria2/config/config-57015.json server 1 0 root S 736m 1% 9 0% ./trojan-panel-core -host=127.0.0.1 -port=xxx -user=root -password=xxxxx -database=trojan_panel_db -accountTable=account -redis ....... 27 1 root S 721m 1% 4 0% bin/xray/xray -c bin/xray/config/config-38088-vmess.json 24 1 root S 721m 1% 6 0% bin/xray/xray -c bin/xray/config/config-32095-vless.json 57 1 root S 721m 1% 11 0% bin/xray/xray -c bin/xray/config/config-58080-vmess.json 37 1 root S 720m 1% 3 0% bin/xray/xray -c bin/xray/config/config-38443-vless.json 214 0 root S 1664 0% 2 0% /bin/sh 220 214 root R 1596 0% 3 0% top

i enteracted with docker container's shell top command shows that there is multiple xray that are running there but i think crash is made by trojan-panel-core app that is there its not related to xray version

netsupcloud commented 9 months ago

docker events 2023-12-19T17:04:01.956608301+03:30 network disconnect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-19T17:04:02.003368597+03:30 container die 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execDuration=780, exitCode=2, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-19T17:04:02.028091085+03:30 network connect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-19T17:04:02.188813629+03:30 container start 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core)

2023-12-19T17:19:32.138678672+03:30 network disconnect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-19T17:19:32.193818436+03:30 container die 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execDuration=929, exitCode=2, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-19T17:19:32.224263294+03:30 network connect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-19T17:19:32.382296409+03:30 container start 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core)

netsupcloud commented 9 months ago

~# docker events 2023-12-20T12:04:25.491491359+03:30 network disconnect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T12:04:25.539606084+03:30 container die 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execDuration=1380, exitCode=2, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T12:04:25.589359950+03:30 network connect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T12:04:25.753529704+03:30 container start 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T12:12:55.895395646+03:30 network disconnect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T12:12:55.949220631+03:30 container die 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execDuration=510, exitCode=2, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T12:12:55.988368438+03:30 network connect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T12:12:56.138229174+03:30 container start 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T12:33:56.459947843+03:30 network disconnect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T12:33:56.516839408+03:30 container die 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execDuration=1260, exitCode=2, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T12:33:56.551155854+03:30 network connect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T12:33:56.707612860+03:30 container start 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T12:53:26.773512161+03:30 network disconnect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T12:53:26.824086606+03:30 container die 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execDuration=1170, exitCode=2, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T12:53:26.850320363+03:30 network connect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T12:53:26.996483320+03:30 container start 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T13:45:27.172051257+03:30 network disconnect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T13:45:27.228430752+03:30 container die 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execDuration=3120, exitCode=2, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T13:45:27.252821780+03:30 network connect d5ea3e4c6e6a2bf347ddf97c90cab3d185f885e40cd9f5c96579e9f0f695a2ad (container=3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22, name=host, type=host) 2023-12-20T13:45:27.421312324+03:30 container start 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T14:43:06.313002710+03:30 container exec_create: /bin/sh 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execID=733cccb70d04e5006ee89fbae68105b64ed7097454627047e817153c4b17ebeb, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core) 2023-12-20T14:43:06.313327520+03:30 container exec_start: /bin/sh 3e2d85a65c5b038c1ac263d08d8d1bb34e9772dbd505c3647b6cddd4a039fa22 (execID=733cccb70d04e5006ee89fbae68105b64ed7097454627047e817153c4b17ebeb, image=jonssonyan/trojan-panel-core, maintainer=jonsosnyan https://jonssonyan.com, name=trojan-panel-core)

netsupcloud commented 9 months ago

check execDurations

netsupcloud commented 9 months ago

there is not anyway to get a dump from crash of container ? for debug ? because fault detection of script doesnt show anything

netsupcloud commented 9 months ago

exitCode=2 https://tldp.org/LDP/abs/html/exitcodes.html

meaning: Misuse of shell builtins (according to Bash documentation)

example: empty_function() {}

Missing keyword or command, or permission problem (and diff return code on a failed binary file comparison)