SQL database connection error

I was using DF service for a while and everything was great! But now I can’t connect to my database. Here is my error message:

"message": "Failed to retrieve records from 'easyii_news'.\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'ref_service_id' in 'where clause' (SQL: select * fromdb_field_extraswhereref_service_id= 11 andref_table= easyii_news)"

I didn’t change anything on my server. Also a can’t connect to any table, not only that table, but I can get table list with getTables().

Can anyone please assist me?
Thanks!

Are you running this db local or remote? Did you made any changes in your db structure without using DF? What db are you using (sqlite, mysql)? Maybe you just need to go to Schema, select you service db and refresh it.

It’s remote mysql DB and no changes was made.
I’ve made a refresh but it didn’t worked. Also I’ve created new service in services with the same DB and it have the same error.

Hello, What version of the DF you are using, and how you installed it?

If you’re using the free-hosted system there is a known issue with SQL connections. We’re working on it. Sorry for the inconvenience.

Hello! I’m using free-hosted version here on enterprise.dreamfactory.com

Hello! Thank you for your response. Is there anything I can do right now to make it working once again?

Any updates on this?

The free hosted system was updated last month to resolve this issue. If you are on the latest code update you should not be experiencing this issue.

Just upgraded to

Admin Application Version: 2.0.6
DreamFactory Version: 2.0.4

Getting almost the same error:

Failed to query database schema.
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘ref_service_id’ in ‘where clause’ (SQL: select * from db_field_extras where ref_service_id = 7 and ref_table = userdetail)

When you upgraded did you run php artisan migrate --seed
and did it complete successfully?

I followed this guide: https://wiki.dreamfactory.com/DreamFactory/Installation :

git stash git checkout master
git pull origin master //self-update is optional, try it if you get an error without it …/…/…/php/bin/php composer.phar self-update
../../../php/bin/php composer.phar install --no-dev …/…/…/php/bin/php artisan migrate --seed
../../../php/bin/php artisan cache:clear …/…/…/ctlscript.sh restart

Didn’t see any errors, believe it was succesfull. Would you recommend to run these lines again?

Yes. The error indicates that your system db migrations did not complete successfully.

You can start at the the line $ ../../../php/bin/php artisan migrate --seed and continue to the end

If everything was that easy :slightly_smiling:

I did the steps and it’s working now. Not sure what I did wrong last time.

1 Like