Backend bails out when submitting query without data source: `KeyError: 'datasource'`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
Start in patzilla/navigator/services/util.py, at query_expression_util_handler and make_expression_filter, where the traceback shows the missing 'datasource' key is accessed. Trace how the query request is validated and handled when no data source is selected, then add or update a focused test for that request. Done when submitting such a query no longer causes a backend KeyError.
Written by the indexing model from the issue text.
Description
Problem
Navigating around wildly, I have been able to submit a query without selecting a data source, which currently makes the backend bail out.
Details
2026-10-27 13:49:04,182 ERROR [waitress ][waitress-2] Exception while serving /api/util/query-expression
Traceback (most recent call last):
File "/path/to/site-packages/waitress/channel.py", line 430, in service
task.service()
~~~~~~~~~~~~^^
File "/path/to/site-packages/waitress/task.py", line 167, in service
self.execute()
~~~~~~~~~~~~^^
File "/path/to/site-packages/waitress/task.py", line 435, in execute
app_iter = self.channel.server.application(environ, start_response)
File "/path/to/site-packages/waitress/proxy_headers.py", line 64, in translate_proxy_headers
return app(environ, start_response)
File "/path/to/site-packages/paste/deploy/config.py", line 306, in __call__
return self.app(environ, start_response)
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/site-packages/pyramid/router.py", line 274, in __call__
response = self.execution_policy(environ, self)
File "/path/to/site-packages/pyramid/router.py", line 283, in default_execution_policy
return request.invoke_exception_view(reraise=True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/path/to/site-packages/pyramid/view.py", line 787, in invoke_exception_view
reraise_(*exc_info)
~~~~~~~~^^^^^^^^^^^
File "/path/to/site-packages/pyramid/_compat.py", line 178, in reraise
raise value.with_traceback(tb)
File "/path/to/site-packages/pyramid/router.py", line 281, in default_execution_policy
return router.invoke_request(request)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/path/to/site-packages/pyramid/router.py", line 249, in invoke_request
response = handle_request(request)
File "/path/to/site-packages/pyramid/tweens.py", line 43, in excview_tween
response = _error_handler(request, exc)
File "/path/to/site-packages/pyramid/tweens.py", line 13, in _error_handler
response = request.invoke_exception_view(exc_info)
File "/path/to/site-packages/pyramid/view.py", line 774, in invoke_exception_view
response = _call_view(
registry,
...<7 lines>...
request_iface=request_iface.combined,
)
File "/path/to/site-packages/pyramid/view.py", line 683, in _call_view
response = view_callable(context, request)
File "/path/to/site-packages/pyramid/viewderivers.py", line 401, in viewresult_to_response
result = view(context, request)
File "/path/to/site-packages/pyramid/tweens.py", line 41, in excview_tween
response = handler(request)
File "/path/to/site-packages/pyramid/router.py", line 147, in handle_request
response = _call_view(
registry, request, context, context_iface, view_name
)
File "/path/to/site-packages/pyramid/view.py", line 683, in _call_view
response = view_callable(context, request)
File "/path/to/site-packages/pyramid/config/views.py", line 169, in __call__
return view(context, request)
File "/path/to/site-packages/pyramid/config/views.py", line 188, in attr_view
return view(context, request)
File "/path/to/site-packages/pyramid/config/views.py", line 214, in predicate_wrapper
return view(context, request)
File "/path/to/site-packages/pyramid/viewderivers.py", line 436, in rendered_view
result = view(context, request)
File "/path/to/site-packages/pyramid/viewderivers.py", line 144, in _requestonly_view
response = view(request)
File "/path/to/site-packages/cornice/service.py", line 493, in wrapper
response = view_(request)
File "/path/to/patzilla/patzilla/navigator/services/util.py", line 60, in query_expression_util_handler
expression_data = make_expression_filter(data)
File "/path/to/patzilla/patzilla/navigator/services/util.py", line 69, in make_expression_filter
datasource = data['datasource']
~~~~^^^^^^^^^^^^^^
KeyError: 'datasource'
- Dominant language
- Python
- Stars
- 123
- Forks
- 31
- Avg merge
- 1h 6m
- Merged PRs (30d)
- 50
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ip-tools/patzilla
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ip-tools/patzilla#139 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
UI: Update BabelOpendependencies help wanted javascript
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
dependencies python
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
All issues in ip-tools/patzilla
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
btclib-org/btclib-node#2132 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
freelawproject/juriscraper#2367 · 2 comments ·
Maintainers usually reply within 1 day
-
infra tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 78/100
gke-labs/kube-agents#4190 ·
Maintainers usually reply within 1 day