ocsms icon indicating copy to clipboard operation
ocsms copied to clipboard

Can not see any sms messages in nextcloud (browser)

Open marneu opened this issue 8 years ago • 6 comments

Steps to reproduce

  1. Install ocsms on Nextcloud
  2. Install nextcloud SMS on Android
  3. Connect to your account
  4. Do first sync

Expected behaviour

Expected is to see the SMS from Smartphone within the browser.

Actual behaviour

No communication is shown

Server configuration

NextCloud/ownCloud version: 12.0.4.3

PHP version: 7.0.22

HTTPd server: Nginx

Database engine & version: mysql 5.5.57 (mariaDB)

Client configuration

Android version: 6.0.1

Phone: SGS5 (SM-G900F)

NextCloud SMS app version: 1.3.3

Logs

{"reqId":"[an]","level":3,"time":"2017-12-15T10:24:46+00:00","remoteAddr":"x.x.x.x","user":"[any_user]","app":"PHP","method":"POST","url":"\/index.php\/apps\/ocsms\/push?format=json","message":"Invalid argument supplied for foreach() at \/srv\/xxxxxx\/2\/www\/owncloud\/apps2\/ocsms\/db\/smsmapper.php#264","userAgent":"nextcloud-phonesync (1.3.3)","version":"12.0.4.3"}

marneu avatar Dec 15 '17 10:12 marneu

please update android app version to 1.3.4 first and re-test

nerzhul avatar Dec 16 '17 09:12 nerzhul

Done.

{"reqId":"[same_ID]","level":3,"time":"2017-12-16T10:16:36+00:00","remoteAddr":"x.x.x.x","user":"[a_user]","app":"PHP","method":"POST","url":"\/index.php\/apps\/ocsms\/push?format=json","message":"Invalid argument supplied for foreach() at \/srv\/s28058\/2\/www\/owncloud\/apps2\/ocsms\/controller\/apicontroller.php#112","userAgent":"nextcloud-phonesync (1.3.4)","version":"12.0.4.3"}
{"reqId":"[same_ID]","level":3,"time":"2017-12-16T10:16:36+00:00","remoteAddr":"x.x.x.x","user":"[a_user]","app":"PHP","method":"POST","url":"\/index.php\/apps\/ocsms\/push?format=json","message":"Invalid argument supplied for foreach() at \/srv\/s28058\/2\/www\/owncloud\/apps2\/ocsms\/db\/smsmapper.php#264","userAgent":"nextcloud-phonesync (1.3.4)","version":"12.0.4.3"}

Same result. Looks to me like there is some misfunction in smsmapper. Can I help to debug the php code (and how).

marneu avatar Dec 16 '17 10:12 marneu

if I add a statement before the for each loop in the php files

file_put_contents ( "/tmp/ocsms.log", print_r(array($smsCount,count($smsDatas),$smsDatas),true), FILE_APPEND);

results in

Array
(
    [0] => 
    [1] => 0
    [2] => 
)

Imho the empty($smsCount) could be caught in an error message (means return false).

marneu avatar Dec 16 '17 13:12 marneu

SMS is visible now! Don't know why haven't changed anything else. Could be closed from my point of view, except we can improve/test something.

marneu avatar Dec 16 '17 15:12 marneu

Please don't close the topic.The messages I get look very similar:

{"reqId":"3DPYT32Up3jJDjNmcPpR","level":3,"time":"2017-12-24T09:24:54+00:00","remoteAddr":"192.168.79.100","user":"ranger","app":"PHP","method":"POST","url":"\/\/index.php\/apps\/ocsms\/push?format=json","message":"Invalid argument supplied for foreach() at \/var\/snap\/nextcloud\/4378\/nextcloud\/extra-apps\/ocsms\/controller\/apicontroller.php#112","userAgent":"nextcloud-phonesync (1.3.4)","version":"12.0.4.3"} {"reqId":"3DPYT32Up3jJDjNmcPpR","level":3,"time":"2017-12-24T09:24:54+00:00","remoteAddr":"192.168.79.100","user":"ranger","app":"PHP","method":"POST","url":"\/\/index.php\/apps\/ocsms\/push?format=json","message":"Invalid argument supplied for foreach() at \/var\/snap\/nextcloud\/4378\/nextcloud\/extra-apps\/ocsms\/db\/smsmapper.php#264","userAgent":"nextcloud-phonesync (1.3.4)","version":"12.0.4.3"}

I also get an error notification from the android app.

RangerTM avatar Dec 24 '17 09:12 RangerTM

i noticed a refresh problem on the app, sms are correctly in DB, i think a huge refactor of the app is required to permit it to work better, but it's a huge work

nerzhul avatar Dec 28 '17 15:12 nerzhul