Error while saving a file from application to Guac virtual drive

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Error while saving a file from application to Guac virtual drive

Antony
Hi everyone:

We are trying to save directly from MS Project to the guac virtual drive. Instead of the actual file appearing in the "file transfers" section, there is a strange xxxx.tmp file that shows up. 


Similarly, when we try to save from Photoshop to the virtual drive, a tmp folder is downloaded and photoshop returns the error below.

However, If we save the file into the Upload folder, it works fine. 

Any ideas? Why does Guacamole delete the files from the download folder? Could that be related to this problem?
Inline image 1

Thank you.

--
Antony Awaida

Reply | Threaded
Open this post in threaded view
|

Re: Error while saving a file from application to Guac virtual drive

Antony
Sorry one more point:

If we save the file from the application to a Windows folder and then move it to the guac virtual drive it works fine.

Could it be because MS saves two files: a temp file that is merged with the main file and perhaps guac is not waiting for the second file?

Thanks,
Antony


On Mon, Dec 12, 2016 at 10:39 AM, Antony Awaida <[hidden email]> wrote:
Hi everyone:

We are trying to save directly from MS Project to the guac virtual drive. Instead of the actual file appearing in the "file transfers" section, there is a strange xxxx.tmp file that shows up. 


Similarly, when we try to save from Photoshop to the virtual drive, a tmp folder is downloaded and photoshop returns the error below.

However, If we save the file into the Upload folder, it works fine. 

Any ideas? Why does Guacamole delete the files from the download folder? Could that be related to this problem?
Inline image 1

Thank you.

--
Antony Awaida




--
Antony Awaida
CEO

Reply | Threaded
Open this post in threaded view
|

Re: Error while saving a file from application to Guac virtual drive

Mike Jumper
In reply to this post by Antony
On Mon, Dec 12, 2016 at 10:39 AM, Antony Awaida <[hidden email]> wrote:
Hi everyone:

We are trying to save directly from MS Project to the guac virtual drive. Instead of the actual file appearing in the "file transfers" section, there is a strange xxxx.tmp file that shows up. 


Similarly, when we try to save from Photoshop to the virtual drive, a tmp folder is downloaded and photoshop returns the error below.


Some applications do strange things when files are saved. Creating temporary files, renaming those files, moving things around, etc. Guacamole attempts to detect when a file is actually finished being saved, but there is no way to do that with 100% accuracy.

However, If we save the file into the Upload folder, it works fine. 


There is no "Upload" folder per se. Only the "Download" folder has special semantics. Everything else should operate as a normal virtual drive.

Any ideas? Why does Guacamole delete the files from the download folder? Could that be related to this problem?

Files are prevented from being saved in the "Download" folder to preserve the concepts surrounding the "Download" folder itself. It is not meant as storage, but rather as a means of signalling that a file should be downloaded whilst simultaneously giving Guacamole access to that file (when functioning as an RDP client, Guacamole cannot access any files on the RDP server - it can only access its own virtual drive).

It is effectively true that files saved directly within the "Download" folder are deleted, but this is not the way things are done in all cases. If a file is moved into the "Download" folder, for example, Guacamole transfers the data but ultimately cancels the move operation after the last byte has been received (thus preserving the original file in its original location).

If a particular application does not play nicely with the "Download" folder's behavior, the best route forward would be to save directly to the drive or elsewhere, moving the file once it has finished being saved. There is simply no way that Guacamole can detect that the file is ready in the same way a human can.

My personal recommendation would be to modify the contents of the "shell:sendto" folder on your RDP server, adding an appropriately-named shortcut to the "Download" folder:


That will allow you to download arbitrary files from the RDP server by right clicking on them.

- Mike

Reply | Threaded
Open this post in threaded view
|

Re: Error while saving a file from application to Guac virtual drive

Mike Jumper
In reply to this post by Antony
On Mon, Dec 12, 2016 at 10:45 AM, Antony Awaida <[hidden email]> wrote:
Sorry one more point:

If we save the file from the application to a Windows folder and then move it to the guac virtual drive it works fine.

Could it be because MS saves two files: a temp file that is merged with the main file

Yes.
 
and perhaps guac is not waiting for the second file?


Well ... technically, yes, but the key point is that it's impossible to *know* that there is going to be a second file (or a third ... or a fourth ... or that it will be renamed ... etc.). There is no signal between the remote application and the RDP client that informs of the true completion of a save operation.

- Mike

Reply | Threaded
Open this post in threaded view
|

Re: Error while saving a file from application to Guac virtual drive

Antony
Makes sense. 

Thanks Mike!

On Mon, Dec 12, 2016 at 10:57 AM, Mike Jumper <[hidden email]> wrote:
On Mon, Dec 12, 2016 at 10:45 AM, Antony Awaida <[hidden email]> wrote:
Sorry one more point:

If we save the file from the application to a Windows folder and then move it to the guac virtual drive it works fine.

Could it be because MS saves two files: a temp file that is merged with the main file

Yes.
 
and perhaps guac is not waiting for the second file?


Well ... technically, yes, but the key point is that it's impossible to *know* that there is going to be a second file (or a third ... or a fourth ... or that it will be renamed ... etc.). There is no signal between the remote application and the RDP client that informs of the true completion of a save operation.

- Mike




--
Antony Awaida
CEO

Reply | Threaded
Open this post in threaded view
|

Re: Error while saving a file from application to Guac virtual drive

Antony
In reply to this post by Mike Jumper
Hi again Mike:

What if we create a "staging" download folder and there is a script that checks the size the folder every X seconds. Once the size of the folder is stable, it moves the file to the actual Guac download folder?

Thanks,
Antony


On Mon, Dec 12, 2016 at 10:57 AM, Mike Jumper <[hidden email]> wrote:
On Mon, Dec 12, 2016 at 10:45 AM, Antony Awaida <[hidden email]> wrote:
Sorry one more point:

If we save the file from the application to a Windows folder and then move it to the guac virtual drive it works fine.

Could it be because MS saves two files: a temp file that is merged with the main file

Yes.
 
and perhaps guac is not waiting for the second file?


Well ... technically, yes, but the key point is that it's impossible to *know* that there is going to be a second file (or a third ... or a fourth ... or that it will be renamed ... etc.). There is no signal between the remote application and the RDP client that informs of the true completion of a save operation.

- Mike




--
Antony Awaida
CEO

Reply | Threaded
Open this post in threaded view
|

Re: Error while saving a file from application to Guac virtual drive

Mike Jumper
On Mon, Dec 12, 2016 at 12:53 PM, Antony Awaida <[hidden email]> wrote:
Hi again Mike:

What if we create a "staging" download folder and there is a script that checks the size the folder every X seconds. Once the size of the folder is stable, it moves the file to the actual Guac download folder?


And once that approach fails, will there be a staging folder for the staging folder? Turtles all the way down? ;)

You can try this, of course, but it is no more guaranteed to work than what Guacamole is already doing, and it may actually make things worse:

Your proposed heuristic assumes that a file is written continuously until the application has finished saving the file, but this will not hold in practice. What if the application writes the file slowly? What about *extremely* slowly? The heuristic would incorrectly conclude that the file is safe to download, automatically move the file to the download folder, and effectively bypass Guacamole's own heuristics, ultimately resulting in the download of a partial file.

- Mike

Reply | Threaded
Open this post in threaded view
|

Re: Error while saving a file from application to Guac virtual drive

Antony
Hi again Guac team:

We have a solution for the download problem above - we have added a button that will initiate the download process for a specific folder (it is not initiated automatically when the user saves in that folder which was the problem above).

Now, our users keep complaining about the upload- despite ample documentation on the correct process of moving files (pesky users!). They upload a .mpp file and when they try to open it using MS Project they get the error described above.

We are considering the following approach:

When uploading, what if we watch if we can grab a handle on the uploaded file on the Unix side and if yes, this means the upload is complete and we can move it to a more MS Project friendly location (e.g Desktop).

Thoughts?

Thanks!

On Mon, Dec 12, 2016 at 1:14 PM, Mike Jumper <[hidden email]> wrote:
On Mon, Dec 12, 2016 at 12:53 PM, Antony Awaida <[hidden email]> wrote:
Hi again Mike:

What if we create a "staging" download folder and there is a script that checks the size the folder every X seconds. Once the size of the folder is stable, it moves the file to the actual Guac download folder?


And once that approach fails, will there be a staging folder for the staging folder? Turtles all the way down? ;)

You can try this, of course, but it is no more guaranteed to work than what Guacamole is already doing, and it may actually make things worse:

Your proposed heuristic assumes that a file is written continuously until the application has finished saving the file, but this will not hold in practice. What if the application writes the file slowly? What about *extremely* slowly? The heuristic would incorrectly conclude that the file is safe to download, automatically move the file to the download folder, and effectively bypass Guacamole's own heuristics, ultimately resulting in the download of a partial file.

- Mike




--
Antony Awaida
CEO