SQL database connection error


#1

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!


#2

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.


#3

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.


#4

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


#5

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.


#6

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


#7

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


#8

Any updates on this?


#9

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.


#10

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)


#11

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


#12

I followed this guide: http://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?


Unknown column 'username' in 'where clause'
#13

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


#14

If everything was that easy :slightly_smiling:

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