{"record":{"id":"78ad73c703fd68e6","repo":"oraios/serena","slug":"findsymboltool-returned-no-results","errorCode":null,"errorMessage":"FindSymbolTool returned no results","messagePattern":"FindSymbolTool returned no results","errorType":"exception","errorClass":"_HealthCheckFailure","httpStatus":null,"severity":"error","filePath":"src/serena/cli.py","lineNumber":1027,"sourceCode":"                    find_symbol_result = agent.execute_task(\n                        lambda: find_symbol_tool.apply(symbol_name, relative_path=target_file, include_body=True)\n                    )\n                find_symbol_data = json.loads(find_symbol_result)\n                log.info(\"FindSymbolTool found %d matches for symbol %s\", len(find_symbol_data), symbol_name)\n\n                # Test 3: FindReferencingSymbolsTool\n                log.info(\"Testing FindReferencingSymbolsTool for symbol: %s\", symbol_name)\n                try:\n                    with find_refs_tool.symbol_dict_grouper.disabled_context():\n                        find_refs_result = agent.execute_task(lambda: find_refs_tool.apply(symbol_name, relative_path=target_file))\n                        find_refs_data = json.loads(find_refs_result)\n                        log.info(\"FindReferencingSymbolsTool found %d references for symbol %s\", len(find_refs_data), symbol_name)\n                except Exception as e:\n                    log.warning(\"FindReferencingSymbolsTool failed for symbol %s: %s\", symbol_name, str(e))\n\n                # Verify tools worked as expected\n                if not find_symbol_data:\n                    raise ProjectCommands._HealthCheckFailure(\"FindSymbolTool returned no results\")\n\n                log.info(\"Health check completed successfully\")\n\n            # expected failures and unexpected exceptions are reported alike: both mean the project's\n            # tooling is not functional, which is the single thing this command is asked to determine\n            except Exception as e:\n                log.exception(\"Health check failed with exception: %s\", str(e))\n                failure_reason = str(e)\n\n            finally:\n                click.echo(f\"Log saved to: {log_file}\")\n\n        # the verdict is reported outside the checked region, so that a failure to write the report\n        # cannot be mistaken for a failure of the check itself; the exit code lets callers\n        # (CI, scripts) act on the verdict\n        if failure_reason is None:\n            click.echo(\"✅ Health check passed - All tools working correctly\")\n        else:","sourceCodeStart":1009,"sourceCodeEnd":1045,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/cli.py#L1009-L1045","documentation":"Health check step 2 runs FindSymbolTool to locate a symbol by name. If find_symbol returns no results, serena raises `_HealthCheckFailure`, concluding the tooling is not functional even though the LS may be running. Note FindReferencingSymbols failures are only warned, but FindSymbol failure is fatal to the check.","triggerScenarios":"`serena project health-check` selected a symbol from the overview but FindSymbolTool.query returned empty — e.g. the name_path resolution fails for that symbol kind, symbol was a variable/constructor without matches, or the LS index is stale.","commonSituations":"Stale or missing symbol index after files changed; LS partially functional (overview works, lookup doesn't); symbols nested so the default name_path doesn't resolve; transient LS errors swallowed upstream.","solutions":["Re-run `serena project index` to rebuild the symbol index, then re-run the health check.","Check serena logs for the underlying FindSymbolTool error/output.","Confirm the language server version is supported and fully operational (try find_symbol manually via `serena tools`).","Restart the health check / LS process to rule out a transient LS failure."],"exampleFix":"// before\nserena project health-check  # fails: stale index\n// after\nserena project index\nserena project health-check","handlingStrategy":"retry","validationCode":"# ensure the index is fresh before health-checking\nrun(['serena', 'project', 'index'], check=True)","typeGuard":null,"tryCatchPattern":"for attempt in range(2):\n    try:\n        run(['serena', 'project', 'health-check'], check=True)\n        break\n    except subprocess.CalledProcessError as e:\n        if 'FindSymbolTool returned no results' in (e.stderr or '') and attempt == 0:\n            run(['serena', 'project', 'index'], check=True)\n            continue\n        raise","preventionTips":["Re-index after file changes so symbol lookups don't hit stale data.","Keep the language server up to date; partial LS functionality causes empty lookups.","Investigate logs — FindReferencingSymbols warnings in the same run often share the root cause."],"tags":["cli","health-check","language-server","symbols"],"backgroundTag":"symbol-lookup-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}