New IDE ins't saving files correctly

Hi. I tried searching the forum but couldn't find an answer to this. I recently upgraded the Arduino IDE to version 2.1.0 (2023-04-19 CLI Version: 0.32.2). After I did the upgrade, I opened a file and made some edits, but the Save As function isn't actually saving a new file. No matter where I try to save or what name I use, it just saves the edits to the old file name and never creates a new file with the updated file name.
I have a second computer in the same room, and it has the Arduino IDE installed but not updated to this most recent version. On that computer I can make edits and save the file as expected with no problems.
The un-updated computer is running Windows 10, the computer with the recently updated IDE is running Windows 11. Both computers have had no problems in the past with saving code and uploading code to a wide variety of boards. This problem only started after the recent update to the IDE.
Does anyone else have this problem? Any suggestions on what I might try to fix it? Can I roll the IDE version back or something?

Thanks for your help!

This sounds very much like this thread.

See if you can save your file to a USB drive or other HD location.

Hmmm. This seems very similar. I took the advice, however, I tried saving to the original folder, saving a level above that, saving a level above that, all the way up until i was on the C drive. None of the copies saved.
Then I tried saving to a USB drive, also with no luck.

Because it threw an error when I tried to save to the C drive, I'm thinking it may be that I have a problem similar to 'you didn't install as an administrator', but I'm still working on that hypothesis.

In the meantime, I'm still unable to Save As to a unique file. :frowning:

Your topic has been moved to the dedicated IDE2.0 section of the forum.

Thanks for reporting it.

Which one is the working version, @chromorphous?

For example, do you try to save from C: to D:?

Can I roll the IDE version back or something?

I am unaware of a rollback feature in the IDE, but you can always download an earlier version from the release page. However, it would be valuable to figure out the problem first. Could you please help us with the log files? If yes, please reference this comment on how to get the IDE2 log files on Windows. If you need assistance, please ask. Thanks!

So, I did a little more testing, and here's what I found.

First of all, in the Arduino IDE, in the Preferences setting, I have the Sketchbook location set to a custom path (my Dropbox folder).

Opening a file (by double clicking on the file in windows explorer) that is in a sub-directory of the Sketchbook location opens the Arduino IDE and correctly loads the file in question. Next, I choose the Save As function and modify the filename to a new name. The file will not save with that new name regardless of where I try to save the file (in this case, on the Desktop).

Next, I manually copied the sketch to the Desktop. I double click on the file and the Arduino IDE starts and the correct file is loaded. However, this time I choose Save As and change the file name, and the file DOES correctly save. The file can be correctly saved to anywhere on the computer, including the Sketchbook location that I specified in Preferences.

So it looks like I can only save files if the original file location is outside of the Sketchbook location directory.

I tried adding the log file here, but apparently "New users can't upload files."

The relevant part of the log file is as follows:
2023-05-03 16:50:40 2023-05-03T20:50:40.764Z root ERROR Request copy failed with error: Cannot copy c:\Users\golds\Dropbox\UCF Stuff\Chromorphous Projects\Demos (Rev 3)\DemoTShirt\BT_Demo_Tshirt04\BT_Demo_Tshirt04: the file doesn't exist

I hope this helps!

Thanks for the input.

I have a couple of follow-up questions if you're willing to help us.

  • Which one is the working version, @chromorphous?

  • Does your other computer have the same setup: the sketchbook path points to a Dropbox folder?
  • Does Save as work if you set the sketchbook path to an ordinary folder?

The relevant part of the log file is as follows:

Could you share the entire log file? I am sure you did a great job of filtering out irrelevant parts from the log, but I would like to also look into it if possible.

I also set up Dropbox and tried it with IDE2 version 2.1.0 on both macOS and Windows; save as worked for me when the sketchbook path was my Dropbox folder.

On the technical part, IDE2 used to use an inefficient way of copying sketches from one place to another. The previous way of copying the files was added to workaround an issue: arduino/arduino-ide#211. In a nutshell, IDE2 is used to copy the sketch into a temp location and then to the destination location. This way of copying the files does not exist. Maybe Dropbox is "syncing the files" during the IDE2 save as operation.

The problem is caused by the Demos (Rev 3) path segment. More precisely, the issue is the (Rev 3) part. For now, please rename Demos (Rev 3) to Demos Rev 3; it should work. Apparently, () and [] are not allowed due to a bug in a lib IDE2 uses. (Related from GitHub: on Mar 10.)

I will open a formal bug report and look at the issue later.

Thanks for letting us know.


It's tracked here: `Save as` fails when the path to the sketch contains parentheses `()` or brackets `[]` · Issue #2043 · arduino/arduino-ide · GitHub

Blockquote Which one is the working version, @chromorphous?

As mentioned in the first post, the working computer is running Windows 10 and has not been updated to the most recent version of the IDE. The not working version is running Windows 11 and has been updated to the most recent IDE.
Just for reference, the version of the IDE that has this new problem is 2.1.0 (2023-04-19 CLI Version: 0.32.2). The older version that still works is 2.0.4(2023-02-27T16:14:28.576Z CLI Version: 0.31.0).

Blockquote Could you share the entire log file?

Maybe I wasn't clear when I first mentioned this, but when I try to upload a file to the forum, I get an error that reads "Sorry, new users cannot upload attachments." I would copy and paste the text from the log here, but just the act of loading the IDE creates a pretty hefty amount of text.

Blockquote Does your other computer have the same setup: the sketchbook path points to a Dropbox folder?

Yes, the other computer with the older version of the IDE has the same path for the sketchbook. Again, just for clarity's sake, the older version of the IDE has no problems saving anything to anywhere, even when there are parentheses in the file path. The parentheses seems to work fine in every version of the IDE up to at least 2.0.4. I have been using this directory structure successfully for a long time. It only started failing immediately after I moved to version 2.1.0.

Blockquote Does Save as work if you set the sketchbook path to an ordinary folder?

I did some additional testing. Again, for clarity's sake, let me state that the path of the sketchbook is c:\Users\golds\Dropbox\. The folder that I am having problems with is a sub-folder of what the path of the sketchbook is actually set to. So I copied a file to a different sub-folder that is still in the dropbox folder, but that does not have parentheses in the path. From there I was able to open the file and correctly save it again. Next, I conducted another test where I created a folder on the desktop and that folder had parentheses in the folder name. Then I copied a file in to that folder, opened it, and tried to save it again. That operation failed. Next, I opened a file from the desktop and attempted to save it to a folder that had parentheses in the name. That operation was successful.
This basically confirms that the problem is the parentheses in the path and has nothing to do with the path that the sketchbook is set to.

So, to summarize, it appears that the latest release of the IDE (version 2.1.0) has a bug which prevents the IDE from saving a file if that file currently resides at a path that contains parentheses. Specifically, the IDE can save a file to a path that has a parentheses, but can not save a file anywhere if the current location of that file is a path that has a parentheses.
For example, imagine that you have two folders on your C drive; C:\Folder1 and C:\Folder(2). If you open a file in Folder1, you can save it to Folder(2). However, if you open a file in Folder(2), you cannot save it anywhere on the computer.

To solve this problem for myself, I'm just going to reinstall an older version of the IDE, since that will be easier than tracking down every folder I have that has a parentheses.

I hope this helps resolve the bug. I really appreciate everyone's help with getting this solved for me!

It sounds like the problem was already identified, but if you do need to make attachments, you should be able to do it now that you have been promoted to the forum software's "basic user" trust level, which allows making file attachments.

1 Like

The fix is available from the nightly build: https://www.arduino.cc/en/software#nightly-builds. Thank you for the help figuring out the root cause of the bug :muscle:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.