-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout generate patrimonales species #41
Comments
J'ai regardé du côté des 3 vues Nouveau log obtenu : [2023-11-27 12:50:42 +0100] [298012] [ERROR] Error handling request /geonature/api/zones_humides/283/taxa
Traceback (most recent call last):
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.InvalidRowCountInLimitClause: ERREUR: LIMIT ne doit pas être négative
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 135, in handle
self.handle_request(listener, req, client, addr)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 178, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask/app.py", line 2552, in __call__
return self.wsgi_app(environ, start_response)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/werkzeug/middleware/dispatcher.py", line 78, in __call__
return app(environ, start_response)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/werkzeug/middleware/shared_data.py", line 247, in __call__
return self.app(environ, start_response)
File "/home/geonatureadmin/geonature/backend/geonature/middlewares/__init__.py", line 16, in __call__
return self.app(environ, new_start_response)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/werkzeug/middleware/proxy_fix.py", line 187, in __call__
return self.app(environ, start_response)
File "/home/geonatureadmin/geonature/backend/geonature/middlewares/__init__.py", line 27, in __call__
return self.app(environ, start_response)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask/app.py", line 2532, in wsgi_app
response = self.handle_exception(e)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask_cors/extension.py", line 176, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask_cors/extension.py", line 176, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask/app.py", line 1676, in handle_user_exception
return self.ensure_sync(handler)(e)
File "/home/geonatureadmin/geonature/backend/geonature/core/errors.py", line 99, in handle_exception
raise e
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/geonatureadmin/geonature/backend/geonature/core/gn_permissions/decorators.py", line 62, in decorated_view
return view_func(*args, **kwargs)
File "/home/geonatureadmin/gn_module_ZH/backend/gn_module_zh/blueprint.py", line 822, in write_csv
results = query.return_query().get("items", [])
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/utils_flask_sqla/generic.py", line 284, in return_query
data, nb_result_without_filter, nb_results = self.query()
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/utils_flask_sqla/generic.py", line 273, in query
data = self.set_limit(q).all()
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
ret = self._execute_context(
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
self._handle_dbapi_exception(
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
util.raise_(
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/home/geonatureadmin/geonature/backend/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DataError: (psycopg2.errors.InvalidRowCountInLimitClause) ERREUR: LIMIT ne doit pas être négative
[SQL: SELECT pr_zh.vertebrates.id_zh AS pr_zh_vertebrates_id_zh, pr_zh.vertebrates.cd_nom AS pr_zh_vertebrates_cd_nom, pr_zh.vertebrates.group_class AS pr_zh_vertebrates_group_class, pr_zh.vertebrates.group_order AS pr_zh_vertebrates_group_order, pr_zh.vertebrates.scientific_name AS pr_zh_vertebrates_scientific_name, pr_zh.vertebrates.vernac_name AS pr_zh_vertebrates_vernac_name, pr_zh.vertebrates.statut_type AS pr_zh_vertebrates_statut_type, pr_zh.vertebrates.statut AS pr_zh_vertebrates_statut, pr_zh.vertebrates.article AS pr_zh_vertebrates_article, pr_zh.vertebrates.doc_url AS pr_zh_vertebrates_doc_url, pr_zh.vertebrates.last_date AS pr_zh_vertebrates_last_date, pr_zh.vertebrates.observer AS pr_zh_vertebrates_observer, pr_zh.vertebrates.organisme AS pr_zh_vertebrates_organisme, pr_zh.vertebrates.obs_nb AS pr_zh_vertebrates_obs_nb
FROM pr_zh.vertebrates
WHERE pr_zh.vertebrates.id_zh = %(id_zh_1)s ORDER BY pr_zh.vertebrates.id_zh
LIMIT %(param_1)s OFFSET %(param_2)s]
[parameters: {'id_zh_1': 283, 'param_1': -1, 'param_2': 0}]
(Background on this error at: http://sqlalche.me/e/13/9h9h) Il semble que dans la fonction # gn_module_ZH > backend > gn_module_zh > blueprint.py > write_csv
# l.814
...
for i in ["vertebrates_view_name", "invertebrates_view_name", "flora_view_name"]:
query = GenericQuery(
DB=DB,
tableName=blueprint.config[i]["table_name"],
schemaName=blueprint.config[i]["schema_name"],
filters={"id_zh": id_zh, "orderby": "id_zh"},
limit=-1,
)
results = query.return_query().get("items", [])
.... |
En définissant
|
Oui, c'est peut-être optimisable en l'état ou simplifiable. |
La fonction était un peu longue avant mais elle fonctionnait dans la version 1.0.0 du module. Il est possible que l'évolution de la classe |
Résolue dans la release 1.3.0 |
Bonjour à tous,
GN version : 2.13.3
gn_ZH version : 1.2.0
Description du bug :
En souhaitant générer une liste d'espèce patrimoniale lors d'une démo du module,
Log :
En regardant du côté du
geonature.log
The text was updated successfully, but these errors were encountered: