Skip to content
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

"Built-in" examples fail to open #1586

Closed
3 tasks done
SuperNinja-4965 opened this issue Oct 27, 2022 · 15 comments · Fixed by #1621
Closed
3 tasks done

"Built-in" examples fail to open #1586

SuperNinja-4965 opened this issue Oct 27, 2022 · 15 comments · Fixed by #1621
Assignees
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@SuperNinja-4965
Copy link

SuperNinja-4965 commented Oct 27, 2022

Describe the problem

The Arduino IDE installation includes a collection of "built-in" example sketches that demonstrate fundamental sketch concepts. These are accessed via the "01.Basics" section of the File -> Examples menu.

These "built-in" example sketches fail to open.

The following is shown in the log:

root ERROR Request cloneExample failed with error: Sketch does not exist: [object Object]

I have verified that they do exist.

I have also reset the IDE (and all related folders) to see if that fixes it, it doesn't.

To reproduce

  1. Select File -> Examples -> 01.Basics > Blink from the Arduino IDE menus.

🐛 Nothing at all happens. The "Blink" sketch does not open. No error message is shown in the IDE UI.

Expected behavior

New window should open with example.

Arduino IDE version

2.0.1

Operating system

Linux

Operating system version

  • Arch Linux

Additional context

The bug does not occur when opening library example sketches or normal sketches.

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
@SuperNinja-4965
Copy link
Author

Worth mentioning that the error is reproducible inside and outside of flatpak.

@kittaakos kittaakos added the topic: code Related to content of the project itself label Oct 27, 2022
@kittaakos kittaakos self-assigned this Oct 27, 2022
@maxmbed
Copy link

maxmbed commented Oct 28, 2022

I am facing this is issue as well with latest version of IDE 2.0 available on Arduino website (appimage).
Example cannot be loaded with same error of OP.

@per1234 per1234 changed the title Example sketches fail to open "Built-in" examples fail to open when using Linux AppImage package Oct 28, 2022
@per1234 per1234 added the os: linux Specific to Linux operating system label Oct 28, 2022
@per1234
Copy link
Contributor

per1234 commented Oct 28, 2022

Thanks for the report!

I am able to reproduce it and bisected the introduction of the bug to da22f1e / #1333 (does not occur when using the AppImage built from the previous commit 32b70ef

@SuperNinja-4965
Copy link
Author

SuperNinja-4965 commented Oct 31, 2022

@per1234 you changed my report to add the line:

The bug does not occur when using the ZIP package of the IDE.

but this is incorrect. ALL of my testing was done with the zip package. I never tested with the appimage

@per1234 per1234 changed the title "Built-in" examples fail to open when using Linux AppImage package "Built-in" examples fail to open Nov 1, 2022
@per1234
Copy link
Contributor

per1234 commented Nov 1, 2022

Thanks for the correction. For me, opening the "built-in" examples works perfectly when using the ZIP package. However, when using the AppImage package I am able to reproduce the bug.

I am using Ubuntu 20.04

I would suggest that anyone experiencing this bug who is using the AppImage package try the ZIP package as a workaround. Evidently that is not guaranteed to fix it, but it works for me at least.

@kittaakos
Copy link
Contributor

AppImage:

  • cwd: /home/parallels/Desktop/dev/arduino-ide/electron/build/dist
  • start: ./arduino-ide_2.0.2-snapshot-d92ef90_Linux_64bit.AppImage
    root INFO cloneExample file:///tmp/.mount_arduin6hMpJz/resources/app/node_modules/arduino-ide-extension/Examples/01.Basics/AnalogReadSerial
    root INFO resolved dir path /tmp/.arduinoIDE-unsaved2022103-20291-18nauuj.e44q
    root INFO cloneExample {"name":"AnalogReadSerial","uri":"file:///tmp/.mount_arduin6hMpJz/resources/app/node_modules/arduino-ide-extension/Examples/01.Basics/AnalogReadSerial","mainFileUri":"file:///tmp/.mount_arduin6hMpJz/resources/app/node_modules/arduino-ide-extension/Examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino","otherSketchFileUris":[],"additionalFileUris":[],"rootFolderFileUris":[],"mtimeMs":1667488104000} /tmp/.arduinoIDE-unsaved2022103-20291-18nauuj.e44q
    root INFO cloneExample file:///tmp/.arduinoIDE-unsaved2022103-20291-18nauuj.e44q/AnalogReadSerial
    root ERROR Request cloneExample failed with error: Sketch does not exist: {"name":"AnalogReadSerial","uri":"file:///tmp/.mount_arduin6hMpJz/resources/app/node_modules/arduino-ide-extension/Examples/01.Basics/AnalogReadSerial","mainFileUri":"file:///tmp/.mount_arduin6hMpJz/resources/app/node_modules/arduino-ide-extension/Examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino","otherSketchFileUris":[],"additionalFileUris":[],"rootFolderFileUris":[],"mtimeMs":1667488104000}
    

Unpacked:

  • cwd: /home/parallels/Desktop/dev/arduino-ide/electron/build/dist
  • start: ./linux-unpacked/arduino-ide
    root INFO cloneExample file:///home/parallels/Desktop/dev/arduino-ide/electron/build/dist/linux-unpacked/resources/app/node_modules/arduino-ide-extension/Examples/01.Basics/AnalogReadSerial
    root INFO resolved dir path /tmp/.arduinoIDE-unsaved2022103-21302-8hjlxu.owhyg
    root INFO cloneExample {"name":"AnalogReadSerial","uri":"file:///home/parallels/Desktop/dev/arduino-ide/electron/build/dist/linux-unpacked/resources/app/node_modules/arduino-ide-extension/Examples/01.Basics/AnalogReadSerial","mainFileUri":"file:///home/parallels/Desktop/dev/arduino-ide/electron/build/dist/linux-unpacked/resources/app/node_modules/arduino-ide-extension/Examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino","otherSketchFileUris":[],"additionalFileUris":[],"rootFolderFileUris":[],"mtimeMs":1667488101567.6284} /tmp/.arduinoIDE-unsaved2022103-21302-8hjlxu.owhyg
    root INFO cloneExample file:///tmp/.arduinoIDE-unsaved2022103-21302-8hjlxu.owhyg/AnalogReadSerial
    root INFO resolved dir path /tmp/.arduinoIDE-unsaved2022103-21302-1v4rlqr.t00b
    

kittaakos pushed a commit that referenced this issue Nov 3, 2022
The original (`fs-extra`-based) implementation did not check if the
file is writable either.

Resources are not writable in mounted AppImages.

Closes #1586

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos
Copy link
Contributor

The bug does not occur when using the ZIP package of the IDE.

but this is incorrect. ALL of my testing was done with the zip package. I never tested with the appimage

@joshuag1000, could you please tell us the exact command you executed to start the app zip package? How did you unarchive the ZIP? We found and fixed the problem in #1621, but we could not reproduce the defect with the ZIP version. It only happened with the app image. Thank you!

@SuperNinja-4965
Copy link
Author

The bug does not occur when using the ZIP package of the IDE.

but this is incorrect. ALL of my testing was done with the zip package. I never tested with the appimage

@joshuag1000, could you please tell us the exact command you executed to start the app zip package? How did you unarchive the ZIP? We found and fixed the problem in #1621, but we could not reproduce the defect with the ZIP version. It only happened with the app image. Thank you!

I'm not at my computer right now but I was running the app in a read only environment (the same way the app image does it) so they are probably related by that. I will double check though

@SunyataZero
Copy link

Hi all, i'm a complete newbie to Arduino and the IDE, and have just bought the starter kit today, i'm excited about this!

I had the same problem (loading example files) when using the AppImage, but not when running from the extracted .zip file

Just wanted to let you people know. Hope this helps

I am running Ubuntu 22.04

@M15071060
Copy link

I just wanted to add my testing. On popOS 22.04.

  • Using the 2.0.1 AppImage downloaded from the site fails to load example files.
  • Installing 2.0.1 from the app store (pop shop) fails to load example files.
  • Running from .zip works as anticipated, correctly loading examples in a new window.

Legacy app version from the app store also work as expected, for what that's worth.

@SuperNinja-4965
Copy link
Author

I just wanted to add my testing. On popOS 22.04.

* Using the 2.0.1 AppImage downloaded from the site fails to load example files.
 * Installing 2.0.1 from the app store (flatpak) (pop shop) fails to load example files. - this is because of the read only nature like app images so will most likely be fixed with the same fix as the appimage
* Running from .zip works as anticipated, correctly loading examples in a new window.

Legacy app version from the app store also work as expected, for what that's worth.

@kittaakos after retesting this is also what i get. I might have gotten confused with my testing last time. sorry for the confusion

kittaakos pushed a commit that referenced this issue Nov 10, 2022
The original (`fs-extra`-based) implementation did not check if the
file is writable either.

Resources are not writable in mounted AppImages.

Closes #1586

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@per1234 per1234 added type: enhancement Proposed improvement conclusion: resolved Issue was resolved and removed type: enhancement Proposed improvement labels Nov 10, 2022
@Rayl11
Copy link

Rayl11 commented Nov 16, 2022

Sorry, I'm pretty knew to Linux and Arduino. I'm getting the same error, even with the zip.

I used the guide at https://docs.arduino.cc/software/ide-v1/tutorials/Linux#extract-the-package , but there is no install.sh in the unzipped directory. When I run ./arduino-ide the built-in examples won't load. Am I missing a step?

I unzipped the package to my home folder using 'unzip arduino-ide_2......'

I can open examples from the Aruino Uno but not the built-in examples.

Using Fedora 36 btw

@per1234
Copy link
Contributor

per1234 commented Nov 16, 2022

I'm getting the same error, even with the zip.

Thanks for your report @Rayl11. Please try it again using the nightly build of Arduino IDE and then let us know whether the problem still occurs. The bug fix is in the nightly, so we would expect you can open the examples when using the nightly. The download links for the nightly build are listed here:

https://www.arduino.cc/en/software#nightly-builds

I used the guide at https://docs.arduino.cc/software/ide-v1/tutorials/Linux#extract-the-package , but there is no install.sh in the unzipped directory.

Those are the instructions for Arduino IDE 1.x. You can find the instructions for Arduino IDE 2.x here:

https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-downloading-and-installing

@M15071060
Copy link

@Rayl11

Sorry, I'm pretty knew to Linux and Arduino. I'm getting the same error, even with the zip.

Never apologize for being new.

I just tested 2.0.1 (not nightly) in a Fedora 36 VM and, once the .zip is expanded, and it ran without issue, including examples. Are you in the unzipped folder when running the ./arduino-ide command? Sorry if that's obvious as well, (I'm new too) but figured I'd try to help out.

@Rayl11
Copy link

Rayl11 commented Nov 17, 2022

@per1234 Wow! Didn't expect such a quick response. When I had commented I had given up for the night. Using the nightly build fixed it! Thanks!

@M15071060 I was inside the unzipped folder, but still no dice. I don't think that would be too obvious to suggest for someone who is new. Thanks for the help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants