bug: Dragging files from network shares does not work.

All your suggestions, requests and ideas for future development
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

bug: Dragging files from network shares does not work.

Post by Andre-K »

When I drag files into the Filebot from Nautilus (file manager on Ubuntu Linux) from a smb share, like: smb://server/share - then Filebot just ignores it.
However, if I point FileBot (using load button) to the gvfs mount for that share, it works fine.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Not sure what DnD data nautilus is giving me.

Run my droplog app from here and paste me what it says when you drop files from that smb share:
http://rednoah.users.sourceforge.net/test/filebot/

EDIT: btw do you get any console output? If there's smb:// URIs aren't recognized as valid file URIs then there should be some logging.
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

This is a log made by dragging the file smb://darius/felles/IT-senteret/Ansattportal.lnk
SMB is samba share
Nautilus could also provide destinations atarting with ftp:// or nfs:// , depending on the server type.


BEGIN DRAG

Code: Select all

text/uri-list:java.io.InputStream
java.io.InputStreamReader@c3e9e9:class java.io.InputStreamReader
text/uri-list:java.io.InputStream
smb://darius/felles/IT-senteret/Ansattportal.lnk
:class java.lang.String
text/uri-list:java.io.InputStream
smb://darius/felles/IT-senteret/Ansattportal.lnk
:class java.nio.StringCharBuffer
text/uri-list:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1554d32:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
��smb://darius/felles/IT-senteret/Ansattportal.lnktext/uri-list:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=102 cap=102]:class java.nio.HeapByteBuffer
text/uri-list:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1c391c3:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/uri-list:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=50 cap=50]:class java.nio.HeapByteBuffer
text/uri-list:java.io.InputStream
[B@f1916f:class [B
text/uri-list:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1bfc4fc:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/uri-list:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=100 cap=100]:class java.nio.HeapByteBuffer
text/uri-list:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=100 cap=100]:class java.nio.HeapByteBuffer
text/uri-list:java.io.InputStream
[B@d6b059:class [B
text/uri-list:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1843a75:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/uri-list:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@10e35d5:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/uri-list:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=50 cap=50]:class java.nio.HeapByteBuffer
text/uri-list:java.io.InputStream
[B@1ce85c4:class [B
Unicode String:java.io.InputStream
smb://darius/felles/IT-senteret/Ansattportal.lnk
:class java.lang.String
text/plain:java.io.InputStream
java.io.InputStreamReader@17aece8:class java.io.InputStreamReader
text/plain:java.io.InputStream
smb://darius/felles/IT-senteret/Ansattportal.lnk
:class java.lang.String
text/plain:java.io.InputStream
smb://darius/felles/IT-senteret/Ansattportal.lnk
:class java.nio.StringCharBuffer
Plain Text:java.io.InputStream
java.io.StringReader@12bf892:class java.io.StringReader
text/plain:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=102 cap=102]:class java.nio.HeapByteBuffer
text/plain:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1c7980c:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/plain:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=50 cap=50]:class java.nio.HeapByteBuffer
text/plain:java.io.InputStream
[B@1568fb5:class [B
text/plain:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@a2220f:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/plain:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=100 cap=100]:class java.nio.HeapByteBuffer
text/plain:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=100 cap=100]:class java.nio.HeapByteBuffer
text/plain:java.io.InputStream
[B@9a9b65:class [B
text/plain:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@78aa80:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/plain:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1712651:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnkx-special/gnome-icon-list:java.io.InputStream
java.io.ByteArrayInputStream@f102d3:class java.io.ByteArrayInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnk-37:-32:48:48text/uri-list:java.io.InputStream
[C@23f1bb:class [C
text/uri-list:java.io.InputStream
[B@a0864f:class [B
text/uri-list:java.io.InputStream
[B@15983b7:class [B
text/uri-list:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@7976c1:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/uri-list:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=50 cap=50]:class java.nio.HeapByteBuffer
text/uri-list:java.io.InputStream
[B@6835fb:class [B
text/plain:java.io.InputStream
[C@bb494b:class [C
text/plain:java.io.InputStream
[B@f892a4:class [B
text/plain:java.io.InputStream
[B@df0438:class [B
text/plain:java.io.InputStream
sun.awt.datatransfer.DataTransferer$ReencodingInputStream@1684706:class sun.awt.datatransfer.DataTransferer$ReencodingInputStream
smb://darius/felles/IT-senteret/Ansattportal.lnktext/plain:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=50 cap=50]:class java.nio.HeapByteBuffer
text/plain:java.io.InputStream
[B@1552b76:class [B
text/plain:java.io.InputStream
java.nio.HeapByteBuffer[pos=0 lim=50 cap=50]:class java.nio.HeapByteBuffer
text/plain:java.io.InputStream
[B@d90453:class [B
END DRAG
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Yeah, I suppose that just doesn't work. I'd have to actually implement smb/ftp/nfs protocols to access/rename files, so no chance on that one. But since you can load files from the gvfs mount, I suppose DnD will work as well as long as it's from that local filesystem view.
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

Hi, here's a way of translating the dropped file: "SMB://server/share/file" into proper gvfs path. - like /run/user/username/gvfs/smb-share\:server\=servername\,share\=sharename/file - or, with older linux: /home/username/.gvfs ....
If you added this translation for ULI's that start with SMB: FTP: SSH:(sftp) , then FileBot would work fine with any of the sources.

Code: Select all

#!/usr/bin/env python
from gi.repository import Gio

uri='SMB://server/share/file'

gvfs=Gio.Vfs.get_default()
path=gvfs.get_file_for_uri(uri).get_path()
print path
Regards
André
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Looks to be easy with python and the gio module... haven't found any Java bindings though for these things. Not really keen on maintaining my own thing, esp. given that i don't use gnome...
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

maybe you could add this logic:
if path starts with "SMB://"
replace "SMB://" with "/run/user/%username%/gvfs/smb-share\:server\="
replace text after thrird "/" with ",share\="
endif

except for bugs,as this is just wery simple pseudo code, that would be a simple way of handling
"SMB://server/share/file"
and convert it to working:
/run/user/username/gvfs/smb-share\:server\=servername\,share\=sharename/file -


very little coding, and it would "just work" and bring lots of joy :)
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

So I got it working. AFTER 10 FUCKING HOURS OF SETTING UP LINUX IN A VM SHIT WORK and 1 hour of Java Native Access awesomeness hooking into libgio-2.0. FIXING THINGS FOR LINUX IS A FUCKING WASTE OF TIME... that's the last time i bother with that shit...
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

Glad to hear, it's a little hard to spot your happiness because of this achievement, but I am sure it'st here.
Looking forward to next release.
Thank you.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Uploaded a test release. Can do some testing with that please?
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

downloaded filebot-3.1-r1326-gvfs2.jar

Unfortunatly it did not work…
(I'll be back home in 6 hours - unable to test more till then)
this is how the path really looks ,at least in terminal, with escaped spaces: /run/user/andre/gvfs/smb-share\:server\=odin2\,share\=episodes/0_INCOMING/Primeval\ New\ World\ Season\ 1/
Last edited by Andre-K on 25 Nov 2012, 17:28, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Looks like it can't load the library. Uploaded another jar with hopefully better error logging. Probably just something with looking up the library. Let's try again and see what it says.
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

no longer needed data
Last edited by Andre-K on 25 Nov 2012, 17:28, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Just tested that release on my VM and it works fine. Make sure you have libgio-2.0.so (though that should be default). Can you run filebot -script fn:sysinfo to give me some info on your java/platform environment.
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

andre@Loke:~/Downloads$ locate libgio-2.0.so
/usr/lib/i386-linux-gnu/libgio-2.0.so.0
/usr/lib/i386-linux-gnu/libgio-2.0.so.0.3400.0
/usr/lib/vmware/lib/libgio-2.0.so.0
/usr/lib/vmware/lib/libgio-2.0.so.0/libgio-2.0.so.0
/usr/lib/vmware-installer/2.1.0/lib/lib/libgio-2.0.so.0
/usr/lib/vmware-installer/2.1.0/lib/lib/libgio-2.0.so.0/libgio-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgio-2.0.so
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3400.0


andre@Loke:~/Downloads$ ./filebot-3.1-r1327-gvfs3\(1\).jar -script fn:sysinfo
FileBot 3.1 (r1327)
Nov 24, 2012 11:45:01 PM net.sourceforge.filebot.mediainfo.MediaInfo <clinit>
WARNING: Failed to preload libzen
MediaInfo: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
Extended Attributes: DISABLED
OpenJDK Runtime Environment 1.7.0_09
64-bit OpenJDK 64-Bit Server VM
Linux (amd64)
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Looks like there is a problem with loading JNA.

This is what I found:
Loading JNA
JNA includes a small, platform-specific shared library which enables all native access. When the Native class is first accessed, JNA will first attempt to load this library from the directories specified in jna.boot.library.path. If that fails, it will fall back to loading from the system library paths. Finally it will attempt to extract the stub library from from the JNA jar file, and load it.

Loading from the system may be disabled by jna.nosys=true, and unpacking from the jar file may be disabled by jna.nounpack=true.

The library name used to search for JNA's native library may be altered by setting jna.boot.library.name, which defaults to "jnidispatch". It may be useful to set this value if your system requires unique names for shared libraries (rather than unique paths), or if your system must store different versions of the JNA shared library (e.g. for different architectures) in the same directory.
Usually FileBot would unpack that library (jnidispatch) to TEMP when it's first started. Check if maybe an old version of that library is messing things up, or maybe TEMP is not writable.

Try installing via the .deb, replace the jar and run it with that startup script in bin/filebot so you got all the proper options set.
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

Hi, you were right,
after
andre@Loke:~/Downloads$ sudo cp filebot-3.1-r1327-gvfs3.jar /usr/share/filebot/FileBot.jar
it worked fine, both rename & subtitles drag'n'drop work great.
There's one logged error, most likely a attribute that is not samba supported anyway.

andre@Loke:~/Downloads$ filebot
Nov 25, 2012 11:07:17 AM net.sourceforge.filebot.media.MediaDetection storeMetaInfo
WARNING: Failed to set xattr: java.nio.file.FileSystemException: /run/user/andre/gvfs/smb-share:server=odin2,share=episodes/.....(remobved data)
: Error writing extended attribute 'metadata': Operation not supported

Thank you.
Last edited by Andre-K on 25 Nov 2012, 17:30, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

No worries, using xattr to save metadata is an optional feature. SMB probably just doesn't support xattrs, no worries:
http://filebot.sourceforge.net/forums/v ... =324#p2248

If everything else is working then that's done and will be in the next release. :)
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

One more thing; if I drag'n'drop multiple files from SMB at once, only the first file appears in the (rename) list - I guess there's a loop missing, or only the first SMB:// is processed ?
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Yeah, there was a problem with importing the DnD data. Fixed with the new test jar.
:idea: Please read the FAQ and How to Request Help.
Andre-K
Donor
Posts: 49
Joined: 30 Oct 2012, 19:15

Re: bug: Dragging files from network shares does not work.

Post by Andre-K »

Thank you, filebot-3.1-r1329-gvfs4.jar works great with multiple files.
nicoparker
Donor
Posts: 13
Joined: 18 Nov 2016, 08:34

Re: bug: Dragging files from network shares does not work.

Post by nicoparker »

Hi everyone,

I'm reviving a post of 2012 (!). Hope someone's there listening!

So a little background here : I'm using Filebot a lot on a distant Linux server through SSHFS. I was doing it under Windows for a while (with WinSSHFS), but it stopped working properly when I installed Windows 10. So I just installed a fresh Ubuntu 16.04 LTS, Java 8 64b and the latest Filebot (Amd64). It feels completely easy and logic. But so far, I've been mounting the distant server with Nautilus, which uses GVFS, and here comes the problem : when I drag and drop a file, Filebot throws an error, saying the URI is invalid :

Code: Select all

Invalid file URI: sftp://[email protected]/home/nico/Series/Westworld%20-%20Season%201/Westworld%20-%201x07%20-%20Trompe%20L'Oeil.mkv
I've read the whole post, and it looks like that has been already adressed a long time ago. Strange. Well anyway, I tried to feed Filebot the file from the logical filesystem (/run/user/nico/gvfs etc...) but Nautilus gives anyway the sftp://[email protected] URI. It works though when I open the file from Filebot (which is not very handy).

I've tried and check everything I could so far, and I can't find any solution. The only workaround would be to mount the filesystem directly with the command line on a mountpoint or through fstab - but well I find the Nautilus option interesting. Is there something I'm doing wrong ?

The "filebot -script fn:sysinfo" command returns this on my system :

Code: Select all

FileBot 4.7.2 (r4178)
JNA Native: 4.0.1
MediaInfo: 0.7.69
7-Zip-JBinding: 9.20
Chromaprint: 1.1.0
Extended Attributes: OK
GVFS: OK
Script Bundle: 2016-11-07 (r458)
Groovy: 2.4.7
JRE: OpenJDK Runtime Environment 1.8.0_111
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 8 Core / 1 GB Max Memory / 13 MB Used Memory
OS: Linux (amd64)
Package: DEB
Data: /home/nico/.filebot
uname: Linux nico-ubuntu 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

Please check the code and check the assumptions FileBot makes about GVFS paths:
https://github.com/filebot/filebot/blob ... S.java#L21

e.g. this URL must map to this FILE:

Code: Select all

smb://10.0.1.5/data/Movies/Avatar.mp4
/run/user/1000/gvfs/smbshare:server=10.0.1.5,share=data/Movies/Avatar.mp4
Assuming that 1000 is your UID.

What are the URL->FILE mappings on your system?


EDIT:


Please run this command and post the output:

Code: Select all

printenv | grep "XDG"
:idea: Please read the FAQ and How to Request Help.
nicoparker
Donor
Posts: 13
Joined: 18 Nov 2016, 08:34

Re: bug: Dragging files from network shares does not work.

Post by nicoparker »

Same as you! Example :

Code: Select all

sftp://[email protected]/home/nico/Series/The%20Grand%20Tour%20-%20Season%201
Maps to :

Code: Select all

/run/user/1000/gvfs/sftp:host=myserver.org,user=nico/home/nico/Series/The%20Grand%20Tour%20-%20Season%201/
But whether I'm drag and dropping from the former or the latter path gives exactly the same error, because Nautilus passes anyway the sftp://file URI as an argument :

Code: Select all

Invalid file URI: sftp://[email protected]/home/nico/Series/The%20Grand%20Tour%20-%20Season%201/The%20Grand%20Tour%20(2016)%20-%201x01%20-%20The%20Holy%20Trinity.mp4

Invalid file URI: sftp://[email protected]/home/nico/Series/The%20Grand%20Tour%20-%20Season%201/The%20Grand%20Tour%20(2016)%20-%201x01%20-%20The%20Holy%20Trinity.mp4
EDIT : the "printenv | grep XDG" command returns :

Code: Select all

XDG_VTNR=7
XDG_SESSION_ID=c2
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/nico
XDG_MENU_PREFIX=gnome-
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
XDG_SESSION_TYPE=x11
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=ubuntu
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_RUNTIME_DIR=/run/user/1000
XDG_CURRENT_DESKTOP=Unity
EDIT #2 :
I've tried on some Samba shares mounted with Nautilus (so GVFS), it works flawlessly.

EDIT #3 :
Before all the tests, I installed the "openjfx" packet with its dependencies.
Last edited by nicoparker on 18 Nov 2016, 13:36, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: bug: Dragging files from network shares does not work.

Post by rednoah »

But shouldn't this:

Code: Select all

sftp://[email protected]/home/nico/Series/The%20Grand%20Tour%20-%20Season%201
Map to this:

Code: Select all

/run/user/1000/gvfs/sftp:host=myserver.org,user=nico/home/nico/Series/The Grand Tour - Season 1
Instead of this:

Code: Select all

/run/user/1000/gvfs/sftp:host=myserver.org,user=nico/home/Series/The%20Grand%20Tour%20-%20Season%201/
(according to your post)

Also the /home/nico is the other way around (i.e. /nico/home) in your example. Also URL encoded characters. Are you 100% sure this is the actually virtual filesystem path?
:idea: Please read the FAQ and How to Request Help.
Post Reply