Forums | Mahara Community

Mobile Mahara /
Can I syncronise mahara app with moodle app


Nitin Mishra's profile picture
Posts: 25

02 May 2019, 19:05

Hi Kristina,

 

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)?

Robert Lyon's profile picture
Posts: 757

03 May 2019, 14:06

Hi Nitin,

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

 

 

Nitin Mishra's profile picture
Posts: 25

03 May 2019, 22:18

Hello Robert,

 

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

 

Kristina Hoeppner's profile picture
Posts: 4729

04 May 2019, 9:37

Hi Nitin,

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

Nitin Mishra's profile picture
Posts: 25

04 May 2019, 22:28

Hi 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.

 

 

 

 

 

Kristina Hoeppner's profile picture
Posts: 4729

12 May 2019, 11:32

Ni Nitin,

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

Nitin Mishra's profile picture
Posts: 25

17 June 2019, 19:52

Hi Kristina,

 

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?

 

 

Nitin Mishra's profile picture
Posts: 25

17 June 2019, 19:54

I also increased the entropy in php.ini but no fruitful result came.

Kristina Hoeppner's profile picture
Posts: 4729

23 June 2019, 21:39

Please see my reply to your other forum post you created with the same query.

19 results