Deno : error: Uncaught (in promise) Error: attempt to write a readonly database: Error code 8: Attempt to write a readonly database

2 min

language: ja bn en es hi pt ru zh-cn zh-tw

Image
Hello, it's Muno.
An error has appeared.

Background

This occurred after changing the ownership of the directory where deno task * was being executed using chown.
error

error: Uncaught (in promise) Error: attempt to write a readonly database: Error code 8: Attempt to write a readonly database
  const cache = await caches.open("lume_remote_files");
                             ^
    at CacheStorage.open (ext:deno_cache/01_cache.js:46:27)
    at read (https://deno.land/x/lume@v2.3.3/core/utils/read.ts:59:30)
    at https://deno.land/x/lume@v2.3.3/deps/svg2png.ts:7:20

However, even after running ls -la and looking for .cache, it wasn't found, and even after deleting ls -la ~/.cache/deno/ , this error still appeared...

Solution

Apparently, after some investigation, Deno also creates a cache in /tmp/deno_cache/. This is a RAM memory cache.
This cache was causing an ownership conflict, essentially rejecting access.
So, delete it.

rm -rf /tmp/deno_cache

This solved it!

Related Posts