nextcloud / nextcloud/context_chat_backend
debug: true does not make the indexing logs visible in docker logs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 27
- Forks
- 24
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 6
Description
Describe the Bug
With debug: true set in the config, docker logs still shows almost nothing about indexing. The detail is produced — it goes to persistent_storage/logs/ccb.log — but the stream a container deployment is actually read from stays nearly silent, because the stderr handler is pinned at WARNING:
# logger_config.yaml
handlers:
stderr:
class: logging.StreamHandler
level: WARNING
...
file_json:
class: logging.handlers.RotatingFileHandler
level: DEBUG
filename: logs/ccb.log
logger_config.k8s.yaml has the stderr handler at DEBUG, so the k8s deployment does not have this problem — only the manual-install and Docker paths do.
Why it matters
Everything that describes what indexing is doing is at INFO or DEBUG:
Using N parallel file parsing workersDispatching N file chunk(s)Waiting for file chunk 1/8 future to completeembed_sources finished for 4 source(s): 3 succeeded, 1 erroredand the per-source error dictNo documents to index
None of it reaches docker logs. What does reach it is the ERROR from a failed queue fetch, so the visible log is a stream of tracebacks with no surrounding context.
The practical consequence is that a healthy-but-slow run and a genuinely stuck one look identical from outside the container. We spent a long time treating the silence as evidence that the indexing thread had died — it had not; it was working and simply not saying so where we were looking. The information that eventually resolved it was in ccb.log the whole time.
Suggested fix
Have debug: true also lower the stderr handler, so turning debug on makes the logs visible where they are read. PR follows.
Two smaller things noticed nearby
context_chat_backend/network_em.py:24useslogging.getLogger('ccb.nextwork_em')— looks like a typo fornetwork_em._setup_log_levels()inmain.pylists theccb.*loggers explicitly but omitsccb.task_fetcherandccb.nextwork_em. It is harmless today, since they inheritDEBUGfrom theccbparent configured in the YAML, but the list reads as if it were exhaustive.
Setup Details
Nextcloud version: 34.0.3
context_chat / context_chat_backend: 5.4.0 / 5.4.1
Deployment: manual-install deploy daemon, Docker, four backend instances
Contributor 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.
Research direction
Start with logger_config.yaml and the debug handling in main.py, then compare logger_config.k8s.yaml to see how the stderr handler is configured. Verify that enabling debug makes indexing messages visible through docker logs while preserving the existing file logging, and run the relevant project tests or a Docker indexing run to confirm the output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python, yaml
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100