File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes RasPi SSH fails sometimes with short lived session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "RasPi SSH fails sometimes with short lived session" Watch "RasPi SSH fails sometimes with short lived session" New topic
Author

RasPi SSH fails sometimes with short lived session

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9382
    
    2

I'm not sure as to what had gone wrong on my RasPi as soon as I had MongoDB installed and running. I open a terminal and ssh connect to the RasPi. After a short while, when I try to enter some commands at the console, there is no reply and a few seconds later, I'm logged out. I have to re-connect again. But this phenomenon seems to repeat quite often. Any ideas why this could be?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9382
    
    2

Here is what I see:

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9382
    
    2

Strange is that my RasPi is up and running and it is not down as per what I see on the command line terminal.
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1057
    
  10

Sounds like a memory leak and since the last thing you installed was MongoDB it would seem to be the likely culprit. Try killing the MongoDB server process after boot and then wait to see if it still fails.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9382
    
    2

Richard Tookey wrote:Sounds like a memory leak and since the last thing you installed was MongoDB it would seem to be the likely culprit. Try killing the MongoDB server process after boot and then wait to see if it still fails.


I did that multiple times and I can access the RasPi using a keyboard and a monitor connected to it, but SSH seems to be doomed. I do not completely understand why?
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1057
    
  10

I don't use MongoDB (Now I have retired I primarily use MySQL and Derby) so if killing the DB does not solve the problem then I can't help.

I would suggest you copy back the backup image which in one of your other threads you talked of creating.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9382
    
    2

Richard Tookey wrote:I don't use MongoDB (Now I have retired I primarily use MySQL and Derby) so if killing the DB does not solve the problem then I can't help.

I would suggest you copy back the backup image which in one of your other threads you talked of creating.


Backing up the image would not solve the problem either. I'm not sure what you are trying to say? I need to somehow figure out what is blocking the SSH for it to disconnect so frequently!
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1057
    
  10

Joe Harry wrote:
Richard Tookey wrote:I don't use MongoDB (Now I have retired I primarily use MySQL and Derby) so if killing the DB does not solve the problem then I can't help.

I would suggest you copy back the backup image which in one of your other threads you talked of creating.


Backing up the image would not solve the problem either. I'm not sure what you are trying to say? I need to somehow figure out what is blocking the SSH for it to disconnect so frequently!


I'm not suggesting that you backup the Pi at this point ! I'm suggesting that you restore the Pi to a known working point i.e. the backup you took before installing the DB. You did take a backup didn't you !

Once you have restored the known working system and you can prove that SSH is OK at that point you can start again with the install of the DB.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9382
    
    2

Richard Tookey wrote:

I'm not suggesting that you backup the Pi at this point ! I'm suggesting that you restore the Pi to a known working point i.e. the backup you took before installing the DB. You did take a backup didn't you !

Once you have restored the known working system and you can prove that SSH is OK at that point you can start again with the install of the DB.


The main reason that I wanted to take a back up of the RasPi OS is that I do not want to go through the hassle of compiling / installing MongoDB fresh again. This RasPi will only run MongoDB and serve as the database machine for the Web App that I'm building. Without the MongoDB on it, I do not see any valid reason to back it up as it is as good as the default OS image that I can download anytime.
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1057
    
  10

Joe Harry wrote: Without the MongoDB on it, I do not see any valid reason to back it up as it is as good as the default OS image that I can download anytime.


The problem I and others have is that we won't have access to your Pi to perform any tests. You have rejected my suggestion that you have a memory leak in MongoDB and since you say that is the only change then it must be something else. In your position I would start again and re-install the OS image to make sure there is nothing wrong with the basic setup. If that is OK then I would try to re-install MongoDB . OK that will take 7+ hours but do it overnight.

I backup the Pi before every significant change since it takes me about 4 hours to set everything up (OpenVPN, SSH, Subversion, Apache, Tomcat, MySQL etc ). I have twice needed to use the backup. The first time was when the power supply to the Pi failed and the file system became corrupted and the second time was when when an upgrade failed . Using a Cron job I backup my MySQL data at 6 AM every day.

Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1057
    
  10

Another possibility to consider. Is your 5V power supply for your Pi adequate? If one follows the Pi forums one sees that a poor power supply is a common source of problems.

I have replaced the power supply I bought with the Pi by an old variable voltage RS one I obtained for a song at a junk sale. The RS power supply if 10 times the size of the Pi but it gives a rock solid 5V at 1A and is fully isolated from the mains. I have a little 3 digit 7 segment voltmeter ( obtained for about £1 from China ) connected permanently across the output. I know this may be overkill for you at the moment but when, as you indicated in one of your other threads you will be doing, you run your Pi from your car battery you will need a 12V to 5V converter anyway. Maybe now is the time to start looking at that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RasPi SSH fails sometimes with short lived session