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')

 




本文转自jihite博客园博客,原文链接:http://www.cnblogs.com/kaituorensheng/p/4821313.html,如需转载请自行联系原作者

相关文章
|
应用服务中间件
tomcat重启时保持会话关闭
tomcat重启时保持会话关闭
|
自然语言处理 Java
CoreNLP server的开启与使用方法
Ubuntu20.04.2系统本身不含有JDK,而CoreNLP需要依赖JDK进行运行,所以需要先安装好JDK,可以输入java,然后系统会自动提示没有安装JDK,并会推荐安装的版本
213 0
|
7月前
|
NoSQL Redis 数据库
Redis server启动后会做哪些操作?
Redis server启动后会做哪些操作?
|
关系型数据库 MySQL
Windows10 开启、关闭、重启MySQL服务
Windows10 开启、关闭、重启MySQL服务
576 0
Windows10 开启、关闭、重启MySQL服务
|
关系型数据库 MySQL Windows
关于windows server 2019安装mysql 8.0 版本报错服务没有及时响应启动或控制请求
windows server 2019安装mysql 8.0 版本报错服务没有及时响应启动或控制请求
|
关系型数据库 MySQL Oracle