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

1.6.16

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)

Most upvoted comments

Just to not appear as teldrive to the telegram api if it makes any sense.

It does not, because rclone is speaking to teldrive and teldrive is speaking to the telegram API.

performance is not that great on https

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.

The weird part was running ls on the mount directory wouldn’t even run fine

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/point after 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.

Thanks for the help all along.

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.

Just to make sure: in the command you’ve provided here, the clean and config options are both specified with an en dash rather than two dashes. This suggests the possibility that /config.toml isn’t being loaded.

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