It is currently Thu Dec 18, 2014 4:36 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Tonido Shell Applications Hangs often.
PostPosted: Mon Nov 14, 2011 9:41 am 
Super Tonidoid
Super Tonidoid
Joined: Fri Sep 03, 2010 9:43 pm
Posts: 38

Hello,

I've been running into this issue while trying to connect to an SFTP server from the Tonido Shell App, It hangs with the following error :

Oops! Looks like the code monkeys have been goofing off again.
Please refer to this error log when communicating with the developer.
The developer can be reached in the Tonido Forums or by email.

File: http://blah.tonidoid.com/dyn/tonidoshel ... aders=true at line # 1

Error: Uncaught SyntaxError: Unexpected token A

The only way to recover is to restart the plug. Please let me know if you want to take a look at the logs.

Screenshot attached


Attachments:
Tonido.png
Tonido.png [ 37.82 KiB | Viewed 1712 times ]
Offline
 Profile  
 Post subject: Re: Tonido Shell Applications Hangs often.
PostPosted: Mon Nov 14, 2011 12:12 pm 
Admin Tonidoid
Admin Tonidoid
User avatar
Joined: Tue Dec 30, 2008 12:13 am
Posts: 8480
Location: Dallas, USA

Moving this to thirdparty apps.


Offline
 Profile  
 Post subject: Re: Tonido Shell Applications Hangs often.
PostPosted: Mon Nov 14, 2011 12:41 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 504

What kind of commands are you running? I need to understand the context.

It is important to understand a few things about Tonido Shell. Tonido Shell, though useful, does not have a real session open on your plug. It is simply taking one shot commands and executing them on your system (these commands really need to finish in 30 seconds; PHPs default timeout is 30 seconds). It tracks things like folders etc, and uses a combination of Javascript and PHP to give you a couple extra features like downloading, uploading, file editing, etc., but that is about as far as it goes.

So, what I am saying is this: If you are running a command that requires user input after execution, or launching a gui, or a command line program that expects to then have focus via the command line, you cannot do this.

You can start daemons etc, and even run commands that take longer than 30 seconds, but you have to turn off "Response" in Tonido Shell (This essentially pipes stdout and stderr to /dev/null or the Windows equivalent if you are on Windows. You could also pipe your output to a file and check it later, both are actually acceptable. Also, the default timeout can be changed in PHP, but you would have to do this modification manually).

There are more complex ways to implement Tonido Shell that could provide access to an actuall session, but that is not the intention here. Tonido Shell is not meant to completely replace SSH, but to provide a quick and easy solution for common tasks that are too complex for a the traditional file manager.

With this info, let me know exactly what you are doing, and if it falls into one these unsupported categories.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: Tonido Shell Applications Hangs often.
PostPosted: Mon Nov 14, 2011 1:33 pm 
Super Tonidoid
Super Tonidoid
Joined: Fri Sep 03, 2010 9:43 pm
Posts: 38

Thanks for the prompt response :

From my past experience the following commands will cause the application to crash :

sftp -o Identityfile=/root/.ssh/id_rsa -o Port=2222 dummy@dummy.dyndns.com

nohup sftp -v -o Identityfile=/root/.ssh/id_rsa -o Port=2222 dummy@dummy.dyndns.com:Video/Test/Test.avi /media/disk2part1/Videos/ &


Offline
 Profile  
 Post subject: Re: Tonido Shell Applications Hangs often.
PostPosted: Mon Nov 14, 2011 1:56 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 504

As stated earlier, Tonido Shell cannot handle interactive command line utilities.

This is from the sftp manpage. I have made bold the items of interest.
Quote:
sftp is an interactive file transfer program, similar to ftp(1), which performs all operations over an encrypted ssh(1) transport. It may also use many features of ssh, such as public key authentication and compression. sftp connects and logs into the specified host then enters an interactive command mode.
The second usage format will retrieve files automatically if a non-interactive authentication method is used; otherwise it will do so after successful interactive authentication.

The last usage format allows the sftp client to start in a remote directory.
The options are as follows:

-b batchfile
Batch mode reads a series of commands from an input batchfile instead of stdin Since it lacks user interaction it should be used in conjunction with non-interactive authentication. sftp will abort if any of the following commands fail: get , put , rename , ln rm , mkdir , chdir , lchdir and lmkdir


You might want to try batchfile non-interactive method and see if you get better luck.

_________________
My Tonido Plugins:


Offline
 Profile  
 Post subject: Re: Tonido Shell Applications Hangs often.
PostPosted: Mon Nov 14, 2011 4:52 pm 
Tonido MVP
Tonido MVP
User avatar
Joined: Sun Sep 05, 2010 6:21 pm
Posts: 504

FYI, the hang is more than likely Tonido Shell waiting for a response which it never gets because the command line utility is waiting for a response. This is why Tonido Shell hangs.

For the life of me, I still cannot find any documentation to get proc_open to timeout in PHP. And I have tried dozens of things. In your case, you could have done a grep for the pid of sftp and just killed it, and then would have probably restored functionality to your PHP apps.

_________________
My Tonido Plugins:


Offline
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


 Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: