I had this error when I’d accidentally tried writing to a file that was open in the wrong mode – i.e. I had two files open, one for reading (File.READ) and the other for writing (File.WRITE), but I had accidentally written the wrong name when trying to do store_line. It couldn’t write to a file that was opened for reading.
In case anyone else comes across this now, I had this error, and it turned out to be my disk space was too low. However it seems there can be other causes too (basically anything that prevents writing to the disk, including permissions or antivirus programs). See All Platforms Exporting Error · Issue #54413 · godotengine/godot · GitHub