# 500 error due to foreign key issues

**URL:** <https://community.dreamfactory.com/t/500-error-due-to-foreign-key-issues/1753>\
**Category:** GitHub Installers\
**Created:** [November 11, 2015, 1:27am UTC](https://community.dreamfactory.com/t/500-error-due-to-foreign-key-issues/1753 "2015-11-11T01:27:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![garreeoke](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@garreeoke](https://community.dreamfactory.com/u/garreeoke)\
**Post date:** [November 11, 2015, 1:27am UTC](https://community.dreamfactory.com/t/500-error-due-to-foreign-key-issues/1753/1 "2015-11-11T01:27:43Z")

</div>

Went through the install, went to the ip address and get a foreign key error:

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint

I looked in the database and there were a few tables created.

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [November 11, 2015, 8:09pm UTC](https://community.dreamfactory.com/t/500-error-due-to-foreign-key-issues/1753/2 "2015-11-11T20:09:33Z")

</div>

Did you get any errors when you ran `php artisan dreamfactory:setup` twice? You may also need to ensure your web server can read/write from/to `storage/*` and `bootstrap/cache/`.
