teldrive icon indicating copy to clipboard operation
teldrive copied to clipboard

Bug:cant login

Open 0123-smallbottle opened this issue 1 year ago • 15 comments

image It keeps loading when I am useing qrcode login(and phone login)

device: raspberry pi 4b log:

2024/12/27 18:58:38 goose: no migrations to run. current version: 20241213121739
27/12/2024 06:58 PM     INFO    Started server http://localhost:8080
27/12/2024 06:59 PM     INFO    /       {"status": 200, "method": "GET", "path": "/", "query": "", "ip": "10.0.0.212", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36", "latency": 0.02276598, "time": "2024-12-27T10:59:00Z"}
27/12/2024 06:59 PM     INFO    /api/auth/session       {"status": 200, "method": "GET", "path": "/api/auth/session", "query": "", "ip": "10.0.0.212", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36", "latency": 0.000419903, "time": "2024-12-27T10:59:00Z"}
27/12/2024 06:59 PM     INFO    /login  {"status": 200, "method": "GET", "path": "/login", "query": "redirect=%2F", "ip": "10.0.0.212", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36", "latency": 0.000210942, "time": "2024-12-27T10:59:20Z"}
27/12/2024 06:59 PM     INFO    /api/auth/session       {"status": 200, "method": "GET", "path": "/api/auth/session", "query": "", "ip": "10.0.0.212", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36", "latency": 0.000209683, "time": "2024-12-27T10:59:20Z"}

config:

[db]
data-source = "postgres://teldrive:[email protected]:5432/postgres"


[jwt]
allowed-users = ["xxx"]
secret = "xxx"

[tg]
app-id = "xxx"
app-hash = "xxx"

0123-smallbottle avatar Dec 27 '24 11:12 0123-smallbottle

Have you resolved it yet? I'm having the same problem.

filippogrande avatar Dec 30 '24 15:12 filippogrande

Have you resolved it yet? I'm having the same problem.

No, I haven't resolved it yet. I did come across another issue suggesting it might be a time synchronization issue, but the time on my Raspberry Pi appears to be accurate.

0123-smallbottle avatar Dec 31 '24 19:12 0123-smallbottle

@0123-smallbottle Can you see if you are getting reply from server in websocket response.If not can post screenshot of websocket messages

divyam234 avatar Dec 31 '24 20:12 divyam234

@0123-smallbottle Can you see if you are getting reply from server in websocket response.If not can post screenshot of websocket messages

image image

0123-smallbottle avatar Dec 31 '24 20:12 0123-smallbottle

@0123-smallbottle You have to sync your system time with telegram dc otherwise it will drop packets.This will be fixed in next build when I will add ntp clock support.

divyam234 avatar Jan 01 '25 05:01 divyam234

@0123-smallbottle You have to sync your system time with telegram dc otherwise it will drop packets.This will be fixed in next build when I will add ntp clock support.

image I believe my system time is already synchronized with the nearest Telegram dc (DC5). Both are set to UTC+8.

0123-smallbottle avatar Jan 01 '25 05:01 0123-smallbottle

Ntp clock support will be added in next build days I have to write some integration tests after adding openapi support which will fix this problem.

divyam234 avatar Jan 01 '25 06:01 divyam234

Ntp clock support will be added in next build days I have to write some integration tests after adding openapi support which will fix this problem.

image I have updated to the latest version. However I'm still encountering the same issue.

teldrive 1.6.0
- os/type: linux
- os/arch: arm
- go/version: go1.23.4

0123-smallbottle avatar Jan 01 '25 19:01 0123-smallbottle

you have to enable ntp clock using cli flag or config.https://teldrive-docs.pages.dev/docs/getting-started/usage#run-without-docker read note here

divyam234 avatar Jan 01 '25 19:01 divyam234

you have to enable ntp clock using cli flag or config.https://teldrive-docs.pages.dev/docs/getting-started/usage#run-without-docker read note here

I ran the command with --tg-ntp, but the issue persists. Here are the logs:

root@raspberrypi:/home/xxx/teldrive# ./teldrive run --tg-ntp
2025/01/02 03:44:17 goose: no migrations to run. current version: 20241213121739
02/01/2025 03:44 AM     INFO    Server started at http://localhost:8080
02/01/2025 03:44 AM     INFO            {"status": 200, "method": "GET", "path": "/", "query": "", "ip": "10.0.0.197:64792", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36", "latency": 0.023171158, "time": "2025-01-01T19:44:20Z"}
02/01/2025 03:44 AM     INFO            {"status": 200, "method": "GET", "path": "/fonts/rubik.woff2", "query": "", "ip": "10.0.0.197:64792", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36", "latency": 0.000926618, "time": "2025-01-01T19:44:20Z"}
02/01/2025 03:44 AM     INFO            {"status": 204, "method": "GET", "path": "/api/auth/session", "query": "", "ip": "10.0.0.197:64793", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36", "latency": 0.000360125, "time": "2025-01-01T19:44:20Z"}

0123-smallbottle avatar Jan 01 '25 19:01 0123-smallbottle

you have to enable ntp clock using cli flag or config.https://teldrive-docs.pages.dev/docs/getting-started/usage#run-without-docker read note here

image

I downgraded to version 1.5.0, and it seems I can log in now. It's quite interesting.

0123-smallbottle avatar Jan 01 '25 19:01 0123-smallbottle

I see this might be issue with golang or gotd version for arm devices. Try to build latest teldrive code with go 1.22 in go.mod see if it works or not as I don't have raspberrypi I would not able to reproduce it. If it exists even then there might me issue in gotd. I will then downgrade to old version for compatibility

divyam234 avatar Jan 01 '25 20:01 divyam234

I see this might be issue with golang or gotd version for arm devices. Try to build latest teldrive code with go 1.22 in go.mod see if it works or not as I don't have raspberrypi I would not able to reproduce it.

I tried upgrading from version 1.5.0 to the latest (1.6.0), and it can still generate the QR code.

I guess the issue might be related to how the new version initializes the database. Downgrading to 1.5.0 and then upgrading back to 1.6.0 could be a workaround to resolve this problem.

0123-smallbottle avatar Jan 01 '25 20:01 0123-smallbottle

I don't think so as call to database is made after login is successful i.e whenever telegram client returns session auth key.

divyam234 avatar Jan 01 '25 20:01 divyam234

I don't think so as call to database is made after login is successful i.e whenever telegram client returns session auth key.

image It turns out the issue was my mistake—I initially downloaded the ARM version instead of the ARM64 version. The problem occurs when using the ARM version, but my Raspberry Pi runs a 64-bit OS. After switching to the correct ARM64 version, everything works as expected. I apologize for that.

0123-smallbottle avatar Jan 01 '25 20:01 0123-smallbottle