然後某學長把 python traceback 貼出來XDrz
身為一個專業的鄉民當然要備份一下
Traceback (most recent call last): File "/home/plurk/plurk/git_trunk/ext/parts/web/wsgiserver/__init__.py", line 1246, in communicate req.respond() File "/home/plurk/plurk/git_trunk/ext/parts/web/wsgiserver/__init__.py", line 758, in respond self.server.gateway(self).respond() File "/home/plurk/plurk/git_trunk/ext/parts/web/wsgiserver/__init__.py", line 1949, in respond response = self.req.server.wsgi_app(self.env, self.start_response) File "/home/plurk/plurk/git_trunk/ext/werkzeug/utils.py", line 859, in __call__ return self.app(environ, start_response) File "/home/plurk/plurk/git_trunk/ext/parts/web/web.py", line 295, in dispatch_request rv = handle_error() File "/home/plurk/plurk/git_trunk/ext/parts/web/web.py", line 358, in handle_error result = handler(e) File "plurk/web/error_handler.py", line 65, in error_handler trace_back=t_b) File "plurk/templates.py", line 147, in renderPlurkTemplate html = PlurkTemplates().addDynamicData(html, ses_user, page_user) File "plurk/templates.py", line 153, in addDynamicData 'session_user': users.exposeSessionUser(ses_user), File "plurk/users.py", line 342, in exposeSessionUser session_user['notifications_count'] = Notifications().getCount(user.id) File "/home/plurk/plurk/git_trunk/ext/parts/cache/__init__.py", line 125, in proxy value = f(*args, **kwargs) File "plurk/models/notifications.py", line 114, in getCount is_email_confirmed = Users().isEmailConfirmed(uid) File "plurk/models/users.py", line 210, in isEmailConfirmed row = main_db().select('users_map', id=uid, cols='is_email_confirmed', as_one=True) File "/home/plurk/plurk/git_trunk/ext/parts/db/wrapper.py", line 121, in select with self.cursor(sql) as cursor: File "/home/plurk/plurk/git_trunk/ext/parts/db/wrapper.py", line 55, in cursor con = self.connections.getConnection(host) File "/home/plurk/plurk/git_trunk/ext/parts/db/wrapper.py", line 578, in getConnection (pprint.pformat(attempts), dbinfo, exception)) Exception: Could not create a connection on server [{'charset': 'utf8', 'compress': False, 'exception': 'Traceback (most recent call last):\n File "/home/plurk/plurk/git_trunk/ext/parts/db/wrapper.py", line 557, in getConnection\n con = MySQLdb.Connect(**conf)\n File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect\n return Connection(*args, **kwargs)\n File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__\n super(Connection, self).__init__(*args, **kwargs2)\nOperationalError: (2003, "Can\'t connect to MySQL server on \'192.168.0.211\' (99)")\n', 'host': '192.168.0.211', 'passwd': 'plurk', 'port': 3306, 'refresh': True, 'refresh_host': '192.168.0.211', 'use_unicode': True, 'user': 'plurk'}, {'charset': 'utf8', 'compress': False, 'exception': 'Traceback (most recent call last):\n File "/home/plurk/plurk/git_trunk/ext/parts/db/wrapper.py", line 557, in getConnection\n con = MySQLdb.Connect(**conf)\n File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect\n return Connection(*args, **kwargs)\n File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__\n super(Connection, self).__init__(*args, **kwargs2)\nOperationalError: (2003, "Can\'t connect to MySQL server on \'192.168.0.211\' (99)")\n', 'host': '192.168.0.211', 'passwd': 'plurk', 'port': 3306, 'refresh': True, 'refresh_host': '192.168.0.211', 'use_unicode': True, 'user': 'plurk'}, {'charset': 'utf8', 'compress': False, 'exception': 'Traceback (most recent call last):\n File "/home/plurk/plurk/git_trunk/ext/parts/db/wrapper.py", line 557, in getConnection\n con = MySQLdb.Connect(**conf)\n File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect\n return Connection(*args, **kwargs)\n File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__\n super(Connection, self).__init__(*args, **kwargs2)\nOperationalError: (2003, "Can\'t connect to MySQL server on \'192.168.0.211\' (99)")\n', 'host': '192.168.0.211', 'passwd': 'plurk', 'port': 3306, 'refresh': True, 'refresh_host': '192.168.0.211', 'use_unicode': True, 'user': 'plurk'}] .{'_rhost': '192.168.0.211', 'server_name': 'main', 'use_unicode': True, 'compress': False, 'charset': 'utf8', 'db': 'plurk_main', 'resolve_host': None, 'id': 'main', 'host': '192.168.0.211', 'user': 'plurk', 'refresh_host': <function refresh_host at 0x7f0a4cb03938>, 'password': 'plurk', 'port': 3306} Error was Traceback (most recent call last): File "/home/plurk/plurk/git_trunk/ext/parts/db/wrapper.py", line 557, in getConnection con = MySQLdb.Connect(**conf) File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect return Connection(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__ super(Connection, self).__init__(*args, **kwargs2) OperationalError: (2003, "Can't connect to MySQL server on '192.168.0.211' (99)")===
從這份信息我們可以知道
plurk 跑在 wsgi 上面,有用 werkzeug
透過 git 管理代碼,server 上面的 account 叫做 plurk
內網的 192.168.0.211 跑 MySQL,port 沒換,user / passwd 都是 plurk
========
順便附上 Orange 大大的 slides 吧,page 26
No comments:
Post a Comment