When we run our behat tests suite we run into a notice being shown on test pages from time to time:
User Notice: <em class="placeholder">Warning</em>: file_get_contents(public://languages/de_k6dYjbIG0GfEJl3YPQE4ZRnL5Rg9BPdBO3slQkKDHL0.js): failed to open stream: "Drupal\Core\StreamWrapper\PublicStream::stream_open" call failed in <em class="placeholder">Drupal\Core\Asset\JsOptimizer->optimize()</em> (line <em class="placeholder">25</em> of <em class="placeholder">/srv/default/vcs/web/core/lib/Drupal/Core/Asset/JsOptimizer.php</em>) #0 /srv/default/vcs/web/core/includes/bootstrap.inc(582): _drupal_error_handler_real(2, 'file_get_conten...', '/srv/default/vc...', 25,
However, with further debugging the error is not reproducible in any way during regular site operation (with any kind of state of caches and state). I think it's caused by a race condition when the behat + drupal driver process and a request trigger both the generation of the same file, as in watchdog the notice of locale translation being triggered can be found twice in the "error" case.