ZDevBar query errors in Zend Server 7

General discussion forum for the Zend Server
Post Reply
chri5687
Posts: 2
Joined: Fri Aug 01, 2014 8:50 pm

ZDevBar query errors in Zend Server 7

Post by chri5687 » Fri Aug 01, 2014 9:18 pm

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?

yonman
Posts: 486
Joined: Thu Dec 10, 2009 4:50 pm
Location: Here, There, Everywhere!
Contact:

Re: ZDevBar query errors in Zend Server 7

Post by yonman » Fri Aug 01, 2014 9:48 pm

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.
"It's only hubris if I fail" - Gaius Julius Caesar

robe5323
Posts: 7
Joined: Wed Aug 06, 2014 1:31 am

Re: ZDevBar query errors in Zend Server 7

Post by robe5323 » Wed Aug 06, 2014 1:33 am

I'm having the same problem with ZS Dev 7/5.5 on a Mac. However, the devbar.db file exists. Other ideas?

robe5323
Posts: 7
Joined: Wed Aug 06, 2014 1:31 am

Re: ZDevBar query errors in Zend Server 7

Post by robe5323 » Wed Aug 06, 2014 1:50 am

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]

yonman
Posts: 486
Joined: Thu Dec 10, 2009 4:50 pm
Location: Here, There, Everywhere!
Contact:

Re: ZDevBar query errors in Zend Server 7

Post by yonman » Thu Aug 07, 2014 7:58 am

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.
"It's only hubris if I fail" - Gaius Julius Caesar

robe5323
Posts: 7
Joined: Wed Aug 06, 2014 1:31 am

Re: ZDevBar query errors in Zend Server 7

Post by robe5323 » Thu Aug 07, 2014 9:49 pm

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.

chri5687
Posts: 2
Joined: Fri Aug 01, 2014 8:50 pm

Re: ZDevBar query errors in Zend Server 7

Post by chri5687 » Fri Aug 08, 2014 5:44 pm

Grabbing the devbar.db file from one of our other developer's machines did work for my issue. Thanks!

jean3568
Posts: 4
Joined: Sun Mar 23, 2014 6:09 pm

Re: ZDevBar query errors in Zend Server 7

Post by jean3568 » Mon Aug 18, 2014 3:41 pm

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.

stevegroom
Posts: 7
Joined: Sun Dec 06, 2009 10:44 pm

Re: ZDevBar query errors in Zend Server 7

Post by stevegroom » Fri Feb 20, 2015 9:58 pm

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

Post Reply