Ticket #2244 (closed Bug: fixed)

Opened 11 months ago

Last modified 2 months ago

Can't Login via piwik mobile

Reported by: hugo5688 Owned by:
Priority: major Milestone: Piwik Mobile Client
Component: Core Keywords:
Cc: Sensitive: no

Description

hi,

i tried a lot of time, i can't not login via piwik mobile.

but it works when i use the safari to access the login page.

please tell me how to fix it.

hardware:iphone4 OS:iOS 4.2.1

Attachments

sites IDS.xml Download (148.0 KB) - added by matt 9 months ago.

Change History

  Changed 11 months ago by vipsoft

  • milestone set to Piwik Mobile Client

follow-up: ↓ 3   Changed 11 months ago by SteveG

Hi,

What version of piwik itself do you use? As we use the meta data api in piwik mobile, only piwik > 0.7 could work.

What kind of error occured? Any error message displayed? Have you tried to create another user in piwik itself and use that one in piwik mobile?

Have you already tried another piwik, our online demo for example? Try  http://demo.piwik.org and anonymous access.

in reply to: ↑ 2   Changed 11 months ago by hugo5688

Replying to SteveG:

Hi, What version of piwik itself do you use? As we use the meta data api in piwik mobile, only piwik > 0.7 could work. What kind of error occured? Any error message displayed? Have you tried to create another user in piwik itself and use that one in piwik mobile?

Hi,

The version i used is 1.2.1

the error message show " oops...problem during the request, please try again. "

I already created a test account.

It all the same no matter change the permission to admin or anonymous.

Have you already tried another piwik, our online demo for example? Try  http://demo.piwik.org and anonymous access.

  Changed 11 months ago by tsteur

Hey hugo5688,

Please, ensure you can answer the following questions with yes:

  • Is your Url to Piwik Server correct?
  • Have you entered correct login and password?
  • Is there any unwanted characters – spaces for example – in the Piwik Url, username or password?
  • Does your Piwik user have at least "View" permission for one website?

Further:

  • Did you deactivate any APIs (Settings -> Plugins)?
  • Have you tried the Piwik server " http://demo.piwik.org" with anonymous access? Does it work for you?

Greetz Thomas

  Changed 11 months ago by tsteur

Piwik Mobile 1.3 is available now. Could you try it with this version again, please?

  Changed 10 months ago by tsteur

Hey hugo5688,

can you just leave a short comment whether this error still occurs?

  Changed 9 months ago by matt

A friend confirmed the issue. Here are steps he did:

  1. log into piwik
  2. click settings
  3. click the '+' sign
  4. put ' http://piwik.domain.com' in the 'piwik access url' box
  5. keep anonymous access off
  6. 7 Type in super user login & password, which work fine in the browser

He said that

  • first time, alert box displayed 'oops... (something else)'
  • second time, nothing - hit 'save', and nothing happens

Maybe this report can help fixing the issue...

Some thoughts

  • There is definitely a problem/bug, but maybe it comes from confusing messaging or help rather than a real bug
  • Maybe the connection to piwik cannot be done for some reasons, in which case an error message should be displayed?
  • in what case do you display "oops..." message?
  • why in second time, there is nothing happening, maybe the credentials are not resubmitted... ? He hits save many times, and nothing happens
  • when no trailing slash to submitted URL, you add it automatically correct?

Thanks :)

  Changed 9 months ago by matt

  • priority changed from normal to major

  Changed 9 months ago by tsteur

Hi Matt,

I've a look at this next weekend.

The 'oops...' message is displayed in case of an unknown error , see  http://dev.piwik.org/trac/browser/mobile/tags/1.3.1/Resources/library/HttpRequest.js#L269( http://dev.piwik.org/trac/browser/mobile/tags/1.3.1/Resources/library/HttpRequest.js#L269) For example: * 'Failed to parse response' -> we set this error if we were not able to parse the response * 'Manager is shut down.' -> don't know what this exactly means * 'No wrapped connection' -> don't know what this exactly means * 'Adapter is detached' -> don't know what this exactly means

Maybe there is a parse error? I've currently no Server running having a newer version. Only Piwik Server 1.0. I have to setup one.It definitely works with Piwik Server Version 1.0.

Was there any change since 1.0?

What I do is: Fetching the tokenAuth via "UsersManager.getTokenAuth". If that was successful and If I get a valid token: Fetching availableSites to make sure the User has at least view access to one site via "SitesManager.getSitesIdWithAtLeastViewAccess".

* Yes, we automatically add a trailing slash if not already one is set.

* Resubmitting the credentials a second time works fine for me, I guess this has to do with the error that occurs.

  Changed 9 months ago by matt

Thomas, thanks for following up.

  • Is it possible that in future release, as well as showing "oops" you append the actual error message fetched? This might help further users debugging.
  • I tried on my friends piwik, and the server is configured in such a way that:

 http://example.org/?module=API&method=UsersManager.getTokenAuth&userLogin=admin&md5Password=test does NOT work, but  http://example.org/index.php?module=API&method=UsersManager.getTokenAuth&userLogin=admin&md5Password=test DOES work

In Piwik Mobile, do you make the request to domain/?module=API or to domain/index.php?module=API ?

  • Assuming you put index.php?xxxx I think the problem is because his Piwik returns 8,000 website Ids... so it will maybe not work well. I attach the file returned with all IDs.

Then, do you call the API to get the list of names for each ID?

For example on his piwik, the call to module=API&method=SitesManager.getSitesWithAtLeastViewAccess returns a XML that is 3Mb!!! so, too big.

Maybe the solution would be to implement a "site selector" similar to the one in the Piwik UI. Load by default, the first 10 website Ids and names, and then have a search field to search for another website. The ajax js code is using the API as well: SitesManager.getPatternMatchSites() to search for string matching (and soon also match ID: #2425)

What do you think about the site selector proposal?

Changed 9 months ago by matt

  Changed 9 months ago by tsteur

(In [4865]) refs #2244 display the actual error message in case of a default error

  Changed 9 months ago by tsteur

I do now output the "oops" message as well as the actual error message.

Ah! His site requires 'index.php'. There was an error in previous (and the current published) versions that a slash is always added if there is not already a slash at the end, see  http://dev.piwik.org/trac/browser/mobile/tags/1.3.1/Resources/views/settings/editaccount.js#L259 .

That means the app adds a slash after 'index.php' which probably causes the error. It's already fixed in trunk  http://dev.piwik.org/trac/browser/mobile/trunk/Resources/library/Piwik/Network/AccountRequest.js#L171 . Otherwise I don't put 'index.php' or something else.

When verifying the account credentials I call 'SitesManager.getSitesIdWithAtLeastViewAccess' JSON output and only IDs which should be a bit smaller. But I always request "SitesManager.getSitesWithAtLeastViewAccess" when a user starts the app to get a list of his current sites. I currently don't cache it cause the user's permissions have probably changed (added a new site or removed one).

Damn! So many sites :) We definitely have to implement a selector for sites.

  Changed 9 months ago by matt

Cool changes!

Feedback

  • Maybe we can automatically add index.php as well as final slash, if not specified. so that it works in all cases and they don't have to try?
  • for the mobile app with many IDs, I created a new ticket: #2474

  Changed 4 months ago by tsteur

  • status changed from new to closed
  • resolution set to fixed

Issue will be fixed in Piwik Mobile 1.6 release.

Please reopen if it is not working for you.

  Changed 2 months ago by wlx

Same problem happened in Iphone4, ios 4.3.1, with piwik mobile 1.6.2

Note: See TracTickets for help on using tickets.