Open Temp File (file location) failed: Bad File Descriptor

• Mar 11, 2019 - 01:49
Reported version
3.0
Type
Functional
Frequency
Many
Severity
S2 - Critical
Reproducibility
Always
Status
needs info
Regression
No
Workaround
Yes
Project

I opened a musescore file

I Went to save it (Ctrl + s) and got the error message in the title. I've tried removing Musescore from my PC and redownloading it, but the problem still occurs. I can't save anything.
I have absolutely no idea why this is happening, and I'd love some sort of solution.

Attachment Size
Cough Syrup.mscz 42.95 KB

Comments

Status active needs info

Are you still using 3.0.2? You need to upgrade to 3.0.4. 3.0.5 should be out Tuesday if you wan to wait.

I"m using Windows 10, and I'm saving to either the default scores folder the program sets up for me or to a separate one I keep my a cappella arrangements in. Saving to both places gives me the same error message.

have you tried reverting to factory settings?
Is some Anti Virus software preventing you from saving?
Is any of the locations you save to synced with some cloud service, like OneDrive or some such?

Status needs info won't fix

Hi, I have the same problem - I cannot print or save! I'm upgraded to Musescore 3. I get following error: "Open Temp File
C:/Users/cc/Documents/MuseScore3/Scores/Perfect_-_Ed_Sheeran.mscz.temp
failed: Bad file descriptor" or 'file not found'
Wondering if it's anything to do with controlled folder access, but cannot figure out how to resolve that.

It seems like antivirus software doesn't like Musescore. I would open your antivirus and check the history of blocked controlled folder access. You might find Musescore in their and if you do, let that bad boy through (This solved any issues I had with saving and updating). Also, if you're using Windows Defender like I am, you may have to give Musescore controlled folder access every time Windows Defender updates.

I think i have the solution (or so it was in my case with the same problem).
The thing that i do was just remmove the comma of the title of my song, and then i try to save it again and it worked.
It have sense cause the error says Bad File Descriptor, so the comma just prohibits musescore to save the file,i hope it helps you all.

I don´t know how to solve the problem but you can press "Save as", you save it with other name, then you delete the first file and change the name of the file you recently created.

I have begun having a similar issue after recently updating to version 3.4.2 (previously had 3.0.x, I believe?). I now cannot save a new file without manually adding the ".mscz" extension to the name. Attempting to save a newly created file gives me the following message:
"Renaming temp. file < /run/user/1000/doc/5ce895be/test.temp> to < /run/user/1000/doc/5ce895be/test> failed:
No such file or directory"
Attempting to Save As a previously created file without adding the .mscz extension simply results in "Cannot determine file type"

(I am running MuseScore under Linux on ChromeOS.)

In reply to by Jojo-Schmitz

Same issue here when saving .mscz file with MuseScore 3.6.2/Win10.
"The file xxx.mscz.temp could not be renamed to xxx.mscz".
The workaround is to save .mscx format and delete the old .mscz files.

In reply to by David Bangs

Just tested this on Musescore 3.6.2. I still get the error even without a dash in the name. Saving again after closing the dialogue allows it to save properly.

Saving to the uncompressed format (.mscx) doesn't throw errors.

I've only started having this issue in the last 2-3 months, though I can see it's first been reported much earlier.

Here's a file where I always get this error:

Attachment Size
G major scale.mscz 9.96 KB

Where exactly do you save to? To a folder that is getting synced with some kind of cloud service, OneDrive, GoogleDrive, DropBox etc? What Anti Virus software, is MuseScore listed there as being blocked?

Yes good point Jojo, I save files to Dropbox. I toggled the dropbox sync off and on and now can't recreate the issue. So it could be related to how dropbox reads the file for uploading, maybe at the same time as MuseScore is saving it.

I use the default Windows 10 Security antivirus and it doesn't block or flag any MuseScore files as far as I can tell.

It is likely a race condition between MuseScore saving and deleting that file and Dropbox syncing it, and maybe locking it during sync.
I'm using a cloud service too, but box.com, not Dropbox, and had that issue too on very rare occasions. A 2nd save then usually worked IIRC.

In reply to by Jojo-Schmitz

I have this issue also regularly. Without Dropbox or whatsoever.
Here is a simple way to reproduce it all the time.

Create this plugin:

import QtQuick 2.0
import MuseScore 3.0

MuseScore {
      menuPath: "Plugins.pluginName"
      description: "Description goes here"
      version: "1.0"
      onRun: {
            var score = newScore("McveBadFile", "bass-flute", 1); 
            Qt.quit()
            }
      }

Run it twice. 2 scores are created. Save the 2nd one. You'll get the following error :
"L'ouverture du fichier temporaire McveBadFile.mscz.temp a échoué: Bad file descriptor"
(The opening of the temporary file McveBadFile.mscz.temp has failed: Bad file descriptor)

PS: Using this plugin is simply a way to reproduce the issue at 100%. When using normal partitions the error occur more "randomly".

Strange. Not sure it is related though? 2 scores with the same name, those might conflict, but none of this had been the issue in any of the other cases here as far as I can tell?

> in any of the other cases here as far as I can tell?
indeed. The regular case is one file throwing that error when being saved

Is there a logfile somewhere that could be extracted for a better analyse ?

In reply to by lvr124

I've been poking around in the source code and think I've found the relevant function. There's no logging of these kinds of errors as far as I can tell - only full program crashes. I'm playing around with having it attempt to save several times, to avoid race conditions, but I don't know if that will fix everyone's problems.

I think in the long run some kind of logging that records file names, or other file system details, might be needed. But it's a little beyond me as I'm new to both the MuseScore source and c++ code.

Status PR created needs info

PR closed (and apparently won't apply to master, AKA MuseScore 4), exact cause and steps to reproduce reliably (in real life) still unknown.

Frequency Few Many
Severity S3 - Major S2 - Critical
Status needs info active
Reported version 3.0 3.6
Workaround Yes No

This issue occurs for me now too (after a Windows 11 clean install, and installing latest version of Musescore (version (64-bit): 3.6.2.548021803, revision: 3224f34), for every single MSCZ file. When trying to Save As under a different name, I get the error "File not found. Check the file name and try again". I am now unable to edit any file and save.

Update: Did a reinstall (Repair) of Musescore, the issue is now no longer occurring.

Reported version 3.0 3.6

After having a similar issue, I tried to figure out what was wrong. Here's what I found.
Scores (new or existing) could not be saved. I'm not sure how files are saved through MuseScore but it appears to want to replace a .temp file that isn't in there, OR the path cannot be found.

Workaround: When in the window to select where to save, navigate to the desired folder from the starting at the drive ex.
D:\Users\name\Documents\MuseScore3\Scores

Possible Cause:
Windows10 recent update- I at least have been having trouble getting files to save correctly in multiple programs since I updated last week. Renaming, changing location and removing files have all not worked correctly.

Attachment Size
ExistingFile.png 827.97 KB
NewFile.png 826.53 KB