wbond / package_control

The Sublime Text package manager
https://packagecontrol.io
4.8k stars 818 forks source link

Get "HTTP Error 407: Proxy Authentication Required" when installing Package Control. #625

Closed ghost closed 10 years ago

ghost commented 11 years ago

Error message: " urllib2.HTTPError: HTTP Error 407: Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ) "

PS: I get this msg on my company pc.

FichteFoll commented 11 years ago

I take it you are behind a proxy. Since the installation command line does not support all proxy configutations (if any at all) you have to follow the manual instructions. Once installed Package Control itself will have proxy handling.

ghost commented 11 years ago

I followed the manual instructions (https://sublime.wbond.net/installation#Manual), but after I restarted st2, pressed Ctrl+Shift+P and type "install package", there was nothing in the dropdownlist. What should I do now? Thanks in advance.

FichteFoll commented 11 years ago

Please post the contents of your console (ctrl+``) with thedebug` setting enabled.

MurrayBowles commented 11 years ago

I have a similar issue to this. The cut-and-paste method fails with a timeout. The manual method simply does nothing ("Package Setup not required" on a restart). One thing: if I try the cut/paste method 1) I do wind up with a file in the Installed Packages folder 2) its type shows up as "SUBLIME-PACKAGE file" 3) if I restart ST again, I get "PackageSetup: bad zip file at C:\Users\murray_bowles\AppData\Roaming\Sublime Text 2\Installed Packages\Package Control.sublime-package PackageSetup returned: -1"

On the other hand, with the manual methos, I have to rename the file to get the ".sublime-package" extension, the file type shows up as "WinZip File", and ST seems to ignmore it entirely on restart.

MurrayBowles commented 11 years ago

To be more precise, the first line is what the cut-and-paste method gets me; the second line is what I get by downloading the zip file and manually renaming it to add a .sublime-package extension. ST startup will complain about the first and ignore the second. (This is on Windows 7)

Name Type Size Package Control.sublime-package SUBLIME-PACKAGE File 0 KB Package Control.sublime-package ZIP File 130 KB

wbond commented 11 years ago

@HikariKatsuragi Did you enter your proxy_username and proxy_password in the Package Control settings? If you have a proxy that requires auth, you'll need to fill those in.

wbond commented 11 years ago

@MurrayBowles Can you post a new issue with a debug log after a manual install? It doesn't seem you are having the same issue since there is no mention of a 407 error.

wpsmith commented 10 years ago

I had a very similar issue with SublimeText2. Package control would not work for me with the default instructions:

import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

But when I re-wrote it to the following, it worked for me:

import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None;proxy = urllib2.ProxyHandler({'http': 'http://username:password@proxy_uri:proxy_port'}); auth = urllib2.HTTPBasicAuthHandler(); opener = urllib2.build_opener(proxy, auth, urllib2.HTTPHandler); urllib2.install_opener(opener);open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

Now, I need to figure out how to make the same/similar change for the installation/discovery of packages via Package Control.

wbond commented 10 years ago

@wpsmith What platform are you on? Did you set the proxy_username and proxy_password settings? The best solution is to generate a debug log and open a new issue so it can be tracked separately.

CADbloke commented 10 years ago

for those who GooBinglHoo stumbled across this - try CNTLM if you're behind a productivity firewall

Curros commented 9 years ago

For SublimeText3!

import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler({'http': 'http://username:password@proxy_uri:proxy_port'})) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
FichteFoll commented 9 years ago

The install instructions are updated for every release of Package Control and do not persist. This is also mentioned in an orange warning box at the installation page: https://packagecontrol.io/installation