Symbol not found errors during NetBeans indexing on NAS storage
0 reputation · 27 Aug 2022, 22:09 UTC
0 reputation · 27 Aug 2022, 22:09 UTC
NetBeans utilizes a persistent indexing system to maintain project symbols for code completion and navigation. When project files are hosted on network-attached storage (NAS), the IDE relies on the "Scan for External Changes" mechanism to synchronize the internal index with the disk.
There is an inconsistency in how the IDE detects file system changes on certain network shares, which can result in stale cache entries. This leads to false "symbol not found" errors despite the files being present and updated on the remote server.
While manually deleting the UserDir cache folder forces a full re-index, this is not a viable automated solution for large-scale projects due to the CPU and I/O overhead of the Scan-on-Startup process.
32775 reputation · 28 Aug 2022, 04:42 UTC
NetBeans does not expose a separate setting to increase the scan‑frequency for network‑mounted directories only. The IDE uses a single global interval for "Scan for External Changes" that applies to all watched folders. You can adjust that interval, but it will affect local disks as well.
You can refresh the index for a single project without clearing the global cache by using the project‑level "Scan for External Changes" action or by deleting the project‑specific index folder under the UserDir cache.
java.io.File API to watch for changes. On a case‑insensitive mount, distinct paths that vary only in case resolve to the same file, so the indexer may register a symbol under one name and later fail to find it under the other.FileNotFoundException or IOException, which NetBeans surfaces as a "symbol not found" error in the editor.Tools → Options → Miscellaneous → Files.OK and restart NetBeans for the change to take effect.noserverino or case=yes options (depending on the NAS protocol).Help → Disable Plugins then restart) and let the IDE re‑index.Scan for External Changes. This updates the file watchers and re‑runs the parser for that project only.<UserDir>/var/cache/index/<project‑name> (or the whole index subfolder if you are unsure of the exact name), then restart NetBeans. Only that project’s index is rebuilt; other projects retain their caches.If you can confirm whether the NAS share is mounted with case‑sensitive semantics, we can decide whether to focus on remount options (case‑sensitivity) versus latency/antivirus tuning. Please verify the mount options (e.g., output of mount on Linux/macOS or the share properties on Windows) and let me know if the share is case‑sensitive.
Use comments to ask for clarification. Post a solution as an answer.
32,775 reputation · 28 Aug 2022, 06:57 UTC
One clarification worth adding to the existing answer: a full Clean and Build is not the only targeted option. In recent NetBeans versions (verified on 12.x–19), right-clicking the project and choosing Reload Project re-reads the project metadata and re-scans its sources, which forces the indexer to revisit that project's files while leaving the global cache under userdir/var/cache intact.
For NAS-specific staleness, it's also worth checking the mount options rather than only IDE settings. On Linux SMB mounts, actimeo=0 (disabling attribute caching) makes mtime changes visible to the Java file APIs much sooner, which directly affects how quickly NetBeans notices external edits. On NFS, the equivalent is noac. These are client-side mount flags, so they apply machine-wide rather than per project.
To confirm the refresh actually happened, check the modification timestamps under userdir/var/cache/index before and after triggering Reload Project — the segment folders for that project should update immediately.