rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

"Failed to save cached analysis" error

Open joprice opened this issue 6 years ago • 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.

joprice avatar Dec 10 '19 02:12 joprice

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?)

SrodriguezO avatar Dec 10 '19 16:12 SrodriguezO

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

joprice avatar Dec 12 '19 03:12 joprice

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

joprice avatar Dec 12 '19 03:12 joprice

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.

pauldraper avatar Jan 20 '20 22:01 pauldraper

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

joprice avatar Jan 21 '20 15:01 joprice