Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: How to solve this error(panic: interface conversion: tg.MessageClass is *tg.MessageEmpty, not *tg.Message) #380

Open
kangheeyaa opened this issue Nov 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@kangheeyaa
Copy link

Describe the bug

Hello.
I use Teldrive frequently and tend to update to the newest version as soon as it's released
I've been using the latest version until recently, but when I rebooted the server, I got the following error.
I'd like to know what the problem is and how to solve it.

Repoduction

I met this issue after rebooting the server.

Expected behavior

Normal service...

Version

1.5.4

Which Platform are you using?

Linux

Additional context

Here is docker compose logs.

teldrive | goroutine 122 [running]:
teldrive | github.com/tgdrive/teldrive/pkg/services.getParts({0x21219f0, 0x4000332d00}, 0x4001061b08, {0x211f018, 0x40002a6060}, 0x4001061688)
teldrive | github.com/tgdrive/teldrive/pkg/services/common.go:43 +0x51c
teldrive | github.com/tgdrive/teldrive/pkg/services.(*FileService).GetFileStream.func1()
teldrive | github.com/tgdrive/teldrive/pkg/services/file.go:852 +0x8c
teldrive | github.com/tgdrive/teldrive/pkg/services.(*FileService).GetFileStream.func2({0x2121750?, 0x4000f3ad20?})
teldrive | github.com/tgdrive/teldrive/pkg/services/file.go:874 +0x24
teldrive | github.com/tgdrive/teldrive/pkg/services.(*FileService).GetFileStream.RunWithAuth.func3({0x2121750, 0x4000f3ad20})
teldrive | github.com/tgdrive/teldrive/internal/tgc/run.go:40 +0x36c
teldrive | github.com/gotd/td/telegram.(*Client).Run.func3({0x2121750, 0x4000f3ad20})
teldrive | github.com/gotd/[email protected]/telegram/connect.go:150 +0xa4
teldrive | github.com/gotd/td/telegram.(*Client).Run.(*CancellableGroup).Go.func6()
teldrive | github.com/gotd/[email protected]/tdsync/cancel_group.go:48 +0x30
teldrive | golang.org/x/sync/errgroup.(*Group).Go.func1()
teldrive | golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x54
teldrive | created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 118
teldrive | golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x98
teldrive | 2024/11/01 03:32:22 goose: no migrations to run. current version: 20240915121635
teldrive | 01/11/2024 03:32 AM INFO Started server http://localhost:8080
teldrive | panic: interface conversion: tg.MessageClass is *tg.MessageEmpty, not *tg.Message

@kangheeyaa kangheeyaa added the bug Something isn't working label Nov 1, 2024
@Linden10
Copy link

Linden10 commented Nov 1, 2024

Ah this is indicative of a ghost file aka you have missing files on telegram side but on the database it appears it's there when it isn't. Something must've happened to cause the file to not upload but be added to your database.

This was resolved with the latest teldrive versions sometime ago, fixing file upload checks and such.

Anyways to resolve this problem, you're going to have to use this script to manually check and remove such ghost files from your database. Instructions on how to use it and requirements to install is on the discord here:
https://discord.com/channels/1142377485737148479/1260921464350179399/1261145708392874064

(Make sure to join the teldrive discord first).

Here's the link to the python script:
https://gist.github.com/danieleg1/1427c2a535b4dd4a6775e0fa82431400

Make sure to read those instructions so you don't accidently delete any files that you deem important! Otherwise you might end on doing something you might regret!

I hope this helps ya out! ^^

@kangheeyaa
Copy link
Author

Hello.
Thank you for your advice.
However, I'm not familiar with programming, so I'm not confident about executing the script properly.
For now, I've downgraded to version 1.5.3, and it's working normally....
I will join the Discord and carefully read the information provided there.
Thank you.

@D0nnieD4rk0
Copy link

had the exact same issue and the script deleted a few files of mine. this project has lost some of its credibility as a cloud storage project but i guess thats what you get for using free* cloud storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants