Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matomo Mobile 2 HTTP error “bad request” #5426

Open
mreeve opened this issue Apr 29, 2021 · 5 comments
Open

Matomo Mobile 2 HTTP error “bad request” #5426

mreeve opened this issue Apr 29, 2021 · 5 comments
Labels

Comments

@mreeve
Copy link

mreeve commented Apr 29, 2021

We are using Matomo 4.2.1 and trying to login via the Matomo Mobile 2 (2.4.10) iOS app. However, when we try to login we are getting the following error:

Network Error
There was an error “HTTP error”. The request returned the status “bad request”. URL was “https://sitedomain.com/analytics/index.php”. Please check your entered URL and the error logs on this server for more information about the error and how to resolve it.

I’ve check the error logs at both the server level and matomo’s debugger and have not found anything useful.

I’ve tried different users including users with easier passwords to make sure it wasn’t a url encoding issue. I’ve tried super users, write users, and read users. We have multiple sites so I tried creating a user that has permissions to just one site. Nothing has helped.

The site is behind load balancer, but I've tried hitting the server directly. Both had the same failing result.

I’ve looked through the source code of both the mobile app and matomo and from what I can see they seem to be fine, but the app still fails. From what I could see from the mobile app, I put together what I think the url that is being requested:

https://sitedomain.com/analytics/index.php?userLogin=username&md5Password=passwordhere&passwordConfirmation=passwordhere&module=API&format=json&method=UsersManager.createAppSpecificTokenAuth&description=Matomo Mobile 2

This link works fine and returns a json object with the value. But for some reason, if this is the same url used within the iOS app, it fails.

Any help would be appreciated. Thank you.

@sgiehl
Copy link
Member

sgiehl commented Apr 30, 2021

Hi @mreeve. I actually don't have an apple device, but did you try to open the url you mentioned on your iOS device where the mobile app doesn't work? Wondering if that might be any kind of ad blocker that maybe blocks the request?

@mreeve
Copy link
Author

mreeve commented Apr 30, 2021

@sgiehl Good thought. I just tried your suggestion and got successful results from Safari and Chrome using two different Matomo accounts. It seems to only be an issue from inside the mobile app.

@sgiehl
Copy link
Member

sgiehl commented Apr 30, 2021

Are you maybe using some self signed certificate? Did you maybe try to connect the mobile app to the Matomo demo?

@mreeve
Copy link
Author

mreeve commented Apr 30, 2021

@sgiehl I noticed the mobile app was using POST instead of GET to send the info. I switched to using a POST and received the same 400 Bad Request error. I'm now in talks with our network/server admins to see if they have something blocking POST requests.

I'll reply with further details if we get this resolved.

@tsteur tsteur added the question label May 2, 2021
@tsteur
Copy link
Member

tsteur commented May 2, 2021

Thanks @mreeve I'll mark this issue for now as closed as it looks like a web server configuration issue where POST requests are causing issues. Be great to indeed reply further details if you get this resolved and should there still be any issue we will be happy to reopen any time. Hoping your network/server admins can help with this @mreeve . BTW the reason we're using POST requests is for security to prevent certain tokens appearing in web server logs etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants