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

Metadata wirte to file tag fails sometimes in Win 10 #10620

Closed
mixxxbot opened this issue Aug 23, 2022 · 4 comments
Closed

Metadata wirte to file tag fails sometimes in Win 10 #10620

mixxxbot opened this issue Aug 23, 2022 · 4 comments
Labels
Milestone

Comments

@mixxxbot
Copy link
Collaborator

Reported by: daschuer
Date: 2021-12-19T11:23:30Z
Status: Fix Released
Importance: High
Launchpad Issue: lp1955331


The metadata export to file tag "sometimes" fails on WIN 10.
This was test on a virtual box Win 10 image.

There seems to be a file locking issue on windows that prevents to write the metadata at all testing wit plain 2.3.1:

Debug [Main]: MetadataSourceTagLib - Exporting track metadata into file "C:/Users/dasch/Music/Bata Illic - Ich möcht der Knopf an Deiner Bluse sein.mp3" with type 3
Critical [Main]: MetadataSourceTagLib - "Die Quelldatei kann nicht entfernt werden" - Failed to rename the original file for backup before writing: "C:/Users/dasch/Music/Bata Illic - Ich möcht der Knopf an Deiner Bluse sein.mp3" -> "C:/Users/dasch/Music/Bata Illic - Ich möcht der Knopf an Deiner Bluse sein.mp3_orig"
Warning [Main]: MetadataSourceTagLib - Failed to save tags of file "C:/Users/dasch/Music/Bata Illic - Ich möcht der Knopf an Deiner Bluse sein.mp3"
Warning [Main]: Track - Failed to export track metadata: "C:/Users/dasch/Music/Bata Illic - Ich möcht der Knopf an Deiner Bluse sein.mp3"
Debug [Main]: TrackCollectionManager - Saving track "C:/Users/dasch/Music/Bata Illic - Ich möcht der Knopf an Deiner Bluse sein.mp3" in internal collection
Debug [Main]: TrackDAO: Saving track 3 QFileInfo(C:\Users\dasch\Music\Bata Illic - Ich möcht der Knopf an Deiner Bluse sein.mp3)
Debug [Main]: TrackDAO: Updating track in database 3 QFileInfo(C:\Users\dasch\Music\Bata Illic - Ich möcht der Knopf an Deiner Bluse sein.mp3)
Debug [Main]: BaseTrackCache(0x1e30431cf30) updateIndexWithQuery took 0 ms

My first Idea was that this this is because of a looking up the file properties in windows explorer? But this also happens when I do not touch the file at all with other applications than Mixxx. It also happens after a fresh restart of Windows.
It is a Windows 10 Runnning in a virtual Box.

Interestingly the renaming works after I have loaded the track into a deck and edit the metadata while paying.

@mixxxbot mixxxbot added the bug label Aug 23, 2022
@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-12-19T11:29:03Z


This is IMHO an important bug because if the metadata export does not always work, you cannot rely on it and the whole feature is kind of moot.

I am not sure what is the best solution, and if we are ever able to fix it entirely because on windows we don't know when a virus scanner kicks in or such.

For now I think we must not fail silently, leaving the inconsistent state.

We may revert the edit and issue a pop up or such.

Or make the dirty flag persistent to delay the metadata write across Mixxx restarts.
Ideas?

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-12-20T11:38:28Z


It seems to be a common issue that renaming a file after writing it fails because of indexer of virus scanner access.

I think this https://stackoverflow.com/questions/11021639/overwriting-files-in-windows-by-renaming-randomly-fails post matches our issue.

I am not sure if the ReplaceFileA Api function is able to work around it:
https://docs.microsoft.com/de-de/windows/win32/api/winbase/nf-winbase-replacefilea?redirectedfrom=MSDN

Maybe it fixes the issue of multiple file handlers when accessing the Windows API via QFile.

This will be at least a workaround for the birth time issue in https://bugs.launchpad.net/mixxx/+bug/1955314

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2021-12-27T22:15:22Z


The issue was a missing close() after reading the file stream properties. This is quick fixed here:
#4586 for 2.3
and cleaned up in #4584 for main.

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.3.2 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant