I found one another issue in web services log files which shows errors given below:
[13-Jun-2019 09:01:27 UTC] [WAR] d0 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? LIMIT 2' at line 1] in EXECUTE("SELECT * FROM "external_tokens" WHERE "token" = ? LIMIT 2")Command was: SELECT * FROM "external_tokens" WHERE "token" = ?
[13-Jun-2019 09:01:27 UTC] Call stack (most recent first):
[13-Jun-2019 09:01:27 UTC] * log_message(string(size 343), integer, true, true) at /home/portfolio/public_html/lib/errors.php:95
[13-Jun-2019 09:01:27 UTC] * log_warn(string(size 343)) at /home/portfolio/public_html/lib/errors.php:859
[13-Jun-2019 09:01:27 UTC] * SQLException->__construct(string(size 343)) at /home/portfolio/public_html/lib/dml.php:517
[13-Jun-2019 09:01:27 UTC] * get_recordset_sql(string(size 51), array(size 0), integer, integer) at /home/portfolio/public_html/lib/dml.php:336
[13-Jun-2019 09:01:27 UTC] * get_record_sql(string(size 51), array(size 0), integer) at /home/portfolio/public_html/lib/dml.php:305
[13-Jun-2019 09:01:27 UTC] * get_record(string(size 15), string(size 5), null) at /home/portfolio/public_html/webservice/lib.php:1049
[13-Jun-2019 09:01:27 UTC] * webservice_server->authenticate_by_token(integer) at /home/portfolio/public_html/webservice/lib.php:980
[13-Jun-2019 09:01:27 UTC] * webservice_server->authenticate_user() at /home/portfolio/public_html/webservice/lib.php:1823
[13-Jun-2019 09:01:27 UTC] * webservice_base_server->run() at /home/portfolio/public_html/webservice/rest/server.php:75
As I am thinking that due to mysql version difference, mysql query may not executing to validate token during file upload from mahara mobile app. Site and server detail-
Mahara version is: 17.04
Php version: 7.0
Mysql version: 5.7
According to guidelines shown in server environment mahara page, all the requirements are okay. so How can I overcome from this problem?
]]>
The setup on demo.mahara.org was just activating the mobileapi in the plugin administration. No other changes were made.
It would be good if you set up another Mahara test site and gave it a go there as it seems you are missing something in your instance.
Cheers
Kristina
]]>
Again thanks for your support. But I already tested https://demo.mahara.org on my maharamobile app, this site is working fine, journals, file, recorded file can be easily uploded.
While for my site I have same problem as listed in previous post.
As given in mahara's manual, I have followed same steps to syncronize and integrate mahara mobile app.
Also I can't show the settings of mobileapp integration of https://demo.mahara.org (as Admin) so that I can match the same interagtion settings.
Please suggest any solution for same problem.
]]>
You can use any of the existing accounts on https://demo.mahara.org and hook them into Mahara Mobile to test the upload. The site is set up to support mobile uploads and I could upload an image without problems.
Cheers
Kristina
]]>
Thanks for your help.
I tried to upload jpg, pdf files from phone(size in kb), but still same problem persist . While journals are uploding from mahara app.
Also I checked the access logs, I found :
49.205.180.108 - - [03/May/2019:02:30:04 -0400] "POST /webservice/testclient.php?protocol=rest&authtype=token&service=1&function=1&wstoken=e99d557dce4481c8d080a6f70a3c8db7 HTTP/1.1" 303 - "https://xxx.edu/webservice/testclient.php?protocol=rest&authtype=token&service=1&function=1&wstoken=e99d557dce4481c8d080a6f70a3c8db7" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
49.205.180.108 - - [03/May/2019:02:30:05 -0400] "GET /webservice/testclient.php?protocol=rest&authtype=token&service=1&function=1&wstoken=e99d557dce4481c8d080a6f70a3c8db7 HTTP/1.1" 200 38844 "https://xxx.edu/webservice/testclient.php?protocol=rest&authtype=token&service=1&function=1&wstoken=e99d557dce4481c8d080a6f70a3c8db7" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"
In case, if I run Test in Web Service of module_mobileapi_sync, with details below:
Protocol : REST
Authentication type : TOKEN
Service : Mahara Mobile API(TOKEN)
Functions : module_mobileapi_upload_file
FIle uploaded of 400kb, Title, Description, wstoken entered
Result:-
array ( 'url' => 'https://xxx.edu/webservice/rest/server.php?wstoken=e99d557dce4481c8d080a6f70a3c8db7&wsfunction=module_mobileapi_upload_file&alt=json', 'results' => array ( ), 'inputs' => array ( 'filetoupload' => array ( 'name' => 'How do I set up Mahara on my phone.pdf', 'type' => 'application/pdf', 'tmp_name' => '/tmp/phpHXJHO7', 'error' => 0, 'size' => 410371, ), 'title' => 'How to SET MAHARA ', 'description' => 'setup mahara', 'tags' => array ( ), ), )
-------------------------------------
How can I give access to a test user account, so you can rectify the exact problem easily? Please help
]]>
Looking at the webservice log you provided it looks like the 'module_mobileapi_sync' webervice call is being run by you - eg it runs when you log in.
But the uploading of files looks to be happening as a logged out user - user ID = 0 means logged out (but for legacy reasons displays as 'root' on that log).
So it looks like when you try and upload a file it doesn't think you are logged in.
Is the size of the file quite large? I'm wondering if the uploading is timing out / losing the session.
Also, the invalidtokennotsupplied error stems from Mahara expecting a wstoken value to be passed to it that is in a alphanumerical format - can you check the access/error logs for the site to see what the wstoken value was for those failed calls?
Cheers
Robert
]]>
Thanks for your support again.
I have checked from another phone as well as another account's token.Logged-in successfully, but problem still same as I can upload journal's only from Mahara app. FIles and audio recorded files are not uploading and shows same error "invalidtokennotsupplied" .
How can I send you site url as well as account's token so this problem can be rectify easily?
Also another question is how can I show tabbed navigation of pages with in a collection(in Mahara 17.04 version)?
]]>Since I can't replicate the issue and the error message only says "invalidtokennotsupplied", it's not easy to replicate. Do you have the same issue on another phone with another account and the correct setup?
Cheers
Kristina
]]>
Thanks for your support.
I have followed these same steps. I am also able to login via token in mahara app as well as to upload journals but not be able to upload any file and audio record. As I have already send you a logs above, which clearly shows error.
How can I upload files and recorded audio file from mahara app. Please help
]]>I can't replicate the issue. The steps I took are (and include links to the user manual's relevant pages):
Are you using these steps and screens as well?
Cheers
Kristina
]]>
Now I have generated token in mahara site and used same to token access mahara mobile app successfully.
But one problem is that I am not able to upload any data , journal from mobile
Error log is: exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo:
Please help.
My Mahara version - 17.04.6
Error logs detail below:
User (Sort by: Ascending) | Institution (Sort by: Ascending) | Protocol (Sort by: Ascending) | Authentication type (Sort by: Ascending) | Function (Sort by: Ascending) | Time taken (Sort by: Ascending) | When (Sort by: Ascending) | Info |
---|---|---|---|---|---|---|---|
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03892 | 01 April 2019, 10:49 AM | |
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03534 | 01 April 2019, 10:51 AM | |
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03961 | 01 April 2019, 11:14 AM | |
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03513 | 01 April 2019, 11:16 AM | |
root | - unknown - | REST | TOKEN | 0.00307 | 01 April 2019, 11:16 AM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: | |
root | - unknown - | REST | TOKEN | 0.00314 | 01 April 2019, 11:17 AM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: | |
root | - unknown - | REST | TOKEN | 0.00301 | 01 April 2019, 11:21 AM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: | |
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03672 | 01 April 2019, 12:12 PM | |
root | - unknown - | REST | TOKEN | 0.00312 | 01 April 2019, 12:12 PM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: | |
root | - unknown - | REST | TOKEN | 0.00313 | 01 April 2019, 12:19 PM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo |
Now I have generated token in mahara site and used same to token access mahara mobile app successfully.
But one problem is that I am not able to upload any data , journal from mobile
Error log is: exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo:
Please help.
My Mahara version - 17.04.6
Error logs detail below:
User (Sort by: Ascending) | Institution (Sort by: Ascending) | Protocol (Sort by: Ascending) | Authentication type (Sort by: Ascending) | Function (Sort by: Ascending) | Time taken (Sort by: Ascending) | When (Sort by: Ascending) | Info |
---|---|---|---|---|---|---|---|
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03892 | 01 April 2019, 10:49 AM | |
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03534 | 01 April 2019, 10:51 AM | |
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03961 | 01 April 2019, 11:14 AM | |
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03513 | 01 April 2019, 11:16 AM | |
root | - unknown - | REST | TOKEN | 0.00307 | 01 April 2019, 11:16 AM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: | |
root | - unknown - | REST | TOKEN | 0.00314 | 01 April 2019, 11:17 AM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: | |
root | - unknown - | REST | TOKEN | 0.00301 | 01 April 2019, 11:21 AM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: | |
nitinm | - unknown - | REST | OTHER | module_mobileapi_sync | 0.03672 | 01 April 2019, 12:12 PM | |
root | - unknown - | REST | TOKEN | 0.00312 | 01 April 2019, 12:12 PM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: | |
root | - unknown - | REST | TOKEN | 0.00313 | 01 April 2019, 12:19 PM | exception: WebserviceAccessException message: Access control exception : [[invalidtokennotsupplied/auth.webservice]] debuginfo: |
]]>
In order to use Mahara Mobile, you'll need to set up a token in Mahara for the communication to be secure and to not require you to having to log in every single time. If you have XML-RPC (MNet) and no other single sign-on, you'll need to enable the manual token generation for Mahara Mobile in Mahara as we can't log into the Mahara homepage with MNet. Instead, you'd paste the token in that a student generated to connect the two.
Since Mahara Mobile and Moodle Mobile are completely separate apps, you can't connect the two between each other. If you'd like to achieve that, investigation into the technical possibilities would be required.
Cheers
Kristina
]]>There is no synchronization between Mahara Mobile and the Moodle mobile app. What are you trying to achieve?
Cheers
Kristina
]]>