{"action":"opened","issue":{"url":"https://api.github.com/repos/yelizariev/odoo-saas-tools/issues/73","labels_url":"https://api.github.com/repos/yelizariev/odoo-saas-tools/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/yelizariev/odoo-saas-tools/issues/73/comments","events_url":"https://api.github.com/repos/yelizariev/odoo-saas-tools/issues/73/events","html_url":"https://github.com/yelizariev/odoo-saas-tools/issues/73","id":119485582,"number":73,"title":"Create template DB button error: False werkzeug","user":{"login":"novaq","id":9006361,"avatar_url":"https://avatars.githubusercontent.com/u/9006361?v=3","gravatar_id":"","url":"https://api.github.com/users/novaq","html_url":"https://github.com/novaq","followers_url":"https://api.github.com/users/novaq/followers","following_url":"https://api.github.com/users/novaq/following{/other_user}","gists_url":"https://api.github.com/users/novaq/gists{/gist_id}","starred_url":"https://api.github.com/users/novaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novaq/subscriptions","organizations_url":"https://api.github.com/users/novaq/orgs","repos_url":"https://api.github.com/users/novaq/repos","events_url":"https://api.github.com/users/novaq/events{/privacy}","received_events_url":"https://api.github.com/users/novaq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-30T12:48:25Z","updated_at":"2015-11-30T12:48:25Z","closed_at":null,"body":"Hi!\r\n\r\nWe have the following setup:\r\ndomain.com and sub.domain.com proxied by nginx to the same Odoo instance but each running their own database.\r\n\r\nConfiguration file:\r\n```\r\n[options]\r\nadmin_passwd = <PASS>\r\ndb_host = False\r\ndb_port = False\r\ndb_user = odoo\r\ndb_password = False\r\naddons_path = /usr/lib/python2.7/dist-packages/openerp/addons\r\nlogfile = /var/log/odoo/odoo-server.log\r\naddons_path=/opt/odoo/odoo-server/addons,/opt/odoo/custom/addons\r\ndbfilter = %h\r\nsmtp_server = False\r\n```\r\n\r\nNginx configuration:\r\n```\r\nserver {\r\n    listen 80;\r\n    server_name sub.domain.com;\r\n    location / {\r\n        proxy_pass http://sub.domain.com:8069;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header X-Forwarded-Proto $scheme;\r\n    }\r\n}\r\n```\r\n\r\nAfter I press the red \"Create template DB\" button in a plan I get \"Warning: Status Code - 500\r\nReason - INTERNAL SERVER ERROR\".\r\n\r\nLog excerpt:\r\n```\r\n2015-11-26 12:07:22,493 28769 INFO test_14 werkzeug: 10.0.1.2 - - [26/Nov/2015 12:07:22] \"GET /saas_server/new_database?access_token=YT5DobJ3rVobuN3a2bHDI9B2hdCVMZ&expires_in=3600&token_type=Bearer&state=%7B%22lang%22%3A+%22en_US%22%2C+%22tz%22%3A+%22Europe%2FBerlin%22%2C+%22d%22%3A+%22test_14%22%2C+%22demo%22%3A+0%2C+%22is_template_db%22%3A+1%2C+%22addons%22%3A+%5B%5D%7D&redirect_uri=http%3A%2F%2Fsub.domain.com%3A80%2Fsaas_server%2Fnew_database&response_type=token&client_id=24695098-9436-11e5-81eb-00155dfe7603&scope=userinfo+force_login+trial+skiptheuse HTTP/1.0\" 200 -\r\n2015-11-26 12:07:22,506 28769 INFO domain.com requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): sub.domain.com\r\n2015-11-26 12:07:22,513 28769 INFO sub.domain.com openerp.addons.saas_server.controllers.main: sync_server post: {'access_token': u'PviQZ2TWQ0MgoP6NelSbOq0GlxcO0h', 'expires_in': u'3600', 'token_type': u'Bearer', 'state': u'{\"d\": \"sub.domain.com\", \"client_id\": \"5f49c05e-8ed6-11e5-8003-00155dfe7603\"}', 'redirect_uri': u'http://sub.domain.com:80/web', 'response_type': u'token', 'client_id': u'5f49c05e-8ed6-11e5-8003-00155dfe7603', 'scope': u'userinfo force_login trial skiptheuse'}\r\n2015-11-26 12:07:22,531 28769 INFO domain.com werkzeug: 10.0.1.2 - - [26/Nov/2015 12:07:22] \"GET /oauth2/tokeninfo?access_token=PviQZ2TWQ0MgoP6NelSbOq0GlxcO0h HTTP/1.0\" 200 -\r\n2015-11-26 12:07:22,542 28769 INFO t1.domain.com openerp.modules.loading: loading 1 modules...\r\n2015-11-26 12:07:22,550 28769 INFO t1.domain.com openerp.modules.loading: 1 modules loaded in 0.01s, 0 queries\r\n2015-11-26 12:07:22,560 28769 INFO t1.domain.com openerp.modules.loading: loading 24 modules...\r\n2015-11-26 12:07:22,567 28769 INFO t1.domain.com openerp.modules.loading: 24 modules loaded in 0.01s, 0 queries\r\n2015-11-26 12:07:22,839 28769 INFO t1.domain.com openerp.modules.loading: Modules loaded.\r\n2015-11-26 12:07:22,852 28769 INFO False werkzeug: 10.0.1.2 - - [26/Nov/2015 12:07:22] \"GET /saas_server/sync_server?access_token=PviQZ2TWQ0MgoP6NelSbOq0GlxcO0h&expires_in=3600&token_type=Bearer&state=%7B%22d%22%3A+%22sub.domain.com%22%2C+%22client_id%22%3A+%225f49c05e-8ed6-11e5-8003-00155dfe7603%22%7D&redirect_uri=http%3A%2F%2Fsub.domain.com%3A80%2Fweb&response_type=token&client_id=5f49c05e-8ed6-11e5-8003-00155dfe7603&scope=userinfo+force_login+trial+skiptheuse HTTP/1.0\" 500 -\r\n2015-11-26 12:07:22,853 28769 ERROR domain.com openerp.http: Exception during JSON request handling.\r\nTraceback (most recent call last):\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 537, in _handle_exception\r\n    return super(JsonRequest, self)._handle_exception(exception)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 574, in dispatch\r\n    result = self._call_function(**self.params)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 310, in _call_function\r\n    return checked_call(self.db, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/service/model.py\", line 118, in wrapper\r\n    return f(dbname, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 307, in checked_call\r\n    return self.endpoint(*a, **kw)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 803, in __call__\r\n    return self.method(*args, **kw)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 403, in response_wrap\r\n    response = f(*args, **kw)\r\n  File \"/opt/odoo/odoo-server/addons/web/controllers/main.py\", line 948, in call_button\r\n    action = self._call_kw(model, method, args, {})\r\n  File \"/opt/odoo/odoo-server/addons/web/controllers/main.py\", line 936, in _call_kw\r\n    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 250, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 372, in old_api\r\n    result = method(recs, *args, **kwargs)\r\n  File \"/opt/odoo/custom/addons/saas_portal/models/saas_portal.py\", line 288, in create_template\r\n    return self.action_sync_server()\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 248, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 416, in new_api\r\n    result = [method(rec, *args, **kwargs) for rec in self]\r\n  File \"/opt/odoo/custom/addons/saas_portal/models/saas_portal.py\", line 292, in action_sync_server\r\n    self.server_id.action_sync_server()\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 248, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 416, in new_api\r\n    result = [method(rec, *args, **kwargs) for rec in self]\r\n  File \"/opt/odoo/custom/addons/saas_portal/models/saas_portal.py\", line 109, in action_sync_server\r\n    raise Warning(msg)\r\nWarning: Status Code - 500\r\nReason - INTERNAL SERVER ERROR\r\nURL - http://sub.domain.com:80/saas_server/sync_server?access_token=PviQZ2TWQ0MgoP6NelSbOq0GlxcO0h&expires_in=3600&token_type=Bearer&state=%7B%22d%22%3A+%22sub.domain.com%22%2C+%22client_id%22%3A+%225f49c05e-8ed6-11e5-8003-00155dfe7603%22%7D&redirect_uri=http%3A%2F%2Fsub.domain.com%3A80%2Fweb&response_type=token&client_id=5f49c05e-8ed6-11e5-8003-00155dfe7603&scope=userinfo+force_login+trial+skiptheuse\r\n\r\n2015-11-26 12:07:22,855 28769 INFO domain.com werkzeug: 10.0.1.2 - - [26/Nov/2015 12:07:22] \"POST /web/dataset/call_button HTTP/1.0\" 200 -\r\n2015-11-26 12:07:22,864 28769 ERROR False werkzeug: Error on request:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/werkzeug/serving.py\", line 177, in run_wsgi\r\n    execute(self.server.app)\r\n  File \"/usr/lib/python2.7/dist-packages/werkzeug/serving.py\", line 165, in execute\r\n    application_iter = app(environ, start_response)\r\n  File \"/opt/odoo/odoo-server/openerp/service/server.py\", line 290, in app\r\n    return self.app(e, s)\r\n  File \"/opt/odoo/odoo-server/openerp/service/wsgi_server.py\", line 216, in application\r\n    return application_unproxied(environ, start_response)\r\n  File \"/opt/odoo/odoo-server/openerp/service/wsgi_server.py\", line 202, in application_unproxied\r\n    result = handler(environ, start_response)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 1290, in __call__\r\n    return self.dispatch(environ, start_response)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 1264, in __call__\r\n    return self.app(environ, start_wrapped)\r\n  File \"/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py\", line 579, in __call__\r\n    return self.app(environ, start_response)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 1264, in __call__\r\n    return self.app(environ, start_wrapped)\r\n  File \"/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py\", line 579, in __call__\r\n    return self.app(environ, start_response)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 1264, in __call__\r\n    return self.app(environ, start_wrapped)\r\n  File \"/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py\", line 579, in __call__\r\n    return self.app(environ, start_response)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 1437, in dispatch\r\n    result = ir_http._dispatch()\r\n  File \"/opt/odoo/odoo-server/addons/website/models/ir_http.py\", line 148, in _dispatch\r\n    resp = super(ir_http, self)._dispatch()\r\n  File \"/opt/odoo/odoo-server/openerp/addons/base/ir/ir_http.py\", line 175, in _dispatch\r\n    return self._handle_exception(e)\r\n  File \"/opt/odoo/odoo-server/addons/website/models/ir_http.py\", line 196, in _handle_exception\r\n    return super(ir_http, self)._handle_exception(exception)\r\n  File \"/opt/odoo/odoo-server/openerp/addons/base/ir/ir_http.py\", line 145, in _handle_exception\r\n    return request._handle_exception(exception)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 666, in _handle_exception\r\n    return super(HttpRequest, self)._handle_exception(exception)\r\n  File \"/opt/odoo/odoo-server/openerp/addons/base/ir/ir_http.py\", line 171, in _dispatch\r\n    result = request.dispatch()\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 684, in dispatch\r\n    r = self._call_function(**self.params)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 310, in _call_function\r\n    return checked_call(self.db, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/service/model.py\", line 118, in wrapper\r\n    return f(dbname, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 307, in checked_call\r\n    return self.endpoint(*a, **kw)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 803, in __call__\r\n    return self.method(*args, **kw)\r\n  File \"/opt/odoo/odoo-server/openerp/http.py\", line 403, in response_wrap\r\n    response = f(*args, **kw)\r\n  File \"/opt/odoo/custom/addons/saas_server/controllers/main.py\", line 233, in stats\r\n    request.env['saas_server.client'].update_all()\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 248, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/opt/odoo/custom/addons/saas_server/models/saas_server.py\", line 188, in update_all\r\n    self.sudo().search([]).update()\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 248, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 416, in new_api\r\n    result = [method(rec, *args, **kwargs) for rec in self]\r\n  File \"/opt/odoo/custom/addons/saas_server/models/saas_server.py\", line 193, in update\r\n    registry = self.registry()[0]\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 248, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/api.py\", line 416, in new_api\r\n    result = [method(rec, *args, **kwargs) for rec in self]\r\n  File \"/opt/odoo/custom/addons/saas_server/models/saas_server.py\", line 58, in registry\r\n    return m.get(self.name, **kwargs)\r\n  File \"/opt/odoo/odoo-server/openerp/modules/registry.py\", line 339, in get\r\n    update_module)\r\n  File \"/opt/odoo/odoo-server/openerp/modules/registry.py\", line 356, in new\r\n    registry = Registry(db_name)\r\n  File \"/opt/odoo/odoo-server/openerp/modules/registry.py\", line 60, in __init__\r\n    self._db = openerp.sql_db.db_connect(db_name)\r\n  File \"/opt/odoo/odoo-server/openerp/sql_db.py\", line 623, in db_connect\r\n    db, uri = dsn(to)\r\n  File \"/opt/odoo/odoo-server/openerp/sql_db.py\", line 597, in dsn\r\n    if db_or_uri.startswith(('postgresql://', 'postgres://')):\r\nAttributeError: 'bool' object has no attribute 'startswith'\r\n```"}}