[ckan-dev] database connection error if database on a separate server

Hildegard.GERLACH at ec.europa.eu Hildegard.GERLACH at ec.europa.eu
Wed May 3 09:51:30 UTC 2017


Dear all,

I am having the following issue:
I am setting up a production server on which I want to use the postgresql database on a separate database server instead installing it locally (with the local installations I never had this problem).

I am using Ckan 2.5.1 and postgresql 9.6

When I connect the first time to the server, I get the error below and the page shows "Server error". If I reload the page, it works. There seems to be a timeout in the database but I couldn't find a setting to fix it.

Error - <class 'sqlalchemy.exc.OperationalError'>: (OperationalError) server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
 'SELECT system_info.id AS system_info_id, system_info.key AS system_info_key, system_info.value AS system_info_value, system_info.state AS system_info_state, system_info.revision_id AS system_info_revision_id \nFROM system_info \nWHERE system_info.key = %(key_1)s \n LIMIT %(param_1)s' {'param_1': 1, 'key_1': 'ckan.config_update'}
URL: http://h06-prd-bisorepo-ext.jrc.it/
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/weberror/errormiddleware.py', line 171 in __call__
  app_iter = self.application(environ, sr_checker)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
  resp = self.call_func(req, *args, **self.kwargs)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
  return self.func(req, *args, **kwargs)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__
  return request.get_response(self.app)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
  application, catch_exc_info=False)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
  app_iter = application(self.environ, start_response)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
  resp = self.call_func(req, *args, **self.kwargs)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
  return self.func(req, *args, **kwargs)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in __call__
  response = request.get_response(self.app)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
  application, catch_exc_info=False)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
  app_iter = application(self.environ, start_response)
File '/Ckan/ckan_home/beo/src/ckan/ckan/config/middleware.py', line 389 in inner
  result = application(environ, start_response)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/beaker/middleware.py', line 73 in __call__
  return self.app(environ, start_response)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__
  return self.wrap_app(environ, session_start_response)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__
  response = self.app(environ, start_response)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch
  return controller(environ, start_response)
File '/Ckan/ckan_home/beo/src/ckan/ckan/lib/base.py', line 337 in __call__
  res = WSGIController.__call__(self, environ, start_response)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/pylons/controllers/core.py', line 217 in __call__
  response = self._inspect_call(self.__before__)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call
  result = self._perform_call(func, args)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call
  return func(**args)
File '/Ckan/ckan_home/beo/src/ckan/ckan/controllers/home.py', line 21 in __before__
  base.BaseController.__before__(self, action, **env)
File '/Ckan/ckan_home/beo/src/ckan/ckan/lib/base.py', line 239 in __before__
  app_globals.app_globals._check_uptodate()
File '/Ckan/ckan_home/beo/src/ckan/ckan/lib/app_globals.py', line 202 in _check_uptodate
  value = model.get_system_info('ckan.config_update')
File '/Ckan/ckan_home/beo/src/ckan/ckan/model/system_info.py', line 54 in get_system_info
  obj = meta.Session.query(SystemInfo).filter_by(key=key).first()
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2334 in first
  ret = list(self[0:1])
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2201 in __getitem__
  return list(res)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2405 in __iter__
  return self._execute_and_instances(context)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2420 in _execute_and_instances
  result = conn.execute(querycontext.statement, self._params)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 727 in execute
  return meth(self, multiparams, params)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/sql/elements.py', line 322 in _execute_on_connection
  return connection._execute_clauseelement(self, multiparams, params)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 824 in _execute_clauseelement
  compiled_sql, distilled_params
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 954 in _execute_context
  context)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 1116 in _handle_dbapi_exception
  exc_info
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/util/compat.py', line 189 in raise_from_cause
  reraise(type(exception), exception, tb=exc_tb)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 947 in _execute_context
  context)
File '/Ckan/ckan_home/beo/lib/python2.7/site-packages/sqlalchemy/engine/default.py', line 435 in do_execute
  cursor.execute(statement, parameters)
OperationalError: (OperationalError) server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
 'SELECT system_info.id AS system_info_id, system_info.key AS system_info_key, system_info.value AS system_info_value, system_info.state AS system_info_state, system_info.revision_id AS system_info_revision_id \nFROM system_info \nWHERE system_info.key = %(key_1)s \n LIMIT %(param_1)s' {'param_1': 1, 'key_1': 'ckan.config_update'}

Has someone experienced the same problem and has a solution for it ?

Thank you.

Hilde
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20170503/5ab92f09/attachment-0002.html>


More information about the ckan-dev mailing list