When I run php maintenance/rebuildFileCache.php, I'm getting Database is read-only: Building cache error even though I haven't put the database to read only with $wgReadOnly and editing is working without any issue. But I'm not able to rebuild file cache with this script.
What would be the cause to get Database is read-only: Building cache error?