bug: api backend is not resilient to ES errors
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- elasticsearch, python
- Domain
- backend, observability
Research direction
Start by reading web/health.py, especially _add_es_status around the reported line 79, and trace how health status is checked while serving an outing URL. Check the existing tests for health checks and Elasticsearch errors. Done means an Elasticsearch error such as a missing index is handled without preventing the API from answering the outing request.
Written by the indexing model from the issue text.
Description
follow-up to #2666 issue
An URL like https://www.camptocamp.org/outings/1964309/ should work (in degraded mode if necessary?) without ES.
instead we get
Error from ES like this one
api_1 | {"message": "Getting indexed docs count failed", "levelname": "ERROR", "name": "c2corg_api.web.health", "asctime": "2026-11-18 22:28:54,503", "funcName": "_add_es_status", "lineno": 82, "pathname": "/var/www/c2corg_api/web/health.py", "stack_info": null, "module": "health", "created": 1795040934.5038984, "threadName": "AnyIO worker thread", "processName": "MainProcess", "getMessage": null, "exc_info": "Traceback (most recent call last):\n File \"/var/www/c2corg_api/web/health.py\", line 79, in _add_es_status\n es_docs = stats['indices'][index]['total']['docs']['count']\n ~~~~~~~~~~~~~~~~^^^^^^^\nKeyError: 'c2corg'"}
should be caught and not prevent the service from answering
- Dominant language
- Python
- Stars
- 25
- Forks
- 30
- Avg merge
- 8h 3m
- Merged PRs (30d)
- 255
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
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 c2corg/v6_api
-
metaskirando
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
metaskirando
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
metaskirando
Difficulty 3/5 Half a day Newbie friendliness 58/100
Maintainers usually reply within 1 day
-
metaskirando
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
metaskirando
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
Similar issues
-
`gitlab_importer_v2` pipeline failing due to malformed YAML filePossibly taken @Gowri213 claimed this today. Openbug Pipeline: Failure Priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aboutcode-org/vulnerablecode#2523 · 1 comment ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
intuitem/ciso-assistant-community#5380 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
confluentinc/cp-ansible#2767 ·
Maintainers usually reply within 3 days
-
bug docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 2 days