Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Permission denied when pushing code (http://www.chiefdelphi.com/forums/showthread.php?t=141710)

Jameel 01-14-2016 11:54 AM

Permission denied when pushing code
 
Our team is running into a few issues pushing code to the roboRIO so we thought we could post here to find help. When we try to 'clean project' an error occurs saying "Cannot run program "rm": Launching failed.

When we try to deploy we get "Remote command failed with exit status 1." There is also "Permission denied" printed on every other line in the console.

We can't seem to solve these problems and any help would be greatly appreciated

Thanks!!

bob.wolff68 01-14-2016 09:22 PM

Re: Permission denied when pushing code
 
Windows or Mac or Linux?

RufflesRidge 01-14-2016 09:24 PM

Re: Permission denied when pushing code
 
Have you set a password on your roboRIO for the admin account?

SuperBK 01-14-2016 11:34 PM

Re: Permission denied when pushing code
 
I see the Cannot run program "rm": Launching failed message as well, on windows, but the project does get cleaned. I also asked about it in another thread.

fsilberberg 01-15-2016 09:00 AM

Quote:

Originally Posted by RufflesRidge (Post 1523938)
Have you set a password on your roboRIO for the admin account?

Or the lvuser account.

snekiam 01-16-2016 03:44 PM

Having this same problem on a freshly imaged roborio, with windows. Anybody have any ideas?

RufflesRidge 01-16-2016 04:46 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by snekiam (Post 1524923)
Having this same problem on a freshly imaged roborio, with windows. Anybody have any ideas?

Can you please post the complete download log from the Eclipse window?

Jameel 01-22-2016 02:32 AM

Re: Permission denied when pushing code
 
A few things I failed to mentioned.
- We are using Windows 7
- The roboRIO has a fresh 2016 image
- This happens on all of the laptops we try to use

After trying a bunch of things, we managed to fix this by using PuTTY to SSH into the roboRIO. We then used the "cd" command to move to the home directory for lvuser and ran "chmod u+x /home/lvuser" which essentially gives write permissions to the owner of that directory.

This is a very weird way of solving the problem but it works and I am not sure why no one else got this issue

Travis Hoffman 02-26-2016 09:48 PM

Re: Permission denied when pushing code
 
2 Attachment(s)
Quote:

Originally Posted by Jameel (Post 1528220)
A few things I failed to mentioned.
- We are using Windows 7
- The roboRIO has a fresh 2016 image
- This happens on all of the laptops we try to use

After trying a bunch of things, we managed to fix this by using PuTTY to SSH into the roboRIO. We then used the "cd" command to move to the home directory for lvuser and ran "chmod u+x /home/lvuser" which essentially gives write permissions to the owner of that directory.

This is a very weird way of solving the problem but it works and I am not sure why no one else got this issue


I just received this issue after updating (repeatedly) the firmware and image on our practice robot RoboRIO. I tried your fix but it did not seem to work. Please see below for a screenshot of the errors.

I know at least a few others on CD have reported similar to identical "permission denied" errors. I am not a hardcore programmer at all, so pretend I'm very unfamilar with Linux and SSH and all that jazz and please help me (and others) diagnose this problem quickly. Thanks in advance for the prompt assistance!

EDIT (twice...) - I was able to log in to the roboRIO using PuTTY and the admin login. I was also able to login using lvuser, but when I did, I got the same "permission denied" errors upon typing "lvuser" and pressing enter. See the other screenshot below.

Is there any chmod command or other such magic that can be employed against this impenetrable directory stronghold? Help me toss 8 boulders at this thing.

And please don't tell me to reimage the roboRIO without giving me a valid reason why I should. I've done that already. :D

Joe Ross 02-26-2016 10:22 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by Travis Hoffman (Post 1547748)
And please don't tell me to reimage the roboRIO without giving me a valid reason why I should. I've done that already. :D

Travis, you've modified the build files. In order for people to help, you'll need to detail the changes you've made. My suggestion is to reimage and reinstall wpilib so the original build files are restored.

Travis Hoffman 02-26-2016 10:32 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by Joe Ross (Post 1547760)
Travis, you've modified the build files. In order for people to help, you'll need to detail the changes you've made. My suggestion is to reimage and reinstall wpilib so the original build files are restored.

I initiated a reimage before you posted while I was waiting for someone to reply. :D

How does one correctly uninstall/reinstall wpilib?

Is there anything I need to do to my project after wpilib is reinstalled? Remove files? Rebuild?

Speaking of wpilib, I was prompted to update the WPILib plugins in Eclipse today. Did they push a new release?

Joe Ross 02-26-2016 11:05 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by Travis Hoffman (Post 1547764)
I initiated a reimage before you posted while I was waiting for someone to reply. :D

How does one correctly uninstall/reinstall wpilib?

In eclipse, go to help->installation details and select Robot C++ Development (and Java if it's also installed), and press uninstall. Then, for good measure, delete c:\users\<user>\wpilib

Quote:

Originally Posted by Travis Hoffman (Post 1547764)
Is there anything I need to do to my project after wpilib is reinstalled? Remove files? Rebuild?

Speaking of wpilib, I was prompted to update the WPILib plugins in Eclipse today. Did they push a new release?

Just a rebuild.
Last wpilib release was 2/11. I did see an eclipse update today.

Travis Hoffman 02-27-2016 10:15 AM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by Joe Ross (Post 1547776)
In eclipse, go to help->installation details and select Robot C++ Development (and Java if it's also installed), and press uninstall. Then, for good measure, delete c:\users\<user>\wpilib

Quote:

Just a rebuild.
Last wpilib release was 2/11. I did see an eclipse update today.
Done, thanks. I have reinstalled wpilib and rebuilt my project, and I will go into the school shortly to try it out. Any ideas on what to do if the problem persists?

Also, any thoughts on how I might have altered the build configuration files? I did play around in there but only after the original problem popped up and I searched for threads on this problem on CD.

FYI, I did add very basic navX MXP stuff to the include and library settings early yesterday, before the issue, but I followed the instructions on their site. I will refrain from doing any of that until I can deploy code again. I'll save the project and then play.

Travis Hoffman 02-27-2016 11:51 AM

Re: Permission denied when pushing code
 
1 Attachment(s)
Just for fun, I got the roboRIO off our 2015 competition robot, updated the firmware and imaged it EXACTLY per the instructions (i.e. how I did everything before), and I'm still getting permission denied error. This time, however, it seems to proceed to the "kill all" part of the deploy routine before faulting. See attached, updated screenshot.


Please keep the suggestions coming - I'm at the school all day today and can try anything out quickly. Obviously, this is a problem that needs solving ASAP.

Travis Hoffman 02-27-2016 03:33 PM

Re: Permission denied when pushing code
 
I just installed Eclipse et al on another laptop and used some old version of my code that worked prior to this problem, and the permission denied error occurred on deploy exactly as before.

Still hoping for some good ideas here from the community!

SuperBK 02-27-2016 08:49 PM

Re: Permission denied when pushing code
 
This popped for us today, any ideas?

Travis Hoffman 02-27-2016 09:22 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by SuperBK (Post 1548161)
This popped for us today, any ideas?


I just got ours to work...but I don't really know what I did.

I reflashed firmware and reimaged the roboRIO multiple times using our driver station Classmate and my programming laptop. No dice.

I swapped the roboRIO with another one - no dice. Same problem.

I got a completely different laptop, updated the WPI plugins, tried to deploy, no dice.

I used the same laptop to reflash and reimage the roboRIO. I deleted the project from the workspace, then reimported it and rebuilt. At this point, it downloaded. I am not even sure that action contributed to the fix.

Travis Hoffman 02-28-2016 02:51 AM

Re: Permission denied when pushing code
 
Anyone experiencing problems, please cross-post details to the FIRST Forums thread here - http://forums.usfirst.org/showthread...-During-Deploy.

Time to make it loud. :)

BradAMiller 02-28-2016 10:54 AM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by SuperBK (Post 1548161)
This popped for us today, any ideas?

If you're familiar with Linux, could you try ssh-ing to the roboRIO as lvuser and check the permissions and ownership of files in the lvuser home directory and look for anything not owned by lvuser. It seems like somehow something is getting messed up, maybe a a download failing part way through or something.

If not, I would expect that reimaging and being sure to check the reformat box in the imaging tool would get you back. If you do that, be sure to reinstall Java if that's the language you're using.

Brad

SuperBK 02-28-2016 01:37 PM

Re: Permission denied when pushing code
 
We SSH'd to the roborio as admin, then did

chmod -R 777 /home/lvuser/

To give all users read, write, and execute permissions to the folder.

lvuser was not the owner of the /home/lvuser/ folder, to we gave all permissions to everybody.

Its now working for us.

LG67 02-28-2016 01:51 PM

Re: Permission denied when pushing code
 
Spent a gazillion hours last night trying to fix the exact same problem and your solution is a life-saver. Thank you :D

AustinSchuh 02-28-2016 02:34 PM

Re: Permission denied when pushing code
 
Next time someone has an issue, please log into the roboRIO run the following command and post the output here.

Log in as admin@roboRIO-<team#>-frc.local with putty or equivilent

Then, run

Code:

ls -lah /home/lvuser/
And post the results.

SuperBK 02-28-2016 03:25 PM

Re: Permission denied when pushing code
 
After updating the Eclipse plugins, we were broken again. Something, during the deploy process is TAKING AWAY the permissions for lvuser to the /home/lvuser/ folder. This happens during or before the "killall" command.

Our fix was to modify the build.xml file and add permissions back to the lvuser folder before the copy of the code over. Note that the user "admin" is used to add the permissions back, not "lvuser"

Here is a snippit of the build.xml. We added this part
<sshexec host="${target}"
username="admin"
password="${password}"
trust="true"
failonerror="false"
command="chmod 777 /home/lvuser"/>





Code:

    <sshexec host="${target}"
              username="admin"
              password="${password}"
              trust="true"
              failonerror="false"
              command="killall -q netconsole-host || :"/>
         
          <sshexec host="${target}"
                        username="admin"
                        password="${password}"
                        trust="true"
                        failonerror="false"
                        command="chmod 777 /home/lvuser"/>

    <scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:/home/lvuser/" password="${password}" trust="true"/>


SuperBK 02-28-2016 03:45 PM

Re: Permission denied when pushing code
 
1 Attachment(s)
I attached my build.xml file. (remove the .txt extension)

carrud 02-28-2016 10:31 PM

Re: Permission denied when pushing code
 
This partially worked for me. This exact placement did not resolve the Permission Denied, but moving the line to a diff spot in the .xml worked great.

BTW, for others: this .xml for me is in wpilib/cpp/current/ant

Many thanks for posting this fix.



-Clark

rod@3711 02-29-2016 03:06 PM

Re: Permission denied when pushing code
 
I am now getting the Permission Denied feature when trying to deploy. Started today after I allowed eclipse to upgrade from 4.5.1.20150917-1200 to 4.5.1.20160218-0600.

I Tried "reverting" back in Eclipse.

I tried using FileZilla to allow all permissions to home/lvuser. My changes did not seem to stick.

I tried changing changing build.xml that is ..wpilib\cpp\current\ant adding:

<sshexec host="${target}" command="chmod 777 /home/lvuser" failonerror="false" trust="true" password="${password}" username="admin"/>

at random locations.

I tried updating the firmware in the roboRio.

I did not feel comfortable that I did any of the above steps correctly, but I am still unable to deploy code.

I will try deploying with another computer this afternoon.

SuperBK 02-29-2016 04:11 PM

Re: Permission denied when pushing code
 
You may have to ssh to your roboRio first and issue the "chmod 777 /home/lvuser" to give permission to the folder, then run the modified build.xml. . After issuing the command you can do

ls -l /home/lvuser

and see if the permissions are "drwxrwxrwx" to see if your changes take.

Do you need step-by-step instructions on how to ssh to it? I use putty, a ssh client.

After doing that, try deploying again. Post the entire contents of your build log here.

Do you see se the extra chmod command in your build log?


Add exactly this (cut and paste)

<sshexec host="${target}"
username="admin"
password="${password}"
trust="true"
failonerror="false"
command="chmod 777 /home/lvuser"/>

Above the line
<scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:/home/lvuser/" password="${password}" trust="true"/>

rod@3711 02-29-2016 05:16 PM

Re: Permission denied when pushing code
 
Thanx Brian,

When I had previously tried to set permissions with filezilla, I had logged on as lvuser. It probably did not the right privileges. Logged on as admin and the permission changes stuck.

Added your "chmod 777" to build.xml and voila.

You will be receiving good karma credits.

Travis Hoffman 02-29-2016 05:39 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by rod@3711 (Post 1549101)
I am now getting the Permission Denied feature when trying to deploy. Started today after I allowed eclipse to upgrade from 4.5.1.20150917-1200 to 4.5.1.20160218-0600.

I THINK THIS IS KEY. The computer that works and deploys code has MARS.1 installed (4.5.1.20150917-1200). The computer that started flaking out and throwing permission denied errors has MARS.2 (4.5.1.20160218-0600), which I installed shortly prior to this problem occurring.

I will use the build.xml hack in an emergency, but I hope the developers investigate this potential blar with Eclipse developers.

taichichuan 03-01-2016 12:53 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by Travis Hoffman (Post 1549185)
I THINK THIS IS KEY. The computer that works and deploys code has MARS.1 installed (4.5.1.20150917-1200). The computer that started flaking out and throwing permission denied errors has MARS.2 (4.5.1.20160218-0600), which I installed shortly prior to this problem occurring.

I will use the build.xml hack in an emergency, but I hope the developers investigate this potential blar with Eclipse developers.

We're seeing this same issue here at 116. I wiped out the updated Mars.1 eclipse and installed Mars.2 with the exact same results -- permission denied. I still have the original Mars.1 install package. I'll try that, but I suspect that it will work until the update rolls in.

Mike A.
Mentor
FRC #116

SuperBK 03-01-2016 01:13 PM

Re: Permission denied when pushing code
 
I did put on updates and after that the error occurred. I thought it was just WPI plugins, but it looks like at some point between Feb 13 and Feb 29, the update also updated Eclipse to 4.5.2 4.5.2.20160218-0600

Astropolly 03-01-2016 02:10 PM

Re: Permission denied when pushing code
 
I'm having the same problem. Everything worked previously when I had Mars 1 installed. Now I have Mars 2 and I can't deploy code. I can't actually say if that is the problem though.
I used PuTTY to ssh into the roboRIO, and I used the chmod command as explained on these threads. I then tried to deploy code - without resetting anything, but I got the error
..\wpilib.cpp\current\ant\buil.xml:78: server indicted an error: scp: /home/lvuser//robotCommand: Permission denied .

the results of the ls -lah /home/lvuser/ command show
admin@roboRIO-1138-FRC:~# ls -lah /home/lvuser/
total 10292
drw-r--r-- 4 lvuser ni 656 Mar 1 10:39 .
drwxr-xr-x 5 admin administ 416 Jun 5 2015 ..
-rwxrwxrwx 1 lvuser ni 410 Apr 30 2015 .bashrc
-rwxrwxrwx 1 lvuser ni 152 Apr 30 2015 .profile
-rw-r--r-- 1 lvuser ni 10.0M Mar 1 10:39 FRCUserProgram
lrwxrwxrwx 1 admin ni 42 Dec 17 10:34 FRC_UserProgram.log -> /var/local/natinst/log/FRC_UserProgram.log
lrwxrwxrwx 1 admin ni 22 Dec 17 10:31 README_File_Paths.txt -> /README_File_Paths.txt
drwxrwxrwx 3 lvuser ni 232 Dec 17 10:34 frc
drwxrwxrwx 4 lvuser ni 296 Dec 17 10:35 natinst


I will try making the changes to the build.xml file, but I was expecting this to work at least the first time

I am so lost. Please help

SuperBK 03-01-2016 02:37 PM

Re: Permission denied when pushing code
 
log in with putty and issue the chmod 777 /home/lvuser/ command again. Then make the change to the build.xml file before trying to deploy code.

Add
<sshexec host="${target}"
username="admin"
password="${password}"
trust="true"
failonerror="false"
command="chmod 777 /home/lvuser"/>


right before this line:
<scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:/home/lvuser/" password="${password}" trust="true"/>

taichichuan 03-01-2016 03:45 PM

Re: Permission denied when pushing code
 
1 Attachment(s)
OK, so based on the inputs from several on this thread, I've created a new build.xml that solves all of the permission problems and successfully deploys code from within Eclipse. I've attached it to this post.

Simply, copy the build.xml.txt file to:

c:\Users\<username>\wpilib\cpp\current\ant\build.x ml

(Make sure to substitute your user name and it should be build.xml -- for some reason the formatting is inserting what looks like a space between the x and the ml)

And the deploy will start working again. This does 2 chmods and that seems to correct the problem until Brad & Co. can find the real fix.

HTH,

Mike A.
FRC #116

BradAMiller 03-01-2016 05:19 PM

Re: Permission denied when pushing code
 
We just published an update to the eclipse plugins, both the release and stable versions.

Can anyone with the problem with the C++ permissions please try to update your version of the eclipse plugins and verify that it's working for you? If you could reimage the roboRIO just to make sure that everything is reset back to the way it should be that would be helpful. The new version copies some of the files to the roboRIO slightly differently than before.

FYI: there is also an updated C++ camera server class and the version number has been bumped up from 4 to 5. Otherwise this and the previous version should be the same.

Brad

taichichuan 03-01-2016 05:35 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by BradAMiller (Post 1549783)
We just published an update to the eclipse plugins, both the release and stable versions.

Can anyone with the problem with the C++ permissions please try to update your version of the eclipse plugins and verify that it's working for you? If you could reimage the roboRIO just to make sure that everything is reset back to the way it should be that would be helpful. The new version copies some of the files to the roboRIO slightly differently than before.

FYI: there is also an updated C++ camera server class and the version number has been bumped up from 4 to 5. Otherwise this and the previous version should be the same.

Brad

Hi Brad,

Sorry, the fix didn't seem to fix the problem. I'm using the Mars.2 release of Eclipse, BTW. Here's the output of the "Run as" output:


Buildfile: C:\Users\mike\workspace-2016\ExampleBoard\build.xml
Trying to override old definition of task classloader
get-target-ip:
[echo] Trying Target: roboRIO-116-FRC.local
[echo] roboRIO found via mDNS
dependencies:
[echo] roboRIO image version validated
deploy:
[sshexec] Connecting to roboRIO-116-FRC.local:22
[sshexec] cmd : rm -f /home/lvuser/FRCUserProgram
[sshexec] Could not chdir to home directory /home/lvuser: Permission denied
[sshexec] rm: can't stat '/home/lvuser/FRCUserProgram': Permission denied
[sshexec] Remote command failed with exit status 1
[echo] [athena-deploy] Copying code over.
[scp] Connecting to roboRIO-116-FRC.local:22

BUILD FAILED
C:\Users\mike\wpilib\cpp\current\ant\build.xml:67: server indicated an error: scp: /home/lvuser/FRCUserProgram: Permission denied

Total time: 5 seconds


Anything else you need to help debug the issue?

HTH,

MikeA
FRC #116

fsilberberg 03-01-2016 08:44 PM

Re: Permission denied when pushing code
 
Mike,

If the permissions were broken originally, the update likely won't fix them. It should prevent it from happening in future deploys, but if /home/lvuser doesn't have exec permissions currently, nothing in this update will fix it. Does manually running a chmod +x /home/lvuser as admin, then trying to redeploy fix it?

taichichuan 03-01-2016 09:34 PM

Re: Permission denied when pushing code
 
Quote:

Originally Posted by fsilberberg (Post 1549846)
Mike,

If the permissions were broken originally, the update likely won't fix them. It should prevent it from happening in future deploys, but if /home/lvuser doesn't have exec permissions currently, nothing in this update will fix it. Does manually running a chmod +x /home/lvuser as admin, then trying to redeploy fix it?

OK, if I manually chmod the /home/lvuser directory to 0777, then the new plug-ins work.

Next, I reformatted and reinstalled V19 firmware and then reloaded V 3.0.0F0 firmware on the RoboRIO. I then tried the deploy and everything seems to work. So, you need to make sure that the RoboRIO is back to a pristine state and the new plugins seem to work.

Good work gang!

Thanks,

MikeA

BradAMiller 03-01-2016 10:38 PM

Re: Permission denied when pushing code
 
Glad to hear it's working for you now. There was a hiccup with the Java part of the install, something broke in our build, and a new version is posted that should fix that issue. Just waiting to hear some confirmation that everything is OK now.

Brad

rod@3711 03-02-2016 10:31 AM

Re: Permission denied when pushing code
 
Looks good, thanx


All times are GMT -5. The time now is 03:41 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi