Page 1 of 1

ZDevBar query errors in Zend Server 7

Posted: Fri Aug 01, 2014 9:18 pm
by chri5687
I just installed the Zend Server 7 Developer edition (the PHP 5.4 compatible version). During installation I received an error related to database configuration. This has not seemed to adversely affect the operation of Zend Server in any way. However, I do receive query-related errors that relate to Z-Ray when running PHP from the command line (even though they do not interfere with successful execution):

[01.08.2014 14:34:16 p16422/t140735298396944 ERROR] ZDevBar::refreshUrlsCache: QSafeSqlQuery::exec -> error in query: SELECT id, url from devbar_requests_urls. [No query Unable to fetch row]
[01.08.2014 14:34:16 p16422/t140735298396944 ERROR] ZDevBar::refreshStatementsCache: QSafeSqlQuery::exec -> error in query: SELECT id, statement_hash, prepared_statement from devbar_sql_statements. [No query Unable to fetch row]
[01.08.2014 14:34:16 p16422/t140735298396944 ERROR] ZDevBar::loadUserAgentTable: QSafeSqlQuery::exec -> error in query: select * from devbar_user_agent. [No query Unable to fetch row]

If I open the Zend Server GUI and navigate to the Z-Ray configuration section, I get similar errors:
db SELECT query 'SELECT "devbar_tokens".* FROM "devbar_tokens" ORDER BY "id" DESC LIMIT '300' OFFSET '0'' failed with the following error: SQLSTATE[HY000]: General error: 1 no such table: devbar_tokens

Judging from the configuration files I've looked at, it seems clear that the GUI uses SQLITE, but I haven't yet been able to determine where the data files actually live, much less what should be in them. (We have other developers in our organization with the same install, so if I can find the SQLITE files on their machines, it's very possible I could just copy them over.)

Can anyone tell me where the SQLITE file(s) live, or do you have any other insight on fixing this issue?

Re: ZDevBar query errors in Zend Server 7

Posted: Fri Aug 01, 2014 9:48 pm
by yonman
Hey Chri,

The file you're looking for is devbar.db in var/db (or in windows data/db)
You can just copy it over from any existing machine and it should work.

Re: ZDevBar query errors in Zend Server 7

Posted: Wed Aug 06, 2014 1:33 am
by robe5323
I'm having the same problem with ZS Dev 7/5.5 on a Mac. However, the devbar.db file exists. Other ideas?

Re: ZDevBar query errors in Zend Server 7

Posted: Wed Aug 06, 2014 1:50 am
by robe5323
I checked the Z-Ray tab in the ZS UI, and saw this error:
db SELECT query 'SELECT "devbar_tokens".* FROM "devbar_tokens" ORDER BY "id" DESC LIMIT '300' OFFSET '0'' failed with the following error: SQLSTATE[HY000]: General error: 11 database disk image is malformed
Okay, so the file seemed to be corrupted. I deleted it and restarted ZS, and the file was recreated as expected. But now I'm getting a new error in the UI:
db SELECT query 'SELECT "devbar_tokens".* FROM "devbar_tokens" ORDER BY "id" DESC LIMIT '300' OFFSET '0'' failed with the following error: SQLSTATE[HY000]: General error: 1 no such table: devbar_tokens
Note that Z-Ray is set to Enabled, not Secured (and the UI won't let me access the latter mode, as it's unavailable in the dev edition).

BTW, though the error in the UI changed, I'm still getting the same errors on the command line:
[05.08.2014 17:41:24 p99525/t140735204152080 ERROR] ZDevBar::refreshUrlsCache: QSafeSqlQuery::exec -> error in query: SELECT id, url from devbar_requests_urls. [No query Unable to fetch row]
[05.08.2014 17:41:24 p99525/t140735204152080 ERROR] ZDevBar::refreshStatementsCache: QSafeSqlQuery::exec -> error in query: SELECT id, statement_hash, prepared_statement from devbar_sql_statements. [No query Unable to fetch row]
[05.08.2014 17:41:24 p99525/t140735204152080 ERROR] ZDevBar::loadUserAgentTable: QSafeSqlQuery::exec -> error in query: select * from devbar_user_agent. [No query Unable to fetch row]

Re: ZDevBar query errors in Zend Server 7

Posted: Thu Aug 07, 2014 7:58 am
by yonman
Hey Robe

At a guess, I'd say your devbar.db file is completely empty and has no tables.
You can find its original sql script file in your share directory (devbar_sqlite_create_database.sql and devbar_fixtures.sql). Run these two files into your sqlite devbar.db file and things should start kicking over nicely.

Re: ZDevBar query errors in Zend Server 7

Posted: Thu Aug 07, 2014 9:49 pm
by robe5323
That did the trick, thanks!

Now, if I could just get Z-Ray to fire up with a token on our production server, rather than segfaulting, things would be good. But that's for another thread - or probably better, a support ticket.

Anyway, thanks again.

Re: ZDevBar query errors in Zend Server 7

Posted: Fri Aug 08, 2014 5:44 pm
by chri5687
Grabbing the devbar.db file from one of our other developer's machines did work for my issue. Thanks!

Re: ZDevBar query errors in Zend Server 7

Posted: Mon Aug 18, 2014 3:41 pm
by jean3568
Same problem here. It already happen twice for me - i use vagrant and probably the server is not shut down correctly. There is no restore configuration script to use in this case? The solution of repairing sqlite3 did not work as expected for me.

Re: ZDevBar query errors in Zend Server 7

Posted: Fri Feb 20, 2015 9:58 pm
by stevegroom
Re:
At a guess, I'd say your devbar.db file is completely empty and has no tables.
You can find its original sql script file in your share directory (devbar_sqlite_create_database.sql and devbar_fixtures.sql). Run these two files into your sqlite devbar.db file and things should start kicking over nicely.

Sounds like my problem -
What are the commands needed to run these two sql statements on ZS 8 Mac Development edition ?

regards
Steve