ugetdm / uget-integrator

Native messaging host to integrate uGet Download Manager with web browsers
GNU General Public License v3.0
339 stars 38 forks source link

unable to connect with uget-integrator #67

Open z1atk0 opened 5 years ago

z1atk0 commented 5 years ago

Okay, so I'm getting the infamous "unable to connect with uget-integrator" too. Slackware 14.2 32bit, uGet-2.2.1, Firefox 60.6.1esr directly from http://releases.mozilla.org/pub/firefox/releases/60.6.1esr/linux-i686/en-US/. Stracing FF startup reveals that it's reading the native-messaging-hosts directory just fine:

[zlatko@disclosure:~]$ grep native-messaging xxx.2*
xxx.2664:open("/home/zlatko/.mozilla/native-messaging-hosts/com.ugetdm.firefox.json", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
xxx.2680:open("/usr/lib/mozilla/native-messaging-hosts/com.ugetdm.firefox.json", O_RDONLY|O_LARGEFILE) = 120
[zlatko@disclosure:~]$ cat /usr/lib/mozilla/native-messaging-hosts/com.ugetdm.firefox.json
{
    "name": "com.ugetdm.firefox",
    "description": "Integrate uGet with Mozilla Firefox",
    "path": "/usr/local/bin/uget-integrator"
    "type": "stdio",
    "allowed_extensions": [
        "uget-integration@slgobinath"
    ]
}

Running uget-integrator from the commandline also works as expected (no output, no error messages):

[zlatko@disclosure:~]$ uget-integrator 
^CTraceback (most recent call last):
  File "/usr/local/bin/uget-integrator", line 224, in <module>
    read_message()
  File "/usr/local/bin/uget-integrator", line 146, in read_message
    text_length_bytes = sys.stdin.buffer.read(4)
KeyboardInterrupt

Moving uget-integrator to /usr/bin (and adjusting the path in com.ugetdm.firefox.json accordingly, of course) doesn't make a difference. So, what next?

Saikomorisan commented 5 years ago

I had the same problem even after using install_uget_integrator.sh, so I started the investigation and discovered that all the files "downloaded" by the script are 0bytes in size, so the problem is a problem in the slackware 14.2 wget. (cant check certifiacte )because of that, can not download the files. here is the scrip that i modifyed maybe some parts are unnesesary but im noob so maybe can be mekeit better. just change the file extension and give the permissions to it. install_uget_integrator_slackware.txt

z1atk0 commented 5 years ago

Thanks for your reply. 0-sized files are definitely not the problem here, though. The script downloads two files, uget-integrator (the executable itself) and com.ugetdm.firefox.json (the executable's config file), both of which are fine (ie. not 0-sized):

[root@disclosure:~/usrlocal/stow/uget-integrator]# find lib/ bin/ -type f | xargs ls -l
-rwxr-xr-x 1 root root 7385 Apr  6 19:53 bin/uget-integrator
-rw-r--r-- 1 root root  234 Apr  7 11:39 lib/mozilla/native-messaging-hosts/com.ugetdm.firefox.json

As I said, the executable also behaves as expected (except for actually working with FF) and the config file does get read on startup.

z1atk0 commented 5 years ago

Just noticed that as of FF 60.6.3esr, also the config popup window appears to be broken (ie. empty, see attached screenshot). So for all practical purposes, this addon seems to be dead and abandoned by its developer(s). Time to go and search for something else, I guess. sigh

Update: the config popup window seems to be fine again with FF 60.7.0esr. The original problem ("unable to connect with uget-integrator") still persists, though.

Screenshot-unable to connect with uget-integrator · Issue #67 · ugetdm-uget-integrator - Mozilla Firefox

Saikomorisan commented 5 years ago

try this go to /usr/lib/mozilla/native_messagin_host/ and there shold be the .json file so open it if its not there create it, then copy the following lines when you open the .json file the code should be there, if it is not there youi find the prblem and reinstall the addon just in case.

{
    "name": "com.ugetdm.firefox",
    "description": "Integrate uGet with Mozilla Firefox",
    "path": "/usr/bin/uget-integrator",
    "type": "stdio",
    "allowed_extensions": [
        "uget-integration@slgobinath"
    ]

im sorry if i don't express my self rightly, english isn't my main language

z1atk0 commented 5 years ago

See my initial comment - I do have this file at the right place, with exactly the same content, and it gets read correctly when FF starts, so this is clearly not the problem. Thanks anyway! :wink:

Saikomorisan commented 5 years ago

you sayng that FF detect on the start because the uget icon become green for a cuple of second then turn red?

ademlabs commented 5 years ago

you sayng that FF detect on the start because the uget icon become green for a cuple of second then turn red?

I don't think he meant that. His installation went fine and the JSON configuration inside the native-messaging-hosts directory is loaded correctly (as can be seen from his strace log). The issue seems to be that even though all permissions are set and extension is loaded, the native messaging system doesn't seem to work, i.e the extension is unable to communicate with the uget-integrator.

I'm having the same issue (though using Vivaldi in my case). Persepolis + its Chrome extension is similar to uGet Integrator and uses native messaging as well and it works flawlessly. I've been trying to go through the source code of both the extension and the integrator briefly but haven't found anything yet. I'll go more in depth tomorrow.

This issue is definitely related to the extension + integrator pair as Persepolis is working correctly in my case.

z1atk0 commented 5 years ago

@Saikomorisan exactly what @arvind-d said. :wink: The strace logs I'm grepping through (again, see my initial comment) show that FF is able to both locate and read the JSON file just fine.

AliGeyik commented 5 years ago

Traceback (most recent call last): File "C:\Program Files (x86)\uget-integrator\uget-integrator.py", line 224, in read_message() File "C:\Program Files (x86)\uget-integrator\uget-integrator.py", line 146, in read_message text_length_bytes = sys.stdin.buffer.read(4) KeyboardInterrupt Terminate batch job (Y/N)? y

C:\Program Files (x86)\uget-integrator>uget-integrator.bat &

Traceback (most recent call last): File "C:\Program Files (x86)\uget-integrator\uget-integrator.py", line 224, in read_message() File "C:\Program Files (x86)\uget-integrator\uget-integrator.py", line 154, in read_message text = sys.stdin.buffer.read(text_length).decode('utf-8') ValueError: cannot read more than 33554432 bytes

z1atk0 commented 5 years ago

Update: works for me now, even with uget-1.10.x (although yes, I know, it's not officially supported), which I prefer over uget-2.x for various usability reasons (see my as of this date unanswered/ignored bug reports at https://ugetdm.com/qa/489/uget-main-window-steals-mouse-focus and https://ugetdm.com/qa/490/main-window-doesnt-auto-scroll-to-show-new-downloads-on-top).

What I did:

  1. Upgrade from FF-60esr to FF-68esr (although I think it's actually unrelated, but it gave me another push and motivation to try and tackle the uget-integrator problem).
  2. Fix my com.ugetdm.firefox.json file - in the "path" line, it was missing a simple little "," (comma) at the end, which I probably edited out by mistake when changing the path to match my actual setup. It's even visible in my inital bug report, but went undetected all the time! :man_facepalming: :innocent:

So, as far as I'm concerned, this issue can be closed. Dunno about the other commenters, though, so I leave it up to the maintainer to decide.

sherlocknieh commented 4 years ago

I gave up playing with the codes and went to download the package directly here: https://launchpad.net/~uget-team/+archive/ubuntu/ppa/+packages and it worked perfectly.