Can not see any sms messages in nextcloud (browser)
Steps to reproduce
- Install ocsms on Nextcloud
- Install nextcloud SMS on Android
- Connect to your account
- 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"}
please update android app version to 1.3.4 first and re-test
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).
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).
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.
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.
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