teldrive: [Bug]: Orphaned Telegram channel messages persist despite successful check --clean
Describe the bug
After restoring a month-old Postgres database for Teldrive, I noticed several orphaned files still present in the associated Telegram channel. To clean these up, I ran the check command using:
docker compose run --rm --entrypoint /teldrive teldrive check --clean --config /config.toml
This command completed successfully without any errors in the terminal. However, the orphaned files in the Telegram channel were not deleted. While reviewing the Teldrive logs, I occasionally encountered the following error:
failed to delete messages {"error": "callback: rpcDoRequest: rpc error code 400: CHANNEL_INVALID", ...}
Interestingly, uploading and then deleting a new file through the Teldrive WebUI works perfectly, the file gets deleted from both Teldrive and the Telegram channel. This suggests the issue only affects older/orphaned files after database restoration.
Repoduction
- Restore an older Postgres backup for Teldrive (in this case, one month old).
- Observe that several orphaned files still exist in the linked Telegram channel.
- Run the following cleanup command from the directory containing the Docker Compose file:
docker compose run --rm --entrypoint /teldrive teldrive check --clean --config /config.toml
- Wait for the process to complete (no error output is shown).
- Check the Telegram channel, orphaned files remain undeleted.
- Review Teldrive logs, intermittently shows
CHANNEL_INVALIDerror during deletion attempts.
Expected behavior
The teldrive check --clean command should identify and delete orphaned files from the Telegram channel especially after restoring an older database. All messages/files no longer tracked in the database should be properly removed from the channel. The CHANNEL_INVALID error should not occur during this cleanup if the channel is configured correctly and accessible.
Version
v1.6.17
Which Platform are you using?
docker (Linux)
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 16
Yes, but that’s not what i meant. Of course you can do that, but if you want to have this bug in Teldrive fixed before doing anything (which you said you were hoping for), then the script you linked to should of course not be used. It is thus irrelevant unless it is determined that this bug will never be fixed, and I doubt that it will.
I mean, you give off mixed signals, because initially you did imply that you wanted to use the script by saying
and I only say this because you countered my comment about using the script, even though you were the one who brought it up, that’s all.
Anyway, yeah, I’ll perhaps look more into what the issue might be later, maybe. If i have the time and feel up to it.