Tonido Shell Applications Hangs often.

Questions related to developing on the Tonido Platform
dhanrale
Super Tonidoid
Super Tonidoid
Posts: 40
Joined: Fri Sep 03, 2010 9:43 pm

Tonido Shell Applications Hangs often.

Postby dhanrale » Mon Nov 14, 2011 9:41 am

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 2536 times

User avatar
madhan
Admin Tonidoid
Admin Tonidoid
Posts: 8601
Joined: Tue Dec 30, 2008 12:13 am
Location: Austin, TX, USA
Contact:

Re: Tonido Shell Applications Hangs often.

Postby madhan » Mon Nov 14, 2011 12:12 pm

Moving this to thirdparty apps.

User avatar
facelessuser
Tonido MVP
Tonido MVP
Posts: 504
Joined: Sun Sep 05, 2010 6:21 pm

Re: Tonido Shell Applications Hangs often.

Postby facelessuser » Mon Nov 14, 2011 12:41 pm

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.

dhanrale
Super Tonidoid
Super Tonidoid
Posts: 40
Joined: Fri Sep 03, 2010 9:43 pm

Re: Tonido Shell Applications Hangs often.

Postby dhanrale » Mon Nov 14, 2011 1:33 pm

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/ &

User avatar
facelessuser
Tonido MVP
Tonido MVP
Posts: 504
Joined: Sun Sep 05, 2010 6:21 pm

Re: Tonido Shell Applications Hangs often.

Postby facelessuser » Mon Nov 14, 2011 1:56 pm

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.
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.

User avatar
facelessuser
Tonido MVP
Tonido MVP
Posts: 504
Joined: Sun Sep 05, 2010 6:21 pm

Re: Tonido Shell Applications Hangs often.

Postby facelessuser » Mon Nov 14, 2011 4:52 pm

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.


Return to “Tonido Platform Development”

Who is online

Users browsing this forum: No registered users and 1 guest