# \[Solved\] While executing: attempt to write a readonly database error

**URL:** <https://discourse.pi-hole.net/t/solved-while-executing-attempt-to-write-a-readonly-database-error/33003>\
**Category:** Community Help\
**Tags:** v5-0\
**Created:** [May 20, 2020, 10:48pm UTC](https://discourse.pi-hole.net/t/solved-while-executing-attempt-to-write-a-readonly-database-error/33003 "2020-05-20T22:48:20Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![murdocklawlesss](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/murdocklawlesss/32/13720_2.png) [@murdocklawlesss](https://discourse.pi-hole.net/u/murdocklawlesss)\
**Post date:** [May 21, 2020, 10:47am UTC](https://discourse.pi-hole.net/t/solved-while-executing-attempt-to-write-a-readonly-database-error/33003/3 "2020-05-21T10:47:32Z")

</div>

make sure the ownerhips are correct in directory /etc/pihole. (you can find right ownership list @deHakkelaar post below.)

usermod -aG pihole www-data

reboot

this solved my problem. some of the files owned by root and that's why readonly error occured.

---

_[View the full topic](https://discourse.pi-hole.net/t/solved-while-executing-attempt-to-write-a-readonly-database-error/33003)._
