【未解决】TortoiseSVN中用goagent代理去更新googlecode代码时出错:OPTIONS https://crifanlib.googlecode.com/svn/trunk" not supported by GAE, please enable PHP mode!

【问题】

在本地的svn客户端TortoiseSVN下,借助于goagent的本地代理(之前都可以正常工作的,可以update和commit的):

tortoisesvn settings proxy use goagent

去更新代码:

using goagent as proxy server to update in tortoisesvn

结果出错了:

tortoisesvn update failed Error running context The server sent an improper HTTP response

Update
E:\dev_root\google_code\crifanLib\crifanLib
Unable to connect to a repository at URL
https://crifanlib.googlecode.com/svn/trunk
Error running context: The server sent an improper HTTP response

goagent的log显示:

goagent 3.2.3 WARNING OPTIONS https not supported by GAE please enable PHP mode

INFO - [Jan 09 23:19:15] ssl good_ipaddrs=20, bad_ipaddrs=164, unknown_ipaddrs=164 
INFO - [Jan 09 23:19:16] 127.0.0.1:57103 "GAE GET http://m.weibo.cn/users/showForFirfox HTTP/1.1" 200 93 
INFO - [Jan 09 23:19:17] 127.0.0.1:57317 "DIRECT OPTIONS https://crifanlib.googlecode.com/svn/trunk HTTP/1.1" 200 183 
WARNING - [Jan 09 23:19:17] "OPTIONS https://crifanlib.googlecode.com/svn/trunk" not supported by GAE, please enable PHP mode! 
INFO - [Jan 09 23:19:17] ssl good_ipaddrs=20, bad_ipaddrs=164, unknown_ipaddrs=164 
127.0.0.1 - - [09/Jan/2015 23:19:34] code 400, message Bad request syntax ('42') 
INFO - [Jan 09 23:19:34] 127.0.0.1:57482 "STRIP CONNECT crifanlib.googlecode.com:443 HTTP/1.1" - - 
WARNING - [Jan 09 23:19:34] "OPTIONS https://crifanlib.googlecode.com/svn/trunk" not supported by GAE, please enable PHP mode! 
INFO - [Jan 09 23:19:34] ssl good_ipaddrs=18, bad_ipaddrs=186, unknown_ipaddrs=144 
INFO - [Jan 09 23:19:36] 127.0.0.1:57482 "DIRECT OPTIONS https://crifanlib.googlecode.com/svn/trunk HTTP/1.1" 200 183 
WARNING - [Jan 09 23:19:36] "OPTIONS https://crifanlib.googlecode.com/svn/trunk" not supported by GAE, please enable PHP mode! 
INFO - [Jan 09 23:19:36] ssl good_ipaddrs=18, bad_ipaddrs=186, unknown_ipaddrs=144 

但是很郁闷的是:之前没出现过这样的问题的。

2.然后就去googlecode上看看什么情况,是否有什么可以开启php的选项。

结果没有找到。

3.无意间,倒是看到一个功能:

googlecode上的项目,提供了,当项目移动到别的地方(就像我这里的,以后要移动到github)

提供了Project Moved功能:

设置一个ulr,可以自动跳转。

googlecode Project Moved settings

以后,等搬家完毕后,再去设置。

4.搜:

not supported by GAE, please enable PHP  mode!

找到:

Issue 15104 – goagent – Soundcloud: not supported by GAE, please enable PHP mode – https://github.com/goagent/goagent – Google Project Hosting

->

Issue 15419 – goagent – 只需简单一步,让soundcloud畅通无阻

但是我这里不是soudcloud,所以没法这么添加。

5.没有找到办法。

自己去gae上面看看是否有php模式。

结果也没找到:

gae not found php mode

6.去重新到googlecode上找地址:

https://code.google.com/p/crifanlib/source/checkout

找到:

https://crifanlib.googlecode.com/svn/trunk/

然后重新下载update看看:

retry update svn for https googlecode trunk

结果问题依旧,还是上面的问题。

7.根据googlecode上面下载源码的提示:

“When prompted, enter your generated googlecode.com password.”

然后去把svn客户端中,之前google的账户的密码,改为此处googlecode的密码:

zxxxxxxxxxx3

tortoisesvn proxy goagent password use googlecode password

然后再去update试试:

结果问题依旧。

突然想到:

貌似此刻,还没开始用到此处TortoiseSVN中设置的代理的用户名和密码呢。。。

只是开始用代理,结果就无法访问googlecode的地址而已。

7.所以去掉用户名和密码试试:

try svn settings proxy goagent no password

再去update试试。

结果到很干脆:

goagent svn Error running context target computer refued

 

Command: Checkout from https://crifanlib.googlecode.com/svn/trunk, revision HEAD, Fully recursive, Externals included

Error: Unable to connect to a repository at URL

Error: ‘https://crifanlib.googlecode.com/svn/trunk

Error: Error running context: 由于目标计算机积极拒绝,无法连接。

Completed!:

后来证明是不小心把goagent关闭而导致上述错误的。

然后打开了goagent后,但是没设置TortoiseSVN的代理的用户名和密码的话,是会出现另外的错误的:

Command: Checkout from https://crifanlib.googlecode.com/svn/trunk, revision HEAD, Fully recursive, Externals included

Error: Unable to connect to a repository at URL

Error: ‘https://crifanlib.googlecode.com/svn/trunk

Error: Error running context: The server sent an improper HTTP response

Completed!:   

所以还是需要用户名和密码的。。。

而且按道理来说是gae的用户名和密码,也就是google的账户和密码。。。

8.去把gae中的账户,换成另外几个,之前申请的账户试试,看看是否有变化。

结果问题依旧。

9.之前就看到这个人:

Issue 18872 – goagent – "OPTIONS eu.api.mega.co.nz" not supported by GAE, please enable php mode! 

遇到和我同样的问题,但是没解决方案。

这人也是类似问题:

更新goAgent版本不可用了 · Issue #243 · ohdarling/GoAgentX · GitHub

10.后来倒是看到了goagent的相关部分的源码了:

proxy.py in goagent | source code search engine

class GAEFetchFilter(BaseProxyHandlerFilter):
    """force https filter"""
    def filter(self, handler):
        """https://developers.google.com/appengine/docs/python/urlfetch/"""
        if handler.command == 'CONNECT':
            do_ssl_handshake = 440 <= handler.port <= 450 or 1024 <= handler.port <= 65535
            return [handler.STRIP, do_ssl_handshake, self if not common.URLRE_MAP else None]
        elif handler.command in ('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'PATCH'):
            kwargs = {}
            if common.GAE_PASSWORD:
                kwargs['password'] = common.GAE_PASSWORD
            if common.GAE_VALIDATE:
                kwargs['validate'] = 1
            fetchservers = ['%s://%s.appspot.com%s' % (common.GAE_MODE, x, common.GAE_PATH) for x in common.GAE_APPIDS]
            return [handler.URLFETCH, fetchservers, common.FETCHMAX_LOCAL, kwargs]
        else:
            if common.PHP_ENABLE:
                return PHPProxyHandler.handler_filters[-1].filter(handler)
            else:
                logging.warning('"%s %s" not supported by GAE, please enable PHP mode!', handler.command, handler.host)
                return [handler.DIRECT, {}]

然后通过搜代码里面的PHP_ENABLE

而找到相关代码:

        self.PHP_ENABLE = self.CONFIG.getint('php', 'enable')
        self.PHP_LISTEN = self.CONFIG.get('php', 'listen')
        self.PHP_PASSWORD = self.CONFIG.get('php', 'password') if self.CONFIG.has_option('php', 'password') else ''
        self.PHP_CRLF = self.CONFIG.getint('php', 'crlf') if self.CONFIG.has_option('php', 'crlf') else 1
        self.PHP_VALIDATE = self.CONFIG.getint('php', 'validate') if self.CONFIG.has_option('php', 'validate') else 0
        self.PHP_FETCHSERVER = self.CONFIG.get('php', 'fetchserver')
        self.PHP_USEHOSTS = self.CONFIG.getint('php', 'usehosts')

        self.PROXY_ENABLE = self.CONFIG.getint('proxy', 'enable')
        self.PROXY_AUTODETECT = self.CONFIG.getint('proxy', 'autodetect') if self.CONFIG.has_option('proxy', 'autodetect') else 0
        self.PROXY_HOST = self.CONFIG.get('proxy', 'host')
        self.PROXY_PORT = self.CONFIG.getint('proxy', 'port')
        self.PROXY_USERNAME = self.CONFIG.get('proxy', 'username')
        self.PROXY_PASSWROD = self.CONFIG.get('proxy', 'password')

然后看到PAC和PHP等配置信息,所以想到了去看看goagent的配置文件:

goagent-goagent-v3.2.3-40-g5d565b9\goagent-goagent-5d565b9\local\proxy.ini

然后看到了相关配置:

[pac] 
enable = 1 
ip = 0.0.0.0 
port = 8086 
file = proxy.pac 
admode = 1 
adblock = https://easylist-downloads.adblockplus.org/easylistchina.txt
gfwlist = https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt
expired = 86400 

[php] 
enable = 0 
password = 123456 
crlf = 0 
validate = 0 
keepalive = 0 
listen = 127.0.0.1:8088 
fetchserver = http://.com/
hosts = 

[proxy] 
enable = 0 
autodetect = 1 
host = 10.64.1.63 
port = 8080 
username = 
password =

 

然后果然是PHP的enable是0

所以去改为1:

goagent config file php enable to 1

然后重启goagent,看看是否有效果:

可以注意到goagent启动信息中显示PHP了:

goagent running show php mode

然后再去update,看看结果:

直接严重错误:

INFO - [Feb 10 23:14:12] tcp good_ipaddrs=0, bad_ipaddrs=0, unknown_ipaddrs=0 
ERROR - [Feb 10 23:14:12] create_http_request "POST http://.com/?0.537648134684" failed:exceptions must be old-style classes or derived from BaseException, not NoneType 
Traceback (most recent call last): 
File "F:\soft\windows\goagent\goagent-goagent-v3.2.3-40-g5d565b9\goagent-goagent-5d565b9\local\proxylib.py", line 2044, in create_http_request 
File "F:\soft\windows\goagent\goagent-goagent-v3.2.3-40-g5d565b9\goagent-goagent-5d565b9\local\proxylib.py", line 1764, in create_tcp_connection 
TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType 

WARNING - [Feb 10 23:14:12] OPTIONS "https://crifanlib.googlecode.com/svn/trunk" failed TypeError('exceptions must be old-style classes or derived from BaseException, not NoneType',) 

最后还是出错:

INFO - [Feb 10 23:34:16] tcp good_ipaddrs=0, bad_ipaddrs=0, unknown_ipaddrs=0 
ERROR - [Feb 10 23:34:16] create_http_request "POST http://.com/?0.0420394488736" failed:exceptions must be old-style classes or derived from BaseException, not NoneType 
Traceback (most recent call last): 
File "F:\soft\windows\goagent\goagent-goagent-v3.2.3-40-g5d565b9\goagent-goagent-5d565b9\local\proxylib.py", line 2044, in create_http_request 
File "F:\soft\windows\goagent\goagent-goagent-v3.2.3-40-g5d565b9\goagent-goagent-5d565b9\local\proxylib.py", line 1764, in create_tcp_connection 
TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType 

WARNING - [Feb 10 23:34:16] OPTIONS "https://crifanlib.googlecode.com/svn/trunk" failed TypeError('exceptions must be old-style classes or derived from BaseException, not NoneType',)

goagent error create_http_request failed exceptions must be old-style classes

 

目前还是没办法解决此问题。。。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量