Large Amount of Unused Media Effectively Unremovable?

I have an issue where I have a large quantity of unused media which cannot be deleted permantly.

If I try and delete it by using check media → trash → empty trash, it appears almost immediatly from Ankiweb. If I do this without internet connection, everything is fine… until I do the next sync and get it all back again… Forcing a sync TO Ankiweb after using the no-internet approach likwise does nothing. Really not sure what to do here.

I beleieve that these parasitic elements are causing long sync times bewteen devices as well.

How can I permanantly get rid of these parasitic media files?

Anki Info:

Anki 23.12.1 (1a1d4d54) (src) (ao)
Python 3.11.6 Qt 6.6.1 PyQt 6.6.1
Platform: Linux-6.6.8-2-MANJARO-x86_64-with-glibc2.38

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Advanced Browser [‘874215009’, 2023-10-21T10:34, ‘None’, ‘’]
Advanced Review Bottom Bar [‘1136455830’, 2023-11-17T06:57, ‘None’, ‘’]
Anki Simulator [‘817108664’, 2023-11-06T12:26, ‘None’, ‘’]
AnkiConnect [‘2055492159’, 2024-01-01T21:16, ‘None’, ‘’]
Browser TableEditor side-by-side horizontal split [‘831846358’, 2022-01-25T17:11, ‘None’, ‘’]
Clickable Tags v20 original [‘380714095’, 2022-01-30T17:58, ‘None’, ‘’]
Colorful Tags Hierarchical Tags [‘594329229’, 2022-09-15T11:06, ‘None’, ‘’]
Custom Background Image and Gear Icon [‘1210908941’, 2023-04-18T21:19, ‘None’, mod]
Enhance main window [‘877182321’, 2023-10-22T16:28, ‘None’, ‘’]
FSRS4Anki Helper [‘759844606’, 2024-01-06T02:46, ‘None’, ‘’]
Image Occlusion Enhanced [‘1374772155’, 2022-04-09T03:15, ‘None’, ‘’]
Japanese Support [‘3918629684’, 2023-10-18T23:13, ‘None’, ‘’]
Leaderboard [‘41708974’, 2023-01-15T05:53, ‘None’, ‘’]
More Decks Stats and Time Left [‘1556734708’, 2023-09-24T10:08, ‘None’, ‘’]
More Overview Stats 21 [‘738807903’, 2021-07-30T15:13, ‘None’, ‘’]
Progress Graphs and Stats for Learned and Matured Cards [‘266436365’, 2020-03-29T02:26, ‘None’, ‘’]
Quizlet to Anki 21 Importer with audio support [‘1362209126’, 2023-12-17T07:35, ‘None’, ‘’]
Review Heatmap [‘1771074083’, 2022-06-29T21:43, ‘None’, ‘’]
Speed Focus Mode auto-alert auto-reveal auto-answer [‘1046608507’, 2022-12-16T06:24, ‘None’, ‘’]
Symbols As You Type FIXED [‘2088399109’, 2023-12-14T13:45, ‘None’, ‘’]

===IDs of active AnkiWeb add-ons===
1046608507 1136455830 1210908941 1362209126 1374772155 1556734708 1771074083 2055492159 2088399109 266436365 380714095 3918629684 41708974 594329229 738807903 759844606 817108664 831846358 874215009 877182321

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Anki Killstreaks [‘579111794’, 2021-12-15T10:20, ‘None’, ‘’]
Hitmarkers [‘1776869150’, 2020-03-31T18:04, ‘None’, ‘’]
Remaining time for Anki 21 [‘1508357010’, 2020-12-13T09:14, ‘20.12.13i151’, ‘’]

Did you click on the “Delete Unused” button that appears in the screenshot?

Yes, as indicated by the post :slight_smile:
I also emptied the garbage bin using the same UI interface.

They always come back.

You have a lot of active add-ons. Maybe one of them is doing something funny?

Try restarting Anki with add-ons inactivated (by pressing the Shift key as you launch Anki), and then see if the media files can be successfully deleted.

Try running Check Database as well if by any chance you didn’t already.

Just tried everything again without an internet connection or any add ons (shift key held), forced chages one way.

Restarted holding shift with no add ons on, and same result.

All of your devices must be fully in sync before you remove the media, or it may come back.

Tried syncing all devices, changing NOTHING (no cards edited, no preset changes, nothing) between syncs, did the no-internet delete followed by one way sync: same end result.

Starts downloading non-existant media.

That implies media was not fully in sync. Please make sure ‘media sync complete’ is shown on each device. Media files may take time to sync - Frequently Asked Questions

Forcing a one way sync does not affect how media is synchronized, so there’s no need to do that.

While waiting for it, it always displays this error:

image

EDIT 0:
There is no error message when running from Konsole, and there is no error log file in the Anki2 folder aside for a 0B anki.log file.

Anki Debug Information (No plugins active):

Anki 23.12.1 (1a1d4d54) (src)
Python 3.11.6 Qt 6.6.1 PyQt 6.6.1
Platform: Linux-6.6.8-2-MANJARO-x86_64-with-glibc2.38

Please log out and then sync to log back in again, which will force a rescan of all media, and should make that message go away.

I disconnected internet, deleted all the media using UI tools, signed out of Ankiweb, closed, connected to the internet, then signed back into Ankiweb and it appears to be re-downloading the media.

I also did this while not doing the internet disconnection thing and still got the same error.

Yes, that is expected. Please allow it to run to successful completion, and then you can make the deletions.

I don’t understand.

I did:
log out → check media → delete → check media → empty bin → log in → sync

And it downloads the media again. Am I doing something wrong?

From above:

I only have Anki on my phone and computer.

I synced my phone and then turned it off so that I know that there is no interference. I then synced my desktop Anki.

I then did (on my desktop):

sign out → check media → send to bin → check media → empty bin → sign in → sync

It still downloads the media. I have no other devices that run Anki, and the phone was off :woman_shrugging:

No, I’m someone who is trying to learn stuff and dealing with an annoying software issue which causes long sync times on my phone.

If you want I’ll OBS record the entire thing. It’s real and I don’t know why it’s happening, but it is.

Like this is what my Anki looks like:

I’m burning valuable time syncing stuff to try and resolve this issue. Clearly I’m not trolling; I just want to do my cards in peace.

I don’t know if it’s the build on Linux or what’s happening, but something’s happening.


I strongly suspect that this error message is somehow related to this issue.

“The following files were found in the media folder”

Maybe I’m naive, but do these exist as actual files somewhere in your Linux filesystem? Can you not simply physically delete them then? Or move them first, just to be safe.

On Windows I use the profile “User 1” and the media files are in \AppData\Roaming\Anki2\User 1\collection.media\

How about this:

  • go to Tools / Preferences / Syncing
  • unset “Automatically sync on profile open/close”
  • set “On next sync, force changes in one direction”
  • exit Anki
  • Delete or move the media files in your collection.media folder. If you don’t want to delete them all, you could copy-paste the long list that gets displayed into a file called filelist.txt and then delete all those files with a command like:
    tr '\n' '\0' < filelist.txt | xargs -0 -r rm -v --
  • start Anki again, click on Sync, and choose Upload
  • start Anki on your phone, Synchronize, and choose Download

Would this not work?

(and if it did work, you could then restore “Automatically sync on profile open/close” afterward)

One other thought: could you have an old profile or an additional profile that syncs to the same e-mail address as your main profile?

From: Profiles - Anki Manual

Only a single profile can be synced to an AnkiWeb account. If you have different users on your computer, each user will need to set up a separate AnkiWeb account for their profile. If you attempt to link two or more profiles to the same AnkiWeb account, you will overwrite the data from one profile with the data from the other. (emphasis mine)

Maybe the media files are coming back from this hypothetical other profile?

I managed to find the media folder, which is the standard media folder in .local/share/Anki2.

After using the UI tools, all media files get moved to Anki’s media.trash trash bin:

I actually just realized that the files are 27k, and I only have ~30k normal media images, no wonder the phone sync takes so long.

I just tried it, and it didn’t work.

I’m rendering a video of the issue from both screens now.

I only have 1 profile, it’s the same one I used to sync.

I have never made another profile.