Musescore 4 Corrupted file
Okay, so... I saved all my work before exiting the file, closed my laptop, then opened it a few hours later to work on my piece and I'm met with an error message that reads "File '...mscz' is corrupted. This file contains errors that could cause MuseScore to malfunction."
I chose the option to open it anyway and it turns out to just be a blank canvas with no notes, bars or measures. My computer has been playing up recently, but I thought that saving it would prevent me from loosing it.
I tried opening it in Musescore 3 but I don't think I did it right because it wouldn't allow me to.
Does anyone know what actually happened and how it can be fixed? Your help would be so much appreciated.
Attachment | Size |
---|---|
I'll Be There Waiting.mscz | 48.88 KB |
Comments
This file is corrupted beyond repair.
Musescore saves backup files in a hidden .mscbackup folder, which is located in the same place as your project file.
There should be a file named .name_of_your_file.mscz~
where "name_of_your_file" is the name of your project file.
Copy it to another location, remove the ~ from the file name and try to open it.
In reply to Musescore saves backup files… by mercuree
I found the hidden file, copied it to another location, removed the ~ and then tried to reopen it but it still gave me the same error message. By the way, the preview Musescore icon for the score once removing the ~ is slightly faded if that helps?
Did you close your laptop with MuseScore open? This can cause problems in general. Maybe not with this score.
In reply to Did you close your laptop… by bobjp
Possibly… I can’t remember that far back 😅. But I very distinctly remember saving it before exiting anything because of what’s been happening to my laptop.
In reply to Possibly… I can’t remember… by dip070606
Can you post the back-up file. Also, you say you saved the file, but was it still open when you closed the lid?
In reply to Can you post the back-up… by bobjp
I can't post the backup file in it's state, the site wont let me. Were you looking for the file after I'd removed the tilda? And... to answer your other question, I'm still not sure. Sorry.
In reply to Can you post the back-up… by bobjp
Closing the lid while the file is still open but already saved is very unlikely to cause this. MuseScore does not write anything to disk unless you tell it to (or when AutoSave tells it to, but that will never affect the real file). So there is almost no chance that MuseScore writes a corrupted file while the lid is closed, because it doesn't write anything at that moment.
This is just another case of the dreaded completely inexplicable corruptions that happen a few times per month but nobody knows what's causing them. So far all known cases of this were on Windows, so I assume you are using Windows too?
It may still be useful if you could upload the backup file, but you'll have to upload the version without the ~ in the name for the site to allow it.
In reply to Closing the lid while the… by cbjeukendrup
Yes, I am using windows. It's quite frustrating. I feel that ever since I've moved away from Musescore 3 it's been crash after, corruption, after bug. Thank you all so much for your help though...
Here is the file without the tilda.
In reply to Closing the lid while the… by cbjeukendrup
I just switched to using Musescore on Mac, from Finale (may they rot in....) it has been great, good transfer in to MXL....until I started to work on the last movement of a piano concerto today.....and getting the "file is corrupted" warning.......Can't anyone in Musescore figure out hoe to fix this? Losing this last movement will be real crusher! I could use some help.....and it is quite clear I m not alone in this!
In reply to I just switched to using… by Josephel Padraig
"Can't anyone in Musescore figure out how to fix this?"
We can't guess. We need you to attach this score so that we can understand what's going on and help you.
In reply to I just switched to using… by Josephel Padraig
It would be good to know that there are two different problems:
In reply to It would be good to know… by cbjeukendrup
Can we add a check after the save to verify the file? And if we discover that the saved file is not a valid zip file, to alert the user with a proper message and ensure: 1) there is a backup of the file and 2) we have saved the current score in its unzipped form somewhere (could be a problem during the zipping phase?).
In reply to Can we add a check after the… by krasko78
As users we can mitigate the damage caused by file losses.
See https://musescore.org/en/node/369244
In reply to Can we add a check after the… by krasko78
I'm thinking of something similar (re. verify-after-save): after saving, we would do a quick check if the main score file can be extracted from the generated ZIP file, and whether that can be read by an XML parser. If that fails, then display an error message, telling the user to try again (because my hypothesis is that that will most likely fix it).
MuseScore generates the ZIP file directly, so the files are not written to disk in an unzipped form at any point. The resulting file is first written to a temporary file, with
_saving
added to the filename; and then moved to the definitive location (so the old file is not overwritten when MuseScore detects an error during saving). The problem is that this corruption error is not detected during saving.It's unclear whether this happens in the memory during the zipping phase, or while writing to disk, or while moving the temporary file to the definitive location. We could decide doing even two checks: first check the temporary file before moving it to the definitive location, then check the definitive file too after it has been moved.
In reply to I'm thinking of something… by cbjeukendrup
Absolutely. I've already started implementing this and was going to open an issue on Git and post my changes. In fact I have it mostly done (double check - before and after the move) and have been even able to test it. I have yet to come up with the dialogs to show if a corruption happens. I am thinking of a series of simple dialogs, like a wizard, to walk the user through this. Of course this is a rough initial idea that can be refined later during the review and conversations. I am going out for a piano class now and will create the issue on GitHub as soon as I come back. :)
In reply to Absolutely. I've already… by krasko78
I think a series of dialogs would be too much; just one of them should be enough. I think all we need to convey is:
- An error occurred while saving your file
- This may be a one-off error; retrying often fixes it
- If it keeps happening, try saving the file to a different location or to MuseScore.com
- (if it occurred pre-move) The version of the file that was on your hard disk is intact, but please retry saving in order not to lose your latest changes
- (otherwise) Please retry saving the file in order not to lose it
(and of course, some special cases are needed for never-saved-yet files and cloud scores)
But let's continue the discussion on GH.
In reply to I think a series of dialogs… by cbjeukendrup
Whilst such verification would be welcome, it is still not a good idea to "keep all your eggs in one basket". What if this verified file gets corrupted by a glitch next time you boot the computer, or next time you start MuseScore? It really is simple and worthwhile implementing file versioning for important files.
Microsoft Onedrive has file versioning built-in so using a Onedrive folder for your scores can be a good idea if you don't want a manual method. Maybe other cloud storage services also do this.
Even better, what if MS offered a score versioning option as well as verification?
In reply to It is still not a good idea… by yonah_ag
> What if this verified file gets corrupted by a glitch next time you boot the computer
This kind of stuff is out of scope for MuseScore (and thus for this forum). Preventing data loss as the result of such events by making regular backups is the own responsibility of every owner of a computer.
> or next time you start MuseScore?
Reading a file cannot cause its content to be changed, unless you have a severely broken hard drive or file system.
> Even better, what if MS offered a score versioning option as well as verification?
A versioning feature is offered by MuseScore.com.
Protect yourself from corrupted scores
See https://musescore.org/en/node/369244