teldrive: [Bug]: Recurring 401 Errors on /api/events After Database Restore
Describe the bug
After a recent PostgreSQL database corruption, I restored from a backup using pg_restore and restarted Teldrive container. Everything appears to be functioning correctly — I’m able to browse and download files (the /api/files endpoint consistently returns 200 OK). However, teldrive container logs are being spammed every minute with the following error:
ERROR {"status": 401, "method": "GET", "path": "/api/events", "query": "", "ip": "{MY_IP}:48046", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36", "latency": 0.000922286, "time": "2025-05-23T13:20:53Z"}
Any idea what could be causing this and how to fix it?
Repoduction
- Start the Teldrive container after restoring the PostgreSQL database using pg_restore.
- Observe the application logs.
- Notice recurring 401 Unauthorized errors for the /api/events endpoint appearing every minute, even when the app appears to function normally.
Expected behavior
The /api/events endpoint should return 200 OK when the user is authenticated and actively using the app. No recurring 401 Unauthorized errors should appear in the logs during normal usage.
Version
Which Platform are you using?
Docker Container on Ubuntu 24.10
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 26 (2 by maintainers)
It does not, because rclone is speaking to teldrive and teldrive is speaking to the telegram API.
Why? Is it behind cloudflare or something? Also, why 8080 and not some random port so you at least avoid these automated bots that checks the usual ports.
It’s not weird at all. A disconnected, killed or crashed FUSE endpoint (such as
rclone mount) can leave the mount point in a stale state. It means the kernel still has your mount point registered but no handler to talk to, therefore it becomes an orphaned or “stale” FUSE mount.An example of this is when you sometimes have to run
fusermount -zu /your/mount/pointafter killing an rclone mount - because the kernel still thinks the mount is busy. That command will perform a lazy unmount, which means it will ignore what the kernel thinks of the filesystem and unmount it anyway.You’re welcome. I should’ve more closely considered that other instances might be to blame, but the user-agent threw me off. Oh well. You don’t need to use such user-agent, unless you want to “hide” yourself from yourself. The only practical use would be to distinguish between different rclone instances, like “rclone 1”, “rclone at moms house”, etc (or whatever), for easier log reading.
Thanks for the reply, somehow it got edited like that in here. I have correctly used
--as described in the docs.docker compose run --rm --entrypoint /teldrive teldrive check --clean --config /config.toml