Skip to content

Board package installation fails when user profile is stored at a junction folder #2658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
a-nanasov opened this issue Mar 12, 2025 · 1 comment
Closed
3 tasks done
Assignees
Labels
conclusion: invalid Issue/PR not valid topic: CLI Related to Arduino CLI type: imperfection Perceived defect in any part of project

Comments

@a-nanasov
Copy link

a-nanasov commented Mar 12, 2025

Describe the problem

Arduino IDE is storing hardware packages in the folder C:\Users\<username>\AppData\Local\Arduino15\packages\arduino\hardware. If this folder or any of its parents is a symlink (or junction in Windows terminology), then Boards Manager fails to install and load existing board packages.
And Arduino IDE log contains the following entry during startup:

ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Error loading hardware platform: following symlink c:\Users\<username>\AppData\Local\Arduino15\packages: EvalSymlinks: too many links

To reproduce

  • Run cmd.exe with administrator privileges
  • Create a junction for packages folder:
    mklink /J "C:\hardware" "%USERPROFILE%\AppData\Local\Arduino15\packages\arduino\hardware"
  • Run Arduino IDE and install any board package using Board Manager
  • Ensure the installed package wasn't installed and not available

Expected behavior

  • A new board package is installed and available
  • Failed board packages installation should fail explicitly and show an error to the user
  • IDE allows to use a custom directory for storing its settings for cases when a user profile is stored in junction folder and cannot be used for storing board packages

Arduino IDE version

2.3.4

Operating system

Windows

Operating system version

Windows 11

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@a-nanasov a-nanasov added the type: imperfection Perceived defect in any part of project label Mar 12, 2025
@per1234 per1234 self-assigned this Apr 12, 2025
@per1234 per1234 added the topic: CLI Related to Arduino CLI label Apr 12, 2025
@per1234
Copy link
Contributor

per1234 commented Apr 12, 2025

Hi @a-nanasov.

If this folder or any of its parents is a symlink (or junction in Windows terminology), then Boards Manager fails to install and load existing board packages.

I just gave it a try with a valid file junction configuration and it worked fine for me.

following symlink c:\Users\<username>\AppData\Local\Arduino15\packages: EvalSymlinks: too many links

Here we see the real cause of your problem. This error occurs when you have created a loop, where the link contains a link to itself. It is not possible for Arduino IDE to work with a filesystem that produces this condition.

You need to carefully check through the folder to find and remove the link that is causing the loop. Or if the folder doesn't contain any unique data (i.e., modifications you made to the platforms), then simply delete it and then use the Arduino IDE Boards Manager to reinstall the platforms. That should fix the problem. After that, make sure to be careful when you are creating file junctions so that you don't create loops.

Create a junction for packages folder:

mklink /J "C:\hardware" "%USERPROFILE%\AppData\Local\Arduino15\packages\arduino\hardware"

Your command doesn't make sense. The syntax of the command is:

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

mklink [[/d] | [/h] | [/j]] <link> <target>

So you are creating a link at C:\hardware that targets %USERPROFILE%\AppData\Local\Arduino15\packages\arduino\hardware. If you wanted to create a link from the folder used by Arduino to some arbitrary folder at another path, you would need to reverse the order of the arguments:

mklink /J "%USERPROFILE%\AppData\Local\Arduino15\packages\arduino\hardware" "C:\hardware"

I guess your link loop was caused by an error in your mklink commands.

Failed board packages installation should fail explicitly and show an error to the user

I agree that Arduino IDE should do a better job of communicating about this type of problem to the user. However, this is a very rare and self-inflicted problem, so it is not something we have the resources to address directly. We may address it as a matter of course through a general campaign of properly handling this class of failure. However, We are tracking the work that is required to be able to do that at arduino/arduino-cli#1762.

IDE allows to use a custom directory for storing its settings

We don't have this for Arduino IDE's settings, but it is possible to configure the location of the "data folder", which is at %USERPROFILE%\AppData\Local\Arduino15 by default:

  1. Select File > Quit from the Arduino IDE menus if it is running.
    All Arduino IDE windows will close.
  2. Start any text editor.
  3. Open the file at the following path in text editor:
    %USERPROFILE%\.arduinoIDE\arduino-cli.yaml
    
  4. Add the following text to the file:
    directories:
      data: <custom data folder path>
  5. Replace the <custom data folder path> placeholder with the path of the folder you want Arduino IDE to use instead of %USERPROFILE%\AppData\Local\Arduino15
  6. Save the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: CLI Related to Arduino CLI type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants