# Error Attempt to write a readonly database

**URL:** <http://discussions.gridprotectionalliance.org/t/error-attempt-to-write-a-readonly-database/112>\
**Category:** openECA\
**Created:** [January 10, 2017, 7:21pm UTC](http://discussions.gridprotectionalliance.org/t/error-attempt-to-write-a-readonly-database/112 "2017-01-10T19:21:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tong](http://discussions.gridprotectionalliance.org/letter_avatar_proxy/v4/letter/t/838e76/32.png) [@Tong](http://discussions.gridprotectionalliance.org/u/Tong)\
**Post date:** [January 10, 2017, 7:21pm UTC](http://discussions.gridprotectionalliance.org/t/error-attempt-to-write-a-readonly-database/112/1 "2017-01-10T19:21:05Z")

</div>

Hi,

I got this error when I try to create a new measurement in openECA:  
“Exception has been thrown by the target of an invocation. Inner Exception: attempt to write a readonly database”

This error occurs after I restart my openECA. This problem can be solved by re-running “Configuration Setup Utility” to reconfigure my database. However, it will loose all the saved measurement information. Is there any other ways that I can solve this problem without re-running the configuration?

Thank you so much!  
Tong

---

<div class="post-metadata">

**Author:** ![StephenCWills](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/stephencwills/32/20_2.png) [@StephenCWills](http://discussions.gridprotectionalliance.org/u/StephenCWills)\
**Post date:** [January 10, 2017, 9:27pm UTC](http://discussions.gridprotectionalliance.org/t/error-attempt-to-write-a-readonly-database/112/2 "2017-01-10T21:27:44Z")

</div>

Hi Tong,

Can you be a little more specific? Are you using the openECA Manager to create a new measurement on the openECA server through the `Metadata > Measurements` screen? Depending on where you placed the SQLite database on your filesystem, you may need to change permissions on the folder that contains the database file or run the openECA Manager as administrator in order to write to the database.

Thanks,  
Stephen

---

<div class="post-metadata">

**Author:** ![Tong](http://discussions.gridprotectionalliance.org/letter_avatar_proxy/v4/letter/t/838e76/32.png) [@Tong](http://discussions.gridprotectionalliance.org/u/Tong)\
**Post date:** [January 19, 2017, 8:23pm UTC](http://discussions.gridprotectionalliance.org/t/error-attempt-to-write-a-readonly-database/112/3 "2017-01-19T20:23:40Z")

</div>

Hi Stephen,

Thanks for your reply. It works when I run it as administrator.

Regards,  
Tong
