slgobinath / uget-chrome-wrapper

Moved to https://github.com/ugetdm/uget-integrator and https://github.com/ugetdm/uget-extension
GNU General Public License v3.0
75 stars 14 forks source link

Error: Unable to connect to the uget-chrome-wrapper #20

Open slgobinath opened 7 years ago

slgobinath commented 7 years ago

If you are getting this error message in the uGet Integration extension, please make sure that you have installed Python 3.4 or greater, uGet 2.0.8 or greater and the latest version of uget-chrome-wrapper. To see how to install uget-chrome-wrapper, visit the official page: Installation Guide Also make sure that you have restarted the browser after installing all the above tools.

If you still have the problem after installing uget-chrome-wrapper, enable the log by following the steps given below and share the log information along with your uGet version, Browser name and version and the Operating System with version.

  1. Open uget-chrome-wrapper
    sudo gedit /usr/bin/uget-chrome-wrapper

Windows users can find it at C:\Program Files (x86)\uget-chrome-wrapper\uget-chrome-wrapper.py

  1. Uncomment the following two lines and save the changes

    # log_file_path = join(expanduser('~'), 'uget-chrome-wrapper.log')
    # logging.basicConfig(format='%(asctime)s [%(levelname)s]: %(message)s', filename=log_file_path, filemode='a', level=logging.DEBUG)

    After uncommenting, it should become:

    log_file_path = join(expanduser('~'), 'uget-chrome-wrapper.log')
    logging.basicConfig(format='%(asctime)s [%(levelname)s]: %(message)s', filename=log_file_path, filemode='a', level=logging.DEBUG)
  2. Just open your web browser.

  3. There should be a file created at ~/uget-chrome-wrapper.log. In Windows (I beleive) it should be C:\Users\<User-Name>\uget-chrome-wrapper.log. If the file is there, share its content. If not, please specify that.

KhogaEslam commented 7 years ago

i have followed the steps here and now it is working well !

although i followed the steps on the software's website and installed the extension from chrome extensions, but it didn't install the uget-chrome-wrapper

any way, now it is working well, thank you :)

slgobinath commented 7 years ago

Software's web site?? Did you mean the Chrome extension web store? Because https://slgobinath.github.io/uget-chrome-wrapper is the official website.

KhogaEslam commented 7 years ago

what about this one !? http://ugetdm.com/

slgobinath commented 7 years ago

@KhogaEslam that's the official site of uGet Download Manager. Actually, the uGet does not offer any official extensions for any browser and I tried to fill that gap by developing my own wrapper named uget-chrome-wrapper and the extension uGet Integration. I remember MichaelTunnell, mentioned this extension in his comments but still uget-chrome-wrapper is not officially part of uGet.

Sorry for the inconvenience.

KhogaEslam commented 7 years ago

@slgobinath OK, Thank you, By the way Your work is amazing, thanks again :)

ByCnck commented 7 years ago

hi i have same probleam. on deepin linux 15.4.1 and chrome 58.0.3029.110 (64-bit).

chrome console log:
chrome-extension://efjgjleilhflffpbnkaofpmdnajdpepi/content.js:29 Uncaught ReferenceError: browser is not defined
    at window.onkeyup (chrome-extension://efjgjleilhflffpbnkaofpmdnajdpepi/content.js:29)
slgobinath commented 7 years ago

Hi @ByCnck, Due to this bug, the keyboard shortcuts were not working and thanks for reporting this bug.I have fixed the issue in https://github.com/slgobinath/uget-chrome-wrapper/commit/581396fdfd01bba896d16059c6d12726ee539c2a and released a new version of the extension 2.0.5 which is now available in chrome store. However, this bug affects the shortcuts only and the extension should work as expected. Could you please follow the instructions given in my first comment on this issue and share the log message.

Thanks.

ByCnck commented 7 years ago

@slgobinath there is no error log after i started or restarted chrome.

clark@MiAir:~$ cat /usr/bin/uget-chrome-wrapper | grep log_file
log_file_path = join(expanduser('~'), 'uget-chrome-wrapper.log')
logging.basicConfig(format='%(asctime)s [%(levelname)s]: %(message)s', filename=log_file_path, filemode='a', level=logging.DEBUG)
clark@MiAir:~$ cat /usr/bin/uget-chrome-wrapper | grep logging.basicConfig
logging.basicConfig(format='%(asctime)s [%(levelname)s]: %(message)s', filename=log_file_path, filemode='a', level=logging.DEBUG)

clark@MiAir:~$ /usr/bin/python3 -V
Python 3.5.3
clark@MiAir:~$ ll /usr/bin/uget-chrome-wrapper 
-rwxr-xr-x 1 root root 4739 7月  16 22:31 /usr/bin/uget-chrome-wrapper*

clark@MiAir:~$ more uget-chrome-wrapper.log
clark@MiAir:~$ google-chrome
[1:1:0717/153504.318639:ERROR:chrome_content_client.cc(371)] Failed to locate and load the component updated flash plugin.
[1:1:0717/153504.320027:ERROR:chrome_content_client.cc(371)] Failed to locate and load the component updated flash plugin.
[2777:2777:0717/153504.363388:ERROR:chrome_content_client.cc(371)] Failed to locate and load the component updated flash plugin.
[2777:2859:0717/153504.465439:ERROR:connection.cc(1954)]  sqlite error 1, errno -2: table urls has 8 columns but 7 values were supplied, sql: INSERT INTO urls SELECT * FROM history.urls WHERE typed_count > 0
[2777:2859:0717/153504.465597:ERROR:connection.cc(1954)]  sqlite error 1, errno -2: no such column: u.favicon_id, sql: INSERT OR IGNORE INTO urls SELECT u.id, u.url, u.title, u.visit_count, u.typed_count, u.last_visit_time, u.hidden, u.favicon_id FROM history.urls u JOIN history.keyword_search_terms kst WHERE u.typed_count = 0 AND u.id = kst.url_id
[2777:2807:0717/153504.547199:ERROR:login_database.cc(550)] Password store database is too new, kCurrentVersionNumber=18, GetCompatibleVersionNumber=19
[2777:2807:0717/153504.547286:ERROR:password_store_default.cc(45)] Could not create/open login database.
[2777:2777:0717/153505.310215:ERROR:CONSOLE(21)] "Uncaught ReferenceError: browser is not defined", source: chrome-extension://efjgjleilhflffpbnkaofpmdnajdpepi/content.js (21)
[2777:2812:0717/153506.155088:ERROR:sync_resource_handler.cc(54)] Cross origin redirect denied
[2777:2812:0717/153506.173646:ERROR:sync_resource_handler.cc(54)] Cross origin redirect denied
[2777:2777:0717/153510.328572:ERROR:CONSOLE(21)] "Uncaught ReferenceError: browser is not defined", source: chrome-extension://efjgjleilhflffpbnkaofpmdnajdpepi/content.js (21)
[2777:2777:0717/153515.019980:ERROR:CONSOLE(21)] "Uncaught ReferenceError: browser is not defined", source: chrome-extension://efjgjleilhflffpbnkaofpmdnajdpepi/content.js (21)
[2777:2807:0717/153515.883696:ERROR:password_syncable_service.cc(163)] Passwords datatype error was encountered: Failed to get passwords from store.
clark@MiAir:~$ cat uget-chrome-wrapper.log 
clark@MiAir:~$ 

![20170717153950](https://user-images.githubusercontent.com/4009936/28258904-3f95e130-6b06-11e7-995a-9912f701b063.png)
ByCnck commented 7 years ago
clark@MiAir:~$ tail /etc/chromium/native-messaging-hosts/com.javahelps.ugetchromewrapper.json
{
    "name": "com.javahelps.ugetchromewrapper",
    "description": "Integrate uGet with Google Chrome, Chromium, Vivaldi and Opera",
    "path": "/usr/bin/uget-chrome-wrapper",
    "type": "stdio",
    "allowed_origins": [
        "chrome-extension://efjgjleilhflffpbnkaofpmdnajdpepi/",
        "chrome-extension://akcbnhoidebjpiefdkmaaicfgdpbnoac/"
    ]
}
slgobinath commented 7 years ago

@ByCnck, Did you install the uget-chrome-wrapper manually? If so, please ensure that the com.javahelps.ugetchromewrapper.json is in the /etc/opt/chrome/native-messaging-hosts directory.

/etc/chromium/native-messaging-hosts is for Chromium and Vivaldi.

trickymindful commented 7 years ago

Hi @slgobinath I have this message

Info: Found uGet: and uget-chrome-wrapper: 2.0.4

It seems that it works. But when I try to download something, uGet window does not open and when I open the uget-chrome-wrapper.log some of the lines reveal these:

2017-07-18 11:29:18,741 [INFO]: uget-chrome-wrapper is reading the message 2017-07-18 11:29:35,779 [INFO]: uget-chrome-wrapper is reading the message 2017-07-18 11:29:35,779 [DEBUG]: Message length: 19 2017-07-18 11:29:35,794 [DEBUG]: Received message: {"version":"2.0.6"} 2017-07-18 11:29:35,957 [DEBUG]: uGet version: 2017-07-18 11:29:35,957 [INFO]: Sending message: {"enable": true, "version": "2.0.4", "uget": ""} 2017-07-18 11:35:04,029 [INFO]: uget-chrome-wrapper is reading the message 2017-07-18 11:35:04,030 [DEBUG]: Message length: 1369 2017-07-18 11:35:04,030 [DEBUG]: Received message: {"url":"http://www72.zippyshare.com/d/eZP3HuBo/15054/IseSho_03_HD_HS_ACB.mkv","cookies":"www72.zippyshare.com\tFALSE\t/\tFALSE\tNaN\tJSESSIONID\tBC57A2FB8BA5BB891EC6BF3E3EE9F40B\n.zippyshare.com\tTRUE\t/\tFALSE\t1500395668\tzippop\t6\n.zippyshare.com\tTRUE\t/\tFALSE\t1500353069\t__utmt\t1\n.zippyshare.com\tTRUE\t/\tFALSE\t10140266086\tzippyadb\t0\n.zippyshare.com\tTRUE\t/\tFALSE\t1563424486\t__utma\t46003887.908056981.1451722260.1500348052.1500352469.13\n.zippyshare.com\tTRUE\t/\tFALSE\t1500354286\t__utmb\t46003887.2.9.1500352486021\n.zippyshare.com\tTRUE\t/\tFALSE\tNaN\t__utmc\t46003887\n.zippyshare.com\tTRUE\t/\tFALSE\t1516120486\t__utmz\t46003887.1497823259.2.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)\nwww72.zippyshare.com\tTRUE\t/\tFALSE\t1563424486\t__atuvc\t3%7C29\nwww72.zippyshare.com\tTRUE\t/\tFALSE\t1500354286\t__atuvs\t596d8fd430fc710f000\n.zippyshare.com\tTRUE\t/\tFALSE\t2147472000\tadmaven_pop_621656_ts\t1500352486308\n.zippyshare.com\tTRUE\t/\tFALSE\t2147472000\tadmaven_pop_621656_d\t1500352486325_1\n.zippyshare.com\tTRUE\t/\tFALSE\t2147472000\tadmaven_pop_621656_u[\"2567885998\"]\t1500352486330_1\n","useragent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36","filename":"","filesize":"17595","referrer":"http://www72.zippyshare.com/v/eZP3HuBo/file.html","postdata":""} 2017-07-18 11:35:04,033 [INFO]: Sending message: {"state": "accepted"}

Is there anything wrong?

Thanks

slgobinath commented 7 years ago

Hi @trickymindful, I think you do not have uGet download manager. Please install the uGet download manager from this URL: http://ugetdm.com/downloads

The infor message should be something like this:

Info: Found uGet: 2.0.9 and uget-chrome-wrapper: 2.0.4

trickymindful commented 7 years ago

I use windows 7 and the site does not provide any installer just portable executable ones. I try moving its extracted files in c://uget/ still not working.On Jul 18, 2017 6:21 PM, Gobinath notifications@github.com wrote:Hi @trickymindful, I think you do not have uGet download manager. Please install the uGet download manager from this URL: http://ugetdm.com/downloads The infor message should be something like this:

Info: Found uGet: 2.0.9 and uget-chrome-wrapper: 2.0.4

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

slgobinath commented 7 years ago

In Windows, you need to setup add the C:\uget\bin directory to the environment variable PATH. How to add this to the environment variable is explained in the installation guide to Windows users in https://slgobinath.github.io/uget-chrome-wrapper/.

Once you have added the path, you must be able to launch the uGet download manager from command prompt by using this command: uget

trickymindful commented 7 years ago

The path to uget folder is already done and I can call it via cmd. But the chrome extension still cannot detect the uget. Must I restart my computer, or just the browser?On Jul 18, 2017 7:27 PM, Gobinath notifications@github.com wrote:In Windows, you need to setup add the C:\uget\bin directory to the environment variable PATH. How to add this to the environment variable is explained in the installation guide to Windows users in https://slgobinath.github.io/uget-chrome-wrapper/. Once you have added the path, you must be able to launch the uGet download manager from command prompt by using this command: uget

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

ByCnck commented 7 years ago

@slgobinath yes,i installed it manually."com.javahelps.ugetchromewrapper.json" is in the /etc/opt/chrome/native-messaging-hosts and i am ok now.thanks a lot.

trickymindful commented 7 years ago

Hello @slgobinath, it is somehow doing well now. I don't know why though. I just uninstall and remove both 'uget' and 'uget-chrome-wrapper'. Then installing both again etracting the uget directly to 'c:/uget/' and then making sure uget can be executed from cmd. After that I install again the 'uget-chrome-wrapper' and run its bat file again. Not going well at first and I just give it up and rest. The google chrome is still open at that time. I try to restart the browser repeatedly while executing the bat file.After some time, suddenly after clicking a download link, uget capture the link even though I don't copy the link (I activate the url monitoring feature). I tried to copy the url and it does the job. I try just to click it again and it also does the job. I don't know why but I suspect restarting the browser while running the bat file affect it. Tbh, this is confusing.I think there is a sequence way to install and execute them. Maybe I messed up halfway before. Thank you @slgobinath for the help and sorry if I burden you too much.On Jul 18, 2017 7:46 PM, trickymindful@yahoo.com wrote:The path to uget folder is already done and I can call it via cmd. But the chrome extension still cannot detect the uget. Must I restart my computer, or just the browser?On Jul 18, 2017 7:27 PM, Gobinath notifications@github.com wrote:In Windows, you need to setup add the C:\uget\bin directory to the environment variable PATH. How to add this to the environment variable is explained in the installation guide to Windows users in https://slgobinath.github.io/uget-chrome-wrapper/. Once you have added the path, you must be able to launch the uGet download manager from command prompt by using this command: uget

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

slgobinath commented 7 years ago

@trickymindful, no worries and I am happy to hear that it has been resolved.

AlwaysPS commented 7 years ago

I'm using Fedora 27 and Mozilla Firefox. The installation guide for firefox doesn't work for me and after de-commenting the two lines mentioned here no log file can be found in my home directory.

Strangely enough, after moving the native-messaging-hosts file from globa position(i.e. /usr/lib/mozilla) to user position(i.e. ~/.mozilla), it works nicely as I would expected.

By the way, filename with Chinese characters and Japenese characters can't be transfer properly to uget. Is there a coding problem or I did something wrong?

slgobinath commented 7 years ago

Hi @AlwaysPS, Thanks for reporting the issue. According to my testing, in Fedora, the directory must be /usr/lib64/mozilla/native-messaging-hosts. I have updated the document.

Thanks again

BerthaG commented 7 years ago

Hi @slgobinath , First thanks for your job, was using wrapper on archlinux perfectly, but for job reason I had to switch to debian9, and I did not manage to make it works with Stretch & chromium. (Error: Unable to connect to the uget-chrome-wrapper).

I followed the installation guide (ttps://slgobinath.github.io/uget-chrome-wrapper/#installation) except point 5 cause related to opera if I am correct.

Moreover log file is not generated after uncommenting the 2 lines as you described. Does someone has tried it with debian 9 ? Or I am the first one having the issue.

Uget v2.0.8 - python 3.5.3-1 - debian 9 - chromium 59.0.3071.86 - uname -v --> SMP Debian 4.9.30-2+deb9u2 (2017-06-26)

Thanks for your help, kind regards

slgobinath commented 7 years ago

Hi @BerthaG, Can you add the com.javahelps.ugetchromewrapper.json in both of the following directories and restart the browser:

/etc/opt/chrome/native-messaging-hosts

and

/etc/opt/chrome/native-messaging-hosts

Please do let me know the result. If it is not working, I'll give a try on Debian.

BerthaG commented 7 years ago

Hi @slgobinath ,

Thanks for the quick answer, I think you copy - paste twice the same directory. com.javahelps.ugetchromewrapper.json was already in /etc/opt/chrome/native-messaging-hosts. I reuploaded it, i give it a try but same result.

BerthaG commented 7 years ago

@slgobinath , I guessed you mean /etc/chrome/native-messaging-hosts, ans still same result

BerthaG commented 7 years ago

@slgobinath , Not sure what make it works, but now it is ;) So I copied com.javahelps.ugetchromewrapper.json in /etc/chrome/native-messaging-hosts and /etc/opt/chrome/native-messaging-hosts : Was not working. Then I dL the .deb package available and install over && reboot pc and now it is green ;) Maybe the deb package is more suitable, no idea ... Thanks for your help, maybe adding debian in the list of tested distro should be nice in the future. Enjoy the rest of your day. Regards

slgobinath commented 7 years ago

@BerthaG, Thanks for reporting the result. Of course, I am thinking of providing a script to automate the installation because the behavior of browsers changes with the operating systems. I will release a script soon.

Thanks

hamibahadori commented 7 years ago

I had this error message as well. Originally I had Python 2.7 installed on my CentOS 7. So, I installed Python 3.6, but none of the suggestions I read from this page solved my problem. I looked around for a while. In the wrapper file located in /usr/bin/uget-chrome-wrapper and its first line was this: #!/usr/bin/env python3 I looked in the /usr/bin directory and there wasn't any "python3", but the Python 3.6 that I had installed was there. So I changed that line to... #!/usr/bin/env python3.6 and relaunched chrome.

It solved the error!

cdytoby commented 6 years ago

sorry but I have this problem too, and after uncomment these, I still can't find the log, where exactly is the log?

C:\Users\[myusername] doesn't have the log file.

I have this issue after updating the wrapper. It works before.

Windows 10, Vivaldi 1.12.955.48 Portable, uGet Integration 2.1.0, wrapper 2.0.6, Python 3.6.1

gvds commented 6 years ago

Getting the "unable to connect to uget-chrome-wrapper" error in Firefox 57 on Ubuntu 17.10. No log file generated after uncommenting the relevant lines. Working fine in Vivaldi, however, so it's definitely a Firefox issue.

Casse19 commented 6 years ago

"3. Open the browser and share the content of ~/uget-chrome-wrapper.log. Windows users will get this log in their User directory."

It is very frustrating when you state a step as this and someone like me has no idea what you are talking about or how to do this. So, can you please explain how to do this step.

slgobinath commented 6 years ago

@Casse19, I have updated the comment. Please have a look again.

Thanks

slgobinath commented 6 years ago

@gvds are you using Firefox 64 bit or 32 bit?

gvds commented 6 years ago

Firefox 57.0.1 (64-bit) on Kubuntu 17.10

iambesi-zz commented 6 years ago

Hello,

For Windows users who are facing this issue, I believe that I have found the problem. I am currently running Firefox 57.0.1 on a Windows 7 test system. Upon testing / evaluating the add-on, I too was seeing the Error: Unable to connect to the uget-chrome-wrapper error message and unable to get the uget-chrome-wrapper.log to generate. After scratching my head for a bit, I realized that perhaps the uget-chrome-wrapper.py script was not being executed -- i.e., 1) no log file and 2) the issue was occurring within the browser itself. With a quick review of the Browser Console, I discovered the following errors:

stderr output from native app com.javahelps.ugetfirefoxwrapper: 'py' is not recognized as an internal or external command, stderr output from native app com.javahelps.ugetfirefoxwrapper: operable program or batch file. Unchecked lastError value: Error: An unexpected error occurred ExtensionCommon.jsm:407 This extension does not have permission to use native manifest C:\Program Files (x86)\uget-chrome-wrapper\com.javahelps.ugetfirefoxwrapper.json NativeManifests.jsm:102 No such native application com.javahelps.ugetfirefoxwrapper NativeMessaging.jsm:100 Unchecked lastError value: Error: Attempt to postMessage on disconnected port ExtensionCommon.jsm:407

After further investigation, I found that the developer had inadvertently put the wrong syntax in the uget-chrome-wrapper.bat file. He specified the following:

@echo off
py "%~dp0uget-chrome-wrapper.py"

However, it should be this instead:

@echo off
python "%~dp0uget-chrome-wrapper.py"

Once this has been corrected, the uGet Integration extension now seems to work properly and I am then able to download files as expected.

===

While I am here, there is also a secondary problem that may lead to confusion for some users in general. For some reason, it seems that there are two(2) different uGet-related extensions on Firefox’s Add-on Site. There are the following extensions:

uGet Integration by Gobinath (correct one!) [ Last updated: 27-Oct-17 ] https://addons.mozilla.org/en-US/firefox/addon/ugetintegration/

Open in UDM (uGet Download Manager) by Download Manager Tool (does not work!) [ Last updated: 12-Dec-17 ] https://addons.mozilla.org/en-US/firefox/addon/open-in-uget-download-manager/

The second add-on mentioned above simply refers users to Slgobinath’s GitHub page, https://slgobinath.github.io/uget-chrome-wrapper/, which is fine in general; however, it is confusing because if you install that Open in UDM add-on, it does not work due to the following permission error:

This extension does not have permission to use native manifest C:\Program Files (x86)\uget-chrome-wrapper\com.javahelps.ugetfirefoxwrapper.json NativeManifests.jsm:102 No such native application com.javahelps.ugetfirefoxwrapper NativeMessaging.jsm:100 Unchecked lastError value: Error: Attempt to postMessage on disconnected port ExtensionCommon.jsm:407

, and furthermore, is not needed if you install the proper uGet Integration add-on. Thus, I just wanted to point that out to everyone, and also, give a heads-up to the developer as well so that users (who are not as patient and systematic as I am) do not get discouraged and take a pass on uGet Integration add-on. I believe this extension has potential -- especially being in its early days; in fact, the only big thing that it is currently missing in my humble opinion is a progress meter to let users know the status of the file(s) being downloaded. In short, I hope that this information helps you all -- and Happy New Year!

Regards, Iambesi

slgobinath commented 6 years ago

Hi, @AirQuick could you please check this py vs python command issue.

Thanks

AirQuick commented 6 years ago

@iambesi, As for the first problem (py vs python), which version of Python do you have? Did you customize the installation? py is the Python Launcher inroduced in Python 3.3 to solve the version dependency isssue. See the specification linked from there or http://learning-python.com/py33-windows-launcher.html for the rationale to use py instead of python.

I tested the 3.6.4 64bit Python installer just now. py.exe was installed to %SystemRoot% by default. So any user should be able to access py.exe. If you deselect the Install launcher for all users in the launcher dialog, py.exe is installed to %LocalAppData%\Programs\Python\Launcher. In this case, the installer sets it in the user's PATH. So again you should be able to call py.exe. Make sure not to deselect the py launcher (which is selected by default) in the Customize installation of the installer.

iambesi-zz commented 6 years ago

Hi @AirQuick,

Thanks for including the link with the background on py; I completely understand the rationale for using it and I completely agree with the idea. I do not know how I missed this new feature -- well, it actually may be due to the fact that most of my work is done in Perl.

Regarding the Python version, I currently have Python 3.6.4 on my system and did not customize the installation; however, I already see what is different about my setup. Often times when I am testing Python (and more often Perl), I tend to use the extractable .zip file versions. In this case, I simply went to the download page -- https://www.python.org/downloads/windows/ -- and downloaded the Windows x86-64 embeddable zip (in lieu of the executable installer) file, which does not include the py launcher.

To further check this, I went back and performed a proper installation of Python and the missing executable does indeed get installed. Albeit a bit embarrassing, I have to admit that I caused the first problem on my own. Oops. :-( Anyhow, after having done this and changing the uget-chrome-wrapper.bat script back to py, the uGet Integration add-on still works without errors.