higherkindness/rules_scala

"Failed to save cached analysis" error

joprice opened this issue · 5 comments

On some builds, I get a an error like Failed to save cached analysis: java.nio.file.NoSuchFileException: service/.tmp. The error does not give any specific reason for the failure, so I'm not sure where to begin debugging.

Hey @joprice, the error's happening when the Zinc runner tries to save the Zinc state files when persistent builds are enabled. Is there a stack trace in the output you're seeing? Also, are you seeing this error consistently? (i.e. if you build and get the error, clean, and then build again, do you still get the error?)

There was no stacktrace, and it only happens intermittently and doesn't seem to affect the build.

I'll try to capture more info if it pops up again.

The error comes from here.

It most likely originates here.

Immediately before it, we create the service directory (or whatever the target's name is).

So either the file system is behaving inconsistently, or there are multiple instances running in that directory. Since Bazel runs only one build at a time, there should not be multiple instances. Unless if after sanitation there is a collision.

I haven't seen this since, so feel free to close if it's not helpful to track it down.