Skip to content

permission denied uploading on linux #309

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
jerabaul29 opened this issue Dec 11, 2020 · 7 comments
Closed

permission denied uploading on linux #309

jerabaul29 opened this issue Dec 11, 2020 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jerabaul29
Copy link

Hi,

I get some denied permission errors when trying to upload successfully compiled sketches to an Apollo Red board on Linux (Ubuntu 20.04). I wonder if there may be some need to updates some udev rules? Any idea on this?

Thanks :)

@jerabaul29
Copy link
Author

(sorry, I think the true name is Artemis red board; anyways, this one:

https://www.sparkfun.com/products/15444

@jerabaul29
Copy link
Author

jerabaul29 commented Dec 11, 2020

I tried to fix the access, but still not working. At the moment:

~$ ls -l /dev/ttyUSB0 
crw-rw---- 1 root dialout 188, 0 des.  11 13:35 /dev/ttyUSB0
~$ whoami
jrmet
~$ groups jrmet
jrmet : jrmet adm dialout cdrom sudo dip plugdev lpadmin lxd sambashare

So I would guess writing access should be ok (?), but I still get the error:

Sketch uses 118300 bytes (12%) of program storage space. Maximum is 983040 bytes.
Global variables use 27712 bytes (7%) of dynamic memory, leaving 365504 bytes for local variables. Maximum is 393216 bytes.
/home/jrmet/.arduino15/packages/SparkFun/hardware/apollo3/2.0.3/tools/uploaders/asb/dist/linux/asb --bin /tmp/arduino_build_439098/Threads.ino.bin --load-address-blob 0x20000 --magic-num 0xCB -o /tmp/arduino_build_439098/Threads.ino --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port /dev/ttyUSB0 -r 2 -v 
java.io.IOException: Cannot run program "/home/jrmet/.arduino15/packages/SparkFun/hardware/apollo3/2.0.3/tools/uploaders/asb/dist/linux/asb": error=13, Permission denied
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:620)
	at java.lang.Runtime.exec(Runtime.java:485)
	at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:11)
	at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
	at cc.arduino.packages.uploaders.SerialUploader.runCommand(SerialUploader.java:383)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:197)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2055)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: error=13, Permission denied
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 11 more
An error occurred while uploading the sketch

@jerabaul29 jerabaul29 changed the title permission denied uploading on linux - maybe need udev rules? permission denied uploading on linux Dec 11, 2020
@jerabaul29
Copy link
Author

Ok, after some more debugging, the problem was that the program in charge of uploading the firmware did not have execution rights. I did:

~/.arduino15/packages/SparkFun/hardware/apollo3/2.0.3/tools/uploaders/asb/dist/linux$ chmod +x asb

and now it seems to be able to (try to) upload.

@jerabaul29
Copy link
Author

Do you think there is a way to update the rights on the asb utility installed by the board manager in linux? :)

@oclyke
Copy link
Contributor

oclyke commented Dec 14, 2020

@jerabaul29 thanks for reporting this. we will correct the file permissions. please respond here if you find any more related issues.

@Wenn0101 we should investigate what happens to file permissions in and between these steps:

  • generation of executables from the respective uploader repositories (ASB, SVL)
  • inclusion of executables via submodules in the arduino core
  • compression / archival of the arduino core as it is published to a release

@jerabaul29
Copy link
Author

I updated to 2.0.5 today. The issue is still here (it even came back when the non-executable uploader replaced the old uploader that I had made executable).

Nothing bad for me to fix, just a small chmod +x, but for less experienced users this may be a hazzle.

@oclyke
Copy link
Contributor

oclyke commented Feb 15, 2021

hit the same issue on fresh install of v2.0.5 (macOS)
seems that the PRs for a possible fix were approved but never merged:

@Wenn0101 when you merge these PRs they will trigger a re-build of the tools. the new tools will be merged into the main branch automatically (I think - you should double check). when that is complete you'll need to update the submodules used in this core so that the latest tools are pulled in.

@ghost ghost assigned Wenn0101 Feb 26, 2021
@ghost ghost added the bug Something isn't working label Feb 26, 2021
@Wenn0101 Wenn0101 added this to the v2.0.6 milestone Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants