omnight / phonehook

12 stars 8 forks source link

Caller lookup not working after phone reboot #4

Closed ketkupolkka closed 9 years ago

ketkupolkka commented 9 years ago

After rebooting my phone, the caller lookup stops working (returns "no results", when testing). The search function works fine with same mumber. Re-installing fixes the problem, but has to be done every time after reboot. Tested on Fonecta.fi. Someone allready reported this at openrepos, but for me solutions provided there don't work.

Problem first appeared after resetting the phone to factory settings before the last fw update.

omnight commented 9 years ago

Hi! Did you mean this issue? https://openrepos.net/comment/7080#comment-7080 I figured that the problem there was that the phone was not on the home network (roaming) for some reason, and by default lookups are disabled when roaming due to possible high data costs.

When you search for a number, do you use the "Test Number" functionality on the scraper detail page? This bypasses the roaming check and should work regardless.

If you can provide me with some logs of a failed lookup, that might help in debugging the issue. If you have the terminal available you can try the following commands

killall phonehook-daemon
phonehook-daemon

which will start the daemon with full logging. If you have any sensitive data in the logs you may want to scrub that first.

japa-fi commented 9 years ago

[D] main:22 - daemon starting? [D] main:24 - open db [D] main:31 - create listener [D] dbus::dbus:18 - registering telepathy [D] dbus_adapter::Instance:26 - new dbus_adapter [D] QWaylandEglClientBufferIntegration::QWaylandEglClientBufferIntegration:62 - Using Wayland-EGL [D] MDesktopEntryPrivate::MDesktopEntryPrivate:230 - Specified Desktop file does not exist "/usr/share/applications/phonehook-daemon.desktop" [D] dbus::gotModems:94 - found hardware modem at "/ril_0" [D] dbus::gotNetworkStatus:141 - roaming false mobileCC 244 mobileNC 91 [D] phonenumber::phonenumber:12 - location prefix "358" [D] rule::find:356 - match! "Finland" [D] phonenumber::phonenumber:47 - this is local number. [D] dbus_adapter::testLookup:67 - "04047014430" "+3584047014430" [D] dbus_adapter::set_lookupState:45 - setting state = "activate:lookup" [D] expression for onCommand:185 - stateChange activate:lookup [D] stateChange:148 - GOT LOOKUP STATE!!! activate:lookup [D] lookup_worker::threadStarted:60 - bot query "SELECT id, name, xml, country FROM bot WHERE 1=1 AND id IN (1);" [D] lookup_worker::threadStarted:68 - got bot! "Fonecta.fi" [D] CookieMonster::CookieMonster:275 - attempting load cookies 1 [D] CookieMonster::CookieMonster:300 - loaded 2 cookies [D] dbus_adapter::set_lookupState:45 - setting state = "running:Fonecta.fi" [D] robot_base::run:154 - found 3 sets in robot. looking for "lookup" [D] robot_base::run:166 - has tags ("lookup") [D] robot_base::processNode:36 - processing node "results_lookup" output to "root" [D] robot_base::processNode:36 - processing node "telnrF" output to "results_lookup" [D] robot_base::expand_advanced:223 - attempt replace param "telnr" [D] robot_base::expand_advanced:228 - replace value "04047014430" [D] robot_base::processNode:36 - processing node "#login" output to "results_lookup" [D] robot_base::expand_advanced:223 - attempt replace param "user" [D] robot_base::expand_advanced:228 - replace value "5MASKED" [D] robot_base::expand_advanced:223 - attempt replace param "password" [D] handler_url_thread::run:23 - running url event handler, thread id = 0x4a8ec3f0 [D] robot_base::expand_advanced:228 - replace value "MASKED" [D] handler_url::loadUrl:76 - LOADING "https://tili.fonecta.fi/login" [D] handlerurl::loadUrl:86 - HEADER "Accept:application/json, text/plain, /_" [D] handler_url::loadUrl:86 - HEADER "Content-Type:application/json;charset=UTF-8" [D] handler_url::loadUrl:86 - HEADER "Referer:https://tili.fonecta.fi/login?appId=fonecta.fi" [D] handler_url::loadUrl:86 - HEADER "User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" [D] handler_url::loadUrl:122 - hashkey is "c66481c4f6be60cffcd72c0c934db253" [D] handler_url::loadUrl:141 - COOKIE "JSESSIONID" : "B2FA45C2EFBBFD97C0E8F0B2EAB1967E" [D] handler_url_thread::beginRequest:37 - begin request [D] expression for onCommand:185 - stateChange running:Fonecta.fi [D] stateChange:148 - GOT LOOKUP STATE!!! running:Fonecta.fi [D] handler_url_thread::network_response:243 - got network response! [D] handler_url::loadUrl:154 - wait finished [D] handler_url::loadUrl:173 - status code QVariant(int, 200) [D] handler_url::loadUrl:189 - content-encoding "" encoding "" [D] handler_url::loadUrl:232 - 201 bytes "{"loginStatus":1,"redirectUrl":"https://www.fonecta.fi/user/login/ext?c=85437f37-7950-4970-ac4e-bc756e792dba&u=1101746","emailVerified":false,"mobileVerified":false,"username":"5*MASKED*"" [D] robot_base::processNode:36 - processing node "field" output to "results_lookup" [D] robot_base::processNode:57 - input data = "08309580106288195" [D] handler_regexp::processRegex:38 - regex mapping (QPair("("loginStatus":2),",QVariant(Invalid) ) )
[D] handler_regexp::processRegex:48 - processing regex "("loginStatus":2)," [D] robot_base::processNode:36 - processing node "field" output to "results_lookup" [D] robot_base::processNode:57 - input data = "08309580106288195" [D] handler_regexp::processRegex:38 - regex mapping (QPair("("loginStatus":6),",QVariant(Invalid) ) )
[D] handler_regexp::processRegex:48 - processing regex "("loginStatus":6)," [D] robot_base::processNode:36 - processing node "#login-redir" output to "results_lookup" [D] robot_base::processNode:57 - input data = "08309580106288195" [D] handler_regexp::processRegex:38 - regex mapping (QPair(""loginStatus":1.redirectUrl":"(.?)"",QVariant(Invalid) ) )
[D] handler_regexp::processRegex:48 - processing regex ""loginStatus":1.redirectUrl":"(.?)"" [D] handler_url::loadUrl:76 - LOADING "https://www.fonecta.fi/user/login/ext?c=85437f37-7950-4970-ac4e-bc756e792dba&u=1101746" [D] handler_url::loadUrl:122 - hashkey is "aac682543ce9d51c17b81b9c51aceb66" [D] handler_url::loadUrl:141 - COOKIE "JSESSIONID" : "37FEFDC772890003B102B80D8E9EBB78" [D] handler_url_thread::beginRequest:37 - begin request [D] handler_url_thread::network_response:243 - got network response! [D] handler_url::loadUrl:154 - wait finished [D] handler_url::loadUrl:173 - status code QVariant(int, 303) [D] handler_url::loadUrl:76 - LOADING "https://www.fonecta.fi/" [D] handler_url::loadUrl:122 - hashkey is "aac682543ce9d51c17b81b9c51aceb66" [D] handler_url::loadUrl:141 - COOKIE "JSESSIONID" : "37FEFDC772890003B102B80D8E9EBB78" [D] handler_url_thread::beginRequest:37 - begin request [D] handler_url_thread::network_response:243 - got network response! [D] handler_url::loadUrl:154 - wait finished [D] handler_url::loadUrl:173 - status code QVariant(int, 200) [D] handler_url::loadUrl:189 - content-encoding "gzip" encoding "" [D] handler_url::loadUrl:232 - 43872 bytes "

<!DOCTYPE html>
<html>
    <head>
        <script type='text/javascript'>
        var gptAdSlots = [];
        var googletag = googletag || {};

        googletag" 

[D] robot_base::processNode:36 - processing node "#search" output to "results_lookup" [D] robot_base::processNode:57 - input data = "006530567398294806" [D] robot_base::expand_advanced:223 - attempt replace param "telnrF" [D] robot_base::expand_advanced:228 - replace value "04047014430" [D] handler_url::loadUrl:76 - LOADING "https://www.fonecta.fi/haku?what=04047014430&sort=RELEVANCE&latitude=&longitude=&autosuggested=false" [D] handler_url::loadUrl:86 - HEADER "Content-Type:application/x-www-form-urlencoded" [D] handler_url::loadUrl:86 - HEADER "Referer:https://www.fonecta.fi/" [D] handler_url::loadUrl:86 - HEADER "User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" [D] handler_url::loadUrl:122 - hashkey is "69c8daabc60970c5be00ad94362603d0" [D] handler_url::loadUrl:141 - COOKIE "JSESSIONID" : "37FEFDC772890003B102B80D8E9EBB78" [D] handler_url_thread::beginRequest:37 - begin request [D] handler_url_thread::network_response:243 - got network response! [D] handler_url::loadUrl:154 - wait finished [D] handler_url::loadUrl:173 - status code QVariant(int, 200) [D] handler_url::loadUrl:189 - content-encoding "gzip" encoding "" [D] handler_url::loadUrl:232 - 41397 bytes "

<!DOCTYPE html>
<html>
    <head>
        <script type='text/javascript'>
        var gptAdSlots = [];
        var googletag = googletag || {};

        googletag.cmd" 

[D] robot_base::processNode:36 - processing node "field" output to "results_lookup" [D] robot_base::processNode:57 - input data = "022562350519001484" [D] handlerregexp::processRegex:38 - regex mapping (QPair("<h[12] class="fo-h2">(.?)</h",QVariant(Invalid) ) )
[D] handlerregexp::processRegex:48 - processing regex "<h[12] class="fo-h2">(.?)</h" [D] robot_base::processNode:36 - processing node "field" output to "results_lookup" [D] robot_base::processNode:57 - input data = "022562350519001484" [D] handlerregexp::processRegex:38 - regex mapping (QPair("(.?).?(.?).?(.?)",QVariant(Invalid) ) )
[D] handlerregexp::processRegex:48 - processing regex "(.?).?(.?).?(.?)" [D] robot_base::processNode:36 - processing node "field" output to "results_lookup" [D] robot_base::processNode:57 - input data = "022562350519001484" [D] handlerregexp::processRegex:38 - regex mapping (QPair("Liittymän omistaja
(.
?)",QVariant(Invalid) ) )
[D] handlerregexp::processRegex:48 - processing regex "Liittymän omistaja
(.
?)" [D] robot_base::processNode:36 - processing node "field" output to "results_lookup" [D] robot_base::processNode:57 - input data = "022562350519001484" [D] handlerregexp::processRegex:38 - regex mapping (QPair("Operaattori
(.
?)",QVariant(Invalid) ) )
[D] handlerregexp::processRegex:48 - processing regex "Operaattori
(.
?)" [D] robot_base::run:188 - ======================================== [D] robot_base::run:189 - finished [D] lookup_worker::threadStarted:101 - xml result [D] lookup_worker::threadStarted:102 - " " [D] dbus_adapter::sendQml:57 - sending qml... [D] handler_url_thread::run:32 - loop is loose! [D] CookieMonster::~CookieMonster:308 - attempting save cookies [D] expression for onCommand:185 - result [ ]

[D] CookieMonster::~CookieMonster:316 - removed 2 old cookies [D] CookieMonster::~CookieMonster:328 - saved cookie! true [D] CookieMonster::~CookieMonster:328 - saved cookie! true [D] dbus_adapter::set_lookupState:45 - setting state = "finished" [D] lookup_worker::threadStarted:200 - lookup finished? [D] expression for onCommand:185 - stateChange finished [D] stateChange:148 - GOT LOOKUP STATE!!! finished [D] lookup_thread::worker_finish:24 - thread finished? [D] lookup_thread::~lookup_thread:29 - lookup_thread is destroy

omnight commented 9 years ago

Hi japa-fi, thanks for the logs, but that number doesn't seem to give any results on fonecta.fi. If you have a number that is listed on fonecta.fi but does not show up in the app, then those logs would be interesting.

japa-fi commented 9 years ago

There was a typo with the phone number, Actual number tested was 0407014430 which results to two hits, but phonehook gets no results. I'll upload updated data later.

omnight commented 9 years ago

Thanks! The two hits seem to be the issue here, I haven't tested with any number so far that gives multiple results. I will update the scraper and get back to you.

Edit: I have put up rev. 6 of the Fonecta scraper now, which should properly deal with multiple results.

omnight commented 9 years ago

I have just released a new version, 0.4.1, that I believe fixes the original problem, so I'm closing this issue for now.

japa-fi commented 9 years ago

On 2015-06-28 16:22, omnight notifications-at-github.com |github/Example Allow| wrote:

I have just released a new version, 0.4.1, that I believe fixes the original problem, so I'm closing this issue for now.

There is still issue with no results after restarting the phone. Killing the daemon and restarting it again (killall phonehook-daemon ; nohup phonehook-daemon &) will help.

omnight commented 9 years ago

Can you double check that you are using the latest version?

japa-fi commented 9 years ago

On 2015-06-29 09:08, omnight notifications-at-github.com |github/Example Allow| wrote:

Can you double check that you are using the latest version?

I checked when I saw your first comment on the new version. Apparently I messed up something, because now as I rechecked, there was an update.

Updated, rebooted, tested -> Works fine, no issues. Thanks.

omnight commented 9 years ago

Great! You had me worried there for a while that there were more bugs :)