Mp3tag deletes file automatically after edit error

Hi. I encountered this bug while adding cover art to some of my Mp3 files, it doesnt happen often but when it does i get an error message saying an error occured while editing one of the files and then Mp3tag completely deletes that file from my computer including the recycle bin and the only way i am able to recover the file is to use a program like Piriforms Recuva. I dont know whats causing the issue or why it behaves like this on occasion, but damn is it scary. Has anyone else experienced this or know the reason to why it happens?

Is this an advertisement for a certain recovery program?

If you find that certain files cause problems then you should check...
... integrity of the hdd
... ownership of the files
... the program environment and make sure that no other program access the files
... integrity of the files

I think that you will find tmp-files either in the temp-folder or in the working directory. If you rename the extension from tmp to the original, you probably get your file back.

Nah I have nothing to do with the recovery program.

-My HDD integrity is good, just tested it.
-File integrity is fine and the files plays perfectly as far as I can tell.
-No other program was using the files at the time I was editing them (as far as I know) but I was doing bulk editing where all files were perfectly edited except the one file that errored and got completely deleted, the other files were unaffected and didn't get deleted.
-All of my files should have normal ownership including all the files that errored as I did check that out after I restored them and I was able to edit and add cover art to these after a computer restart, however trying to edit these files in particular before the computer restart would give me the error every single time i tried and the file would get deleted each time. I also experienced the error again the next day with completely different files, same story.

But yeah, lets say a file has all of the issues you mention about HDD integrity, file integrity, ownership issue and is being used by another program. Should Mp3tag really decide to delete the file all by itself like I experienced? Seems like really odd behaviour unless something else in windows was the cause and not Mp3tag itself.

I have been editing thousands of files for the past few days and this issue only happened like 5 times total during my editing sessions so it's clearly not a common issue, and I have never experienced this happening before and I have been using Mp3tag for years, and most times I get the edit error message for whatever reason it doesn't delete the file.

Should also mention that these sessions the past few days is the first time I have actually started adding cover art and that the error happened related to this so maybe thats the reason I have never experienced this before as all my other usage has been exclusively for editing filenames. I thought maybe the error/bug was related specific to cover art editing or something.

Thanks for the tmp-files tip. I'll try that out if this happens again.

So you did not really test the files integrity - otherwise you would have mentioned the tool that you have used. Playing a file is not the best test method, you would really have to test the integrity like the header information, whether tags are stacked on top of each other, unknown streams are present and so on.

And the general impression that no other program uses the file is also not enough esp. when you experience that behaviour under some circumstances and sometimes you don't.
What should a reboot do good about the MP3tag behaviour? Either this is an MP3tag bug or it is not.
If you can sometimes edit the files and sometimes you can't it looks like something in your environment messes things up.

That what you ask

can be answered with a clear "no".
I suspect that you currently run into the common trap that you have the Windows Explorer open in the same folder as the files that you currently edit.
The WE then grabs the original file while MP3tag just tries to edit it (and for bigger modifications like adding an embedded picture the file has to be copied to a temporary file, appended and moved back to its original location) the WE blocks the original file, so the final step fails.

See if you get the same problems if you close WE while editing. The same applies to WMP or other players.

Ok I see. I just assumed the file was in good shape if they played fine and didn't know of all the technical stuff underneath. This is obviously not my area of expertise as you can tell :slight_smile: I just got something called MP3val and ran a scan and got a bunch broblem reports on multiple files, most files were OK but a good chunk reported a problem and said "It seems that file is truncated or there is garbage at the end of the file" while a lesser amount of files gave a mixed result of these errors:
"MPEG stream error, resynchronized successfully."
"Non-layer-III frame encountered."
"Different MPEG versions or layers in one file."
"Wrong number of MPEG data bytes specified in Xing header"

I have ZERO clue what any of this means or if it's serious or not. Also, is it safe to use the "repair all files"-option or do I run the risk of breaking my files somehow?

Anyways, like I said this error only happened like 5 times during thousands of edits over a 2 day period, and I doubt I can reproduce the error on demand unless I waste hours upon hours of trying to make it happen, but your explanation of Windows Explorer messing up the file at it's final step made sense so I guess I'll leave it at that.

Thanks for your help and insight.

MP3val is a fair choice.
Also there is Foobar2000 that has a utilities function in the context menu to mend files.
And there is MP3diags that sees even more peculiarities.
So if you have the time, let the first and third utility scan your collection and see what is wrong.

Depending on the error, a repair may lead to repaired files or the files are really only garbage. That is the way it is.

I do not claim that the internal errors will lead to the behaviour that you observed but they could be one of the many causes.

See if a reluctant use of the WE helps you to avoid the fruitless attempts to re-write the files.

Are you saying that ignorance is not bliss?

And I should check all of my music with some software as I may get a long list of files with messed up tag fields or audio data?

Hardly ever.

That depends on the sources.
If you have a 100% safe way of producing your MP3 files (as these are the only files that are treated by the named utilities) then you probably do not have to check the files over and over again.
But as I know that you like to get audio from Youtube and perhaps other sources, it may be a good idea to scan these files thoroughly before adding them to the collection.
This is especially true if you run into editing problems.

I am more concern with the storage. I try to take care of my data but through the years I have lost for example a couple of photos because of some data corruption or bad sectors or whatever

And as I constantly re-edit my files and re-tag them and rename them, something like making a full copy and comparing the checksum would only give me exact error free copy [assuming that I do not have errors right now] of a state when the copy was executed. A day later this checksum would be useless if I change / remove / add anything. And even if it would be for each file individually, there is no way of telling a month from now if for example wiping of some tag field in a song X came form data corruption or was administered by me on purpose

So how can I check if for something like [I don' know] missing headers in MP3 or for example #I&$TQxd0-697s5zdj or □□□□□□□ □□□□□□ appearing in a tag field

Unfortunatelly, there is a problem with MP3val, at least with the mp3val-0.1.8_with_frontend-0.1.1-bin-win32 version

In that, that it has a problem with uncommon signs

█, Æ, ã, ā, À, å, è, ê, ī, ñ, û, ŵIf they happened to be in a name of file that is on a list being scanned, MP3val just stops / crashes. And that is a known issues [<a href="https://sourceforge.net/p/mp3val/bugs/24/" target="_blank">https://sourceforge.net/p/mp3val/bugs/24/</a>]

Also: you cannot simply select all of folders [i.e. artists] and just drop them on the window of MP3val- you have to use the "Add folder to validate (recursively)" icon and select a folder that contains those [possibly hundreds of] folders. And if you do not, you will run into troubles with loading them