zato server启动后自动关闭问题解决

症状

zato start server 启动server后,过一会server自动关闭了

解决

查看日志

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 269: ordinal not in range(128)
Traceback (most recent call last):
  File "/opt/zato/2.0.5/eggs/gunicorn-18.0-py2.7.egg/gunicorn/arbiter.py", line 494, in spawn_worker
    self.cfg.post_fork(self, worker)
  File "/opt/zato/2.0.5/zato-server/src/zato/server/base/parallel.py", line 817, in post_fork
    ParallelServer.start_server(worker.app.zato_wsgi_app, arbiter.zato_deployment_key)
  File "/opt/zato/2.0.5/zato-server/src/zato/server/base/parallel.py", line 763, in start_server
    is_first = parallel_server._after_init_common(server, zato_deployment_key)
  File "/opt/zato/2.0.5/zato-server/src/zato/server/base/parallel.py", line 330, in _after_init_common
    is_first = self.maybe_on_first_worker(server, self.kvdb.conn, deployment_key)
  File "/opt/zato/2.0.5/zato-server/src/zato/server/base/parallel.py", line 249, in maybe_on_first_worker
    import_initial_services_jobs()
  File "/opt/zato/2.0.5/zato-server/src/zato/server/base/parallel.py", line 215, in import_initial_services_jobs
    self.service_sources, self.base_dir)
  File "/opt/zato/2.0.5/zato-server/src/zato/server/service/store.py", line 125, in import_services_from_anywhere
    self.import_services_from_directory(item_name, base_dir)
  File "/opt/zato/2.0.5/zato-server/src/zato/server/service/store.py", line 175, in import_services_from_directory
    self.import_services_from_file(py_path, False, base_dir)
  File "/opt/zato/2.0.5/zato-server/src/zato/server/service/store.py", line 158, in import_services_from_file
    mod_name, file_name, format_exc(e))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 269: ordinal not in range(128)

搜索,解决方法

在报错的页面添加代码:

import sys 
reload(sys) 
sys.setdefaultencoding('gb18030')

 

posted @ 2015-09-19 12:55  jihite  阅读(620)  评论(0编辑  收藏  举报