Skip to content

Instantly share code, notes, and snippets.

@epifanio
Created June 18, 2021 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epifanio/652344e45ebd1ac9c7a64e9c96f80167 to your computer and use it in GitHub Desktop.
Save epifanio/652344e45ebd1ac9c7a64e9c96f80167 to your computer and use it in GitHub Desktop.
[SQL: SELECT count(*) AS count_1
FROM (SELECT adc_records.identifier AS adc_records_identifier, adc_records.typename AS adc_records_typename, adc_records.schema AS adc_records_schema, adc_records.mdsource AS adc_records_mdsource, adc_records.insert_date AS adc_records_insert_date, adc_records.xml AS adc_records_xml, adc_records.anytext AS adc_records_anytext, adc_records.metadata AS adc_records_metadata, adc_records.metadata_type AS adc_records_metadata_type, adc_records.language AS adc_records_language, adc_records.type AS adc_records_type, adc_records.title AS adc_records_title, adc_records.title_alternate AS adc_records_title_alternate, adc_records.abstract AS adc_records_abstract, adc_records.keywords AS adc_records_keywords, adc_records.keywordstype AS adc_records_keywordstype, adc_records.parentidentifier AS adc_records_parentidentifier, adc_records.relation AS adc_records_relation, adc_records.time_begin AS adc_records_time_begin, adc_records.time_end AS adc_records_time_end, adc_records.topicategory AS adc_records_topicategory, adc_records.resourcelanguage AS adc_records_resourcelanguage, adc_records.creator AS adc_records_creator, adc_records.publisher AS adc_records_publisher, adc_records.contributor AS adc_records_contributor, adc_records.organization AS adc_records_organization, adc_records.distributor AS adc_records_distributor, adc_records.securityconstraints AS adc_records_securityconstraints, adc_records.accessconstraints AS adc_records_accessconstraints, adc_records.useconstraints AS adc_records_useconstraints, adc_records.otherconstraints AS adc_records_otherconstraints, adc_records.date AS adc_records_date, adc_records.date_revision AS adc_records_date_revision, adc_records.date_creation AS adc_records_date_creation, adc_records.date_publication AS adc_records_date_publication, adc_records.date_modified AS adc_records_date_modified, adc_records.format AS adc_records_format, adc_records.source AS adc_records_source, adc_records.crs AS adc_records_crs, adc_records.geodescode AS adc_records_geodescode, adc_records.denominator AS adc_records_denominator, adc_records.distancevalue AS adc_records_distancevalue, adc_records.distanceuom AS adc_records_distanceuom, adc_records.wkt_geometry AS adc_records_wkt_geometry, adc_records.servicetype AS adc_records_servicetype, adc_records.servicetypeversion AS adc_records_servicetypeversion, adc_records.operation AS adc_records_operation, adc_records.couplingtype AS adc_records_couplingtype, adc_records.operateson AS adc_records_operateson, adc_records.operatesonidentifier AS adc_records_operatesonidentifier, adc_records.operatesoname AS adc_records_operatesoname, adc_records.degree AS adc_records_degree, adc_records.classification AS adc_records_classification, adc_records.conditionapplyingtoaccessanduse AS adc_records_conditionapplyingtoaccessanduse, adc_records.lineage AS adc_records_lineage, adc_records.responsiblepartyrole AS adc_records_responsiblepartyrole, adc_records.specificationtitle AS adc_records_specificationtitle, adc_records.specificationdate AS adc_records_specificationdate, adc_records.specificationdatetype AS adc_records_specificationdatetype, adc_records.platform AS adc_records_platform, adc_records.instrument AS adc_records_instrument, adc_records.sensortype AS adc_records_sensortype, adc_records.cloudcover AS adc_records_cloudcover, adc_records.bands AS adc_records_bands, adc_records.links AS adc_records_links, adc_records.anytext_tsvector AS adc_records_anytext_tsvector
FROM adc_records) AS anon_1]
(Background on this error at: http://sqlalche.me/e/14/e3q8)
Fri, 18 Jun 2021 17:35:39] [DEBUG] file=/home/pycsw/pycsw/pycsw/ogc/api/records.py line=427 module=records function=items Transforming property filters into CQL
Fri, 18 Jun 2021 17:35:39] [DEBUG] file=/home/pycsw/pycsw/pycsw/ogc/api/records.py line=446 module=records function=items Evaluating CQL and other specified filtering parameters
Fri, 18 Jun 2021 17:35:39] [DEBUG] file=/home/pycsw/pycsw/pycsw/ogc/api/records.py line=456 module=records function=items CQL query: None
Fri, 18 Jun 2021 17:35:39] [DEBUG] file=/home/pycsw/pycsw/pycsw/ogc/api/records.py line=482 module=records function=items Query: SELECT adc_records.identifier AS adc_records_identifier, adc_records.typename AS adc_records_typename, adc_records.schema AS adc_records_schema, adc_records.mdsource AS adc_records_mdsource, adc_records.insert_date AS adc_records_insert_date, adc_records.xml AS adc_records_xml, adc_records.anytext AS adc_records_anytext, adc_records.metadata AS adc_records_metadata, adc_records.metadata_type AS adc_records_metadata_type, adc_records.language AS adc_records_language, adc_records.type AS adc_records_type, adc_records.title AS adc_records_title, adc_records.title_alternate AS adc_records_title_alternate, adc_records.abstract AS adc_records_abstract, adc_records.keywords AS adc_records_keywords, adc_records.keywordstype AS adc_records_keywordstype, adc_records.parentidentifier AS adc_records_parentidentifier, adc_records.relation AS adc_records_relation, adc_records.time_begin AS adc_records_time_begin, adc_records.time_end AS adc_records_time_end, adc_records.topicategory AS adc_records_topicategory, adc_records.resourcelanguage AS adc_records_resourcelanguage, adc_records.creator AS adc_records_creator, adc_records.publisher AS adc_records_publisher, adc_records.contributor AS adc_records_contributor, adc_records.organization AS adc_records_organization, adc_records.distributor AS adc_records_distributor, adc_records.securityconstraints AS adc_records_securityconstraints, adc_records.accessconstraints AS adc_records_accessconstraints, adc_records.useconstraints AS adc_records_useconstraints, adc_records.otherconstraints AS adc_records_otherconstraints, adc_records.date AS adc_records_date, adc_records.date_revision AS adc_records_date_revision, adc_records.date_creation AS adc_records_date_creation, adc_records.date_publication AS adc_records_date_publication, adc_records.date_modified AS adc_records_date_modified, adc_records.format AS adc_records_format, adc_records.source AS adc_records_source, adc_records.crs AS adc_records_crs, adc_records.geodescode AS adc_records_geodescode, adc_records.denominator AS adc_records_denominator, adc_records.distancevalue AS adc_records_distancevalue, adc_records.distanceuom AS adc_records_distanceuom, adc_records.wkt_geometry AS adc_records_wkt_geometry, adc_records.servicetype AS adc_records_servicetype, adc_records.servicetypeversion AS adc_records_servicetypeversion, adc_records.operation AS adc_records_operation, adc_records.couplingtype AS adc_records_couplingtype, adc_records.operateson AS adc_records_operateson, adc_records.operatesonidentifier AS adc_records_operatesonidentifier, adc_records.operatesoname AS adc_records_operatesoname, adc_records.degree AS adc_records_degree, adc_records.classification AS adc_records_classification, adc_records.conditionapplyingtoaccessanduse AS adc_records_conditionapplyingtoaccessanduse, adc_records.lineage AS adc_records_lineage, adc_records.responsiblepartyrole AS adc_records_responsiblepartyrole, adc_records.specificationtitle AS adc_records_specificationtitle, adc_records.specificationdate AS adc_records_specificationdate, adc_records.specificationdatetype AS adc_records_specificationdatetype, adc_records.platform AS adc_records_platform, adc_records.instrument AS adc_records_instrument, adc_records.sensortype AS adc_records_sensortype, adc_records.cloudcover AS adc_records_cloudcover, adc_records.bands AS adc_records_bands, adc_records.links AS adc_records_links, adc_records.anytext_tsvector AS adc_records_anytext_tsvector
FROM adc_records
Fri, 18 Jun 2021 17:35:39] [DEBUG] file=/home/pycsw/pycsw/pycsw/ogc/api/records.py line=483 module=records function=items Querying repository
Fri, 18 Jun 2021 17:35:39] [ERROR] file=/usr/local/lib/python3.8/site-packages/flask/app.py line=1454 module=app function=log_exception Exception on /collections/metadata:main/items [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3211, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 307, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 767, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 430, in checkout
rec._checkin_failed(err, _fairy_was_created=False)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
raise exception
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 427, in checkout
dbapi_connection = rec.get_connection()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 552, in get_connection
self.__connect()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 611, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
raise exception
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 605, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 578, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 584, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.8/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: sorry, too many clients already
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/home/pycsw/pycsw/pycsw/wsgi_flask.py", line 149, in items
return get_response(api_.items(dict(request.headers), request.args))
File "/home/pycsw/pycsw/pycsw/ogc/api/records.py", line 484, in items
count = query.count()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3078, in count
return self._from_self(col).enable_eagerloads(False).scalar()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2819, in scalar
ret = self.one()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2796, in one
return self._iter().one()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2834, in _iter
result = self.session.execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1683, in execute
conn = self._connection_for_bind(bind, close_with_result=True)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1535, in _connection_for_bind
conn = engine.connect(**kw)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3165, in connect
return self._connection_cls(self, close_with_result=close_with_result)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 96, in __init__
else engine.raw_connection()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3244, in raw_connection
return self._wrap_pool_connect(self.pool.connect, _connection)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3214, in _wrap_pool_connect
Connection._handle_dbapi_exception_noconnection(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2068, in _handle_dbapi_exception_noconnection
util.raise_(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
raise exception
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3211, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 307, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 767, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 430, in checkout
rec._checkin_failed(err, _fairy_was_created=False)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
raise exception
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 427, in checkout
dbapi_connection = rec.get_connection()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 552, in get_connection
self.__connect()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 611, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
compat.raise_(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
raise exception
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 605, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 578, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 584, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.8/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: sorry, too many clients already
(Background on this error at: http://sqlalche.me/e/14/e3q8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment