sipcapture / homer-api

HOMER 5: Back-End (API) DEPRICATED - use sipcapture/homer-app
http://sipcapture.org
27 stars 67 forks source link

Unable to load Database Layer mysql. #62

Closed 00Asgaroth00 closed 8 years ago

00Asgaroth00 commented 8 years ago

After updating homer-ui and homer-api to yesterday's git revision, I now get a 500 response from /api/v1/search/data with message "Unable to load Database\/Layer\/mysql."

I am able to successfully login and view my db node, users aliases etc, but when I got to search, with no entries in the search fields, and I select any of the signalling types (calls/registrations/other), I get an empty search result, but nginx log shows 500 response, and ngrep shows message return is 500.

Versions

homer-api]# git rev-parse HEAD
aef9ffc8c5e96894cf67fc9ad7417172044f256c
homer-ui]# git rev-parse HEAD
edb54c3a9c488c5a5c379a4dfc1ce14951b24eec

API post request:

POST /api/v1/search/data HTTP/1.1
Host: 1.2.3.4
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Content-Type: application/json;charset=utf-8
Referer: http://1.2.3.4/
Content-Length: 172
Cookie: HOMERSESSID=v1eh7uehciv4jvnikob7tepna6
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

{"param":{"transaction":{"call":true},"limit":200,"search":{},"location":{"node":[{"id":"22","name":"bfievstrace"}]}},"timestamp":{"from":1449729510105,"to":1449751110105}}

The response from this query is:

HTTP/1.1 500 Internal Server Error
Server: nginx/1.8.0
Date: Thu, 10 Dec 2015 12:38:34 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 104
Connection: keep-alive
X-Powered-By: PHP/5.6.16
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

{
    "status": 500,
    "error": "Exception",
    "message": "Unable to load Database\/Layer\/mysql."
}

The mysql modules are installed and appear to be working properly or else I would not be able to login, as my user is defined within the database. The statistics are all displayed as well, so I presume homer is reading that from the database as well.

Any insight would be appreciated.

adubovikov commented 8 years ago

Do you have something in /api/Database/Layer ?

adubovikov commented 8 years ago

oops. I see. moment, fixing...

00Asgaroth00 commented 8 years ago

do you mean the directory itself? If so, then, no, I have not added anything specifically there myself, the contents of that directory are:

-rw-r--r-- 1 nginx nginx 2363 Aug  5 10:09 DefaultConnector.php
-rw-r--r-- 1 nginx nginx    0 Aug  5 10:09 index.html
-rw-r--r-- 1 nginx nginx 7294 Aug  5 10:09 PDOConnector.php
adubovikov commented 8 years ago

sorry, my fault. Was wrong directory. Please pull and recheck https://github.com/sipcapture/homer-api/commit/b8837a997cefc4f9939a697e75e2209a63d9b08b

00Asgaroth00 commented 8 years ago

thanks, that fixed it, all looks okay now. thanks for the quick fix.

adubovikov commented 8 years ago

you are welcome.