在Odoo 11的Odoo SaaS中的“按计划创建模板数据库”部分时面临问题吗?

时间:2019-02-20 07:45:59

标签: python odoo saas odoo-11

在Odoo SaaS中创建计划时,我面临异常。我正在使用Ubuntu 16.04,Odoo 11 Community Edition,Postgres数据库。 在以上描述中,我先在SaaS中创建服务器,然后制定Plan,然后简单保存并在出现此异常后按“按钮创建模板DB”。

请向我建议解决方案。我遵循此文档链接作为参考。 Odoo Saas Tool kit,并在SaaS中创建计划时面临以下异常。

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 57, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 181, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fdf70915f60>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='s1.odoo.local', port=80): Max retries exceeded with url: /saas_server/new_database (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdf70915f60>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/shivam/Videos/odoo-11.0/odoo/http.py", line 651, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/shivam/Videos/odoo-11.0/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/shivam/Videos/odoo-11.0/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/shivam/Videos/odoo-11.0/odoo/http.py", line 693, in dispatch
    result = self._call_function(**self.params)
  File "/home/shivam/Videos/odoo-11.0/odoo/http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/shivam/Videos/odoo-11.0/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/shivam/Videos/odoo-11.0/odoo/http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/shivam/Videos/odoo-11.0/odoo/http.py", line 937, in __call__
    return self.method(*args, **kw)
  File "/home/shivam/Videos/odoo-11.0/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/home/shivam/Videos/odoo-11.0/addons/web/controllers/main.py", line 938, in call_button
    action = self._call_kw(model, method, args, {})
  File "/home/shivam/Videos/odoo-11.0/addons/web/controllers/main.py", line 926, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/shivam/Videos/odoo-11.0/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/home/shivam/Videos/odoo-11.0/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/shivam/Videos/odoo-11.0/odoo-saas-tools/saas_portal/models/saas_portal.py", line 410, in create_template_button
    return self.create_template()
  File "/home/shivam/Videos/odoo-11.0/odoo-saas-tools/saas_portal/models/saas_portal.py", line 428, in create_template
    res = requests.Session().send(req, **req_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='s1.odoo.local', port=80): Max retries exceeded with url: /saas_server/new_database (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdf70915f60>: Failed to establish a new connection: [Errno -2] Name or service not known',))

找不到关于此的任何线索,请帮助我。

1 个答案:

答案 0 :(得分:0)

从堆栈跟踪中,可以确保脚本正在尝试解析不在您的s1.odoo.localdns条目中的hosts,因此您应该在您的主机名中输入该主机条目。 /etc/hosts文件,其中包含您要将此域解析为的主机的IP地址。例如,

127.0.0.1 s1.odoo.local

将此行添加到/etc/hosts文件的末尾,将127.0.0.1替换为预期的主机IP。 或者,您可以设置脚本,以便使用IP地址代替odoo.local

这样的域名。

摘自官方文档:

  

如果您在本地运行odoo,请添加要使用的域   / etc / hosts。例如。   127.0.0.1 odoo.local#门户网站

     

127.0.0.1 s1.odoo.local#服务器

     

127.0.0.1 t1.odoo.local#模板

     

127.0.0.1 t2.odoo.local#模板

     

127.0.0.1 client-x.odoo.local

     

127.0.0.1 client-y.odoo.local

     

127.0.0.1 client-z.odoo.local

只需遵循文档!您链接了您的问题,但您甚至没有关注它。