【问题标题】:Facing Issue at the time of Creating template DB on Plan section in Odoo SaaS for Odoo 11?在 Odoo SaaS for Odoo 11 的计划部分创建模板数据库时面临问题?
【发布时间】:2019-02-20 07:45:58
【问题描述】:

我在 Odoo SaaS 中创建计划时遇到异常。我正在使用 Ubuntu 16.04、Odoo 11 社区版、Postgres 数据库。 在上面的描述中,我在 SaaS 中创建了一个服务器,然后我制定了计划,然后简单地保存并按下按钮创建模板数据库,然后这个异常就来了。

请向我建议如何处理此问题的解决方案。我按照此文档链接作为参考。 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',))

没有找到任何线索,请帮助我。

【问题讨论】:

  • 我也遇到了同样的问题,你解决了吗?
  • 在 URL 标签中使用 s1.odoo.local:8069。

标签: python odoo saas odoo-11


【解决方案1】:

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

127.0.0.1 s1.odoo.local

将此行附加到您的 /etc/hosts 文件的末尾,将 127.0.0.1 替换为您的预期主机 IP。 或者您可以设置您的脚本,以便使用 IP 地址而不是像 odoo.local 这样的域名

来自官方文档:

如果您在本地运行 odoo,请添加您要使用的域 /etc/主机。例如。 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 客户端-x.odoo.local

127.0.0.1 客户端-y.odoo.local

127.0.0.1 客户端-z.odoo.local

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

【讨论】:

  • 我按照 SaaS 的文档执行的所有步骤,但仍然无法正常工作。请建议我解决此问题的其他方法
  • Failed to establish a new connection: [Errno -2] Name or service not known 此消息确保在这种情况下,name 不会被 dns 服务器解析。如果您的 hosts 文件包含该主机的 IP s1.odoo.local,则它会被解析。
猜你喜欢
  • 2019-07-22
  • 1970-01-01
  • 2019-06-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多