# Asterisk WARNING

**URL:** <https://community.asterisk.org/t/asterisk-warning/78443>\
**Category:** Asterisk Support\
**Created:** [February 7, 2019, 5:03am UTC](https://community.asterisk.org/t/asterisk-warning/78443 "2019-02-07T05:03:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![victorshoaga](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/victorshoaga/32/3554_2.png) [@victorshoaga](https://community.asterisk.org/u/victorshoaga)\
**Post date:** [February 7, 2019, 5:03am UTC](https://community.asterisk.org/t/asterisk-warning/78443/1 "2019-02-07T05:03:32Z")

</div>

Everything works fine (atleast for now) but then I keep getting the following in my console logs. Is this an issue waiting to happen?

How do I get rid of this?

WARNING[1413]: db.c:348 ast\_db\_put: Couldn’t execute statement: SQL logic error`

Thank you in advance

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [February 7, 2019, 5:14am UTC](https://community.asterisk.org/t/asterisk-warning/78443/2 "2019-02-07T05:14:59Z")

</div>

What it is your Asterisk version ?

---

<div class="post-metadata">

**Author:** ![victorshoaga](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/victorshoaga/32/3554_2.png) [@victorshoaga](https://community.asterisk.org/u/victorshoaga)\
**Post date:** [February 7, 2019, 5:16am UTC](https://community.asterisk.org/t/asterisk-warning/78443/3 "2019-02-07T05:16:08Z")

</div>

asterisk 16.1.1

Thanks

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [February 7, 2019, 5:16am UTC](https://community.asterisk.org/t/asterisk-warning/78443/4 "2019-02-07T05:16:27Z")

</div>

Are you running Asterisk as root user ?

---

<div class="post-metadata">

**Author:** ![victorshoaga](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/victorshoaga/32/3554_2.png) [@victorshoaga](https://community.asterisk.org/u/victorshoaga)\
**Post date:** [February 7, 2019, 5:17am UTC](https://community.asterisk.org/t/asterisk-warning/78443/5 "2019-02-07T05:17:07Z")

</div>

Yes I am running Asterisk as root

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [February 7, 2019, 5:22am UTC](https://community.asterisk.org/t/asterisk-warning/78443/6 "2019-02-07T05:22:15Z")

</div>

This problem could be caused by permission issues, but if you re running Asterisk as root and astdb.sqlite running fine, will be needed to collect more information to debug the problem

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [February 7, 2019, 11:02am UTC](https://community.asterisk.org/t/asterisk-warning/78443/7 "2019-02-07T11:02:50Z")

</div>

It can also be caused by a corrupted sqlite3 database on disk, or hardware problems. Does it occur at startup?

---

<div class="post-metadata">

**Author:** ![victorshoaga](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/victorshoaga/32/3554_2.png) [@victorshoaga](https://community.asterisk.org/u/victorshoaga)\
**Post date:** [February 9, 2019, 1:39am UTC](https://community.asterisk.org/t/asterisk-warning/78443/8 "2019-02-09T01:39:09Z")

</div>

![asterisk_comm_show](https://global.discourse-cdn.com/asterisk/original/2X/7/7143518b350bf7d170edf94f7e720391c1484ec5.png)

I keep getting this error. It does not occur at startup.

Please any ideas on how to fix this please?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![victorshoaga](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/victorshoaga/32/3554_2.png) [@victorshoaga](https://community.asterisk.org/u/victorshoaga)\
**Post date:** [February 9, 2019, 2:15am UTC](https://community.asterisk.org/t/asterisk-warning/78443/9 "2019-02-09T02:15:46Z")

</div>

GOOD NEWS 😁😁

FIXED IT!!

STEPS

1. `sqlite3 /var/lib/asterisk/astdb.sqlite3`
2. (_Check for integrity using_ )----\> `pragma integrity_check;`
3. (_Help can be of help too_) ----\> `.help`
4. (_You can check tables to see what is inside_) ----\> `.tables`
5. `.mode insert`
6. `.output mydb_export.sql`
7. `.dump`
8. `.exit`
9. `mv /var/lib/asterisk/astdb.sqlite3 /var/lib/asterisk/astdb.sqlite3.orig`
10. `sqlite3 /var/lib/asterisk/mydb.db < mydb_export.sql` (_mydb\_export.sql will most likely be in your pwd_)
11. `sqlite3 /var/lib/asterisk/astdb.sqlite3`
12. `analyze;`
13. `.exit`

This solved the problem.  
No more WARNING signs.

Thank you guys.  
Also, thanks to this [[https://totoshko88.wordpress.com/2016/09/21/elastix-warning2390-db-c332-ast\_db\_put-couldnt-execute-statment-sql-logic-error-or-missing-databas](https://totoshko88.wordpress.com/2016/09/21/elastix-warning2390-db-c332-ast_db_put-couldnt-execute-statment-sql-logic-error-or-missing-databas)]([http://Totoshko88](http://Totoshko88) Site)e/
