msgbyte / tianji

Tianji: Insight into everything, Website Analytics + Uptime Monitor + Server Status. not only another GA alternatives
https://tianji.msgbyte.com/
Apache License 2.0
1.32k stars 74 forks source link

Server-Tab not displaying data #85

Open tp-sgr opened 3 weeks ago

tp-sgr commented 3 weeks ago

Using the latest V1.13.1, tianji doesnt displays any server-data. In the sidemenu, it states, that it would show 8 servers, but on the actual tab, there is only the message "No data".

In the docker logs, everything is normal, until i request the server-page. Then the following error is thrown:

[Socket] Authenticated throw error: Error: Can not get user info. at Array.<anonymous> (file:///app/tianji/src/server/dist/src/server/ws/index.js:31:27)

I know it worked sometime ago, but i didnt checked it since then, and i always had the latest-tag for the docker-compose, so its possible that this bug developed over previous builds.

moonrailgun commented 3 weeks ago

I think logic should be work, can you clear your cookie and try relogin again?

tp-sgr commented 3 weeks ago

Hey, i've cleared everything my browser listed me in the developer tools regarding storage. the page then automaticaly redirects me to the login screen. But even after that, tianji only shows the number of reporting servers in the sidebar, not the actual data. I've tested this also on a device, where i have never used the website, with the same results. Even the logs doesnt show anything other than reported in my first post.

Btw, i can see in the logs, that the servers are reporting correctly to tianji, so there shouldnt be any problems.

Is there any possibility to turn on more verbose logging or something like that?

moonrailgun commented 3 weeks ago

as you said its looks like websocket auth not pass.

can you visit /api/auth/session to check login session info?

should be like this:

image

tp-sgr commented 3 weeks ago

Yes, it looks nearly identical with the screenshot u shared, ofcorse with slightly different expire-time and id, but else anything is the same...

lokendraln commented 3 weeks ago

still there is same problem

tp-sgr commented 2 weeks ago

is your environment freshly setup with the current version or is it an older setup migrated to the latest?

moonrailgun commented 2 weeks ago

I try to use a incognito window to make browser clear and without any cookie or local state. and everything is work file.

did you mind try to help me debug it?

the bug is report here, to check auth permission in serverside .

image

did you mind print socket.request and socket.handshake.secure?

moonrailgun commented 2 weeks ago

and here

image

tp-sgr commented 2 weeks ago

ok i'll try, but i never worked with nodejs before. i can connect into the container and modify these two files, but do i need to restart the node-service? If yes, how? if i kill the node process, which is using the :12345 port, the container crashes and restarts, but with the original files... Any idea?

moonrailgun commented 1 week ago

enter docker container with docker exec and change js file(maybe compress but i think almost same)

then exit container and run docker restart to restart.

if you dont delete container, all change will keep