Posted: October 23, 2017 at 5:39 pm
|
Seems like I’m returning valid JSON response with event data: https://hamar-tennis.no/wp-json/ee/v4.8.29/events but I’m getting the good old: “Connection error. Unable to load data” when trying to connect using Applications password. I have stepped through all the relevant steps in the troubleshooting guide https://eventespresso.com/wiki/ee4-event-apps/#troubleshooting |
Hi there, The apps actually hit more than just the /events/ endpoint, and many of the endpoints (like /registrations/) require authentication. Assuming you have no security plugins activated, WP_DEBUG is false, and you deactivate (yes deactivate) the Applications Password plugin, can you log into the app using your WP Username and WP Password? It might also help to install the REST API log plugin to capture more verbose error messages when the app tries to connect to your webserver. |
|
|
WP_DEBUG is not declared at all in wp-config.php so by default it’s OFF I guess? I have deactivated the Applications Password plugin, Installed the REST API Log Plugin and tried to connect using my own WP username and WP password. When I check the REST API Log there are no entries after I try to connect with the App? |
Hi there, I checked into this and something on your server is blocking the request based on the user-agent set on the request. This works – http://take.ms/8CCwP This does not – http://take.ms/6p9TT The request isn’t even hitting your site, it’s being blocked before that so it won’t show up in the REST API Log. I recommend contacting your host and have them investigate what it blocking the request and either remove it or add an exception for the above. |
|
|
I see you are using http and not https, are you sure this is not the problem? Also can you please elaborate on what kind of request the app is making? |
Its exactly the same with http and https Working – http://take.ms/PdgRc Not working – http://take.ms/dYOLa Something is blocking the request based on the user-agent, it doesn’t matter what requests are made currently (I’ve tried many different endpoints), the okhttp user agent is blocked on them all. I’m testing GET requests. |
|
|
Thank you for your effort Tony. I have contacted our host and asked them about this. Most likely it is blocked by default and they need to make an exception in their firewall. |
I meant to ask about, which version of the app are you using? Android or iOS? |
|
|
Android. My hosting company has replied (translated from norwegian) “GET requests shall normally not be blocked by the server, but there could be some rules on the server blocking this.” They have asked for my the IP address of the client making the request so they can check their logs. It’s the public IP of my mobile phone right? |
Yes, that’s correct. |
|
|
Response from the hosting company: “It appears that the request triggers a rule against bad user_agents (OkHttp). |
No, you can’t change the user agent from within the app. I’ve created a ticket for us to investigate changing the user agent on the request but as it stands you can’t change it. |
|
|
All ok now. My host made an exception in their firewall for the Okhttp user agent. Nice host 🙂 |
The support post ‘“Connection error.Unable to load data”and yes I have chkd troubleshooting guide’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.