Posted: March 30, 2017 at 4:18 pm
|
Hi, When trying to login to the event app using my iphone6, I received the following error message ‘The server was acting as a gateway or proxy and received an invalid response from the upstream server.’ I saw some older posts here reporting the same error. I tried all those possible solution including one on https://eventespresso.com/wiki/ee4-event-apps/#troubleshooting. I also made sure that the required minimum capabilities apply. None seems to solve the issue for me. Could you please advise? |
|
FYI, the error on an android is different, which is ‘Connection error. Unable to load data’. |
Hi there, The errors that you’re seeing in the app indicate that the URL input into the first field of the app login screen does not match the URL of your website. May I ask, what’s the URL that you input there? |
|
|
Hi Josh, Thanks for your message. As for the URL, I’ve tried them all – http://www.tickettail.com, http://tickettail.com, http://www.tickettail.com/. |
Looking over your site the JSON API is returning error 500 when testing the andpoints. Do you have access to the servers error logs? If so take a look and see if there are any fatal errors shown in the log recently. Or, if you enable WP_DEBUG on the site we should be able to see the error shown then. |
|
This URL in a browser returns some JSON data about the event: http://tickettail.com/wp-json/ee/v4.8.36/events So we know that at least the JSON API is working on your website. The other things to check is whether the apps are getting blocked by a security setting or plugin. You can install this plugin to log the requests from the apps: https://wordpress.org/plugins/wp-rest-api-log/ After you activate this plugin, you can try the app again, then go to WordPress > Tools > REST API log to see the request. It may help to temporarily deactivate any security plugins if installed to check whether they may be blocking the requests from the apps. |
|
|
Here’s what I got from the log Date: 2017-03-31 21:28:29 |
|
Which part of the log should we be looking at? |
Do you have any security plugins installed on the site? Do you have any plugins that alter the REST API installed on your site? Either something is blocking the requests or your server is throwing an error when the apps are making a request (but oddly enough not when the browser makes one). |
|
|
Hi Tony, As for REST API, I checked see only the WP Rest API (Version 2.0-beta15) that seems relevant. |
If you check your website’s .htaccess file, is there any code between these two .htaccess comments?
|
|
|
No, there are no such comments. This is what is currently in .htaccess # BEGIN WordPress # END WordPress |
You could try this edit to the .htaccess file:
If you still can’t log in with the app, you can try deactivating all other plugins installed on the site except for the Event Espresso plugins and the Application Passwords plugin. |
|
|
I tried deactivating all the other plugins, the same error messages still persist. |
Did you make the edit to the .htaccess file? |
|
|
Yes, I did. Is it possible the host is blocking calls from the app? |
One way to find out would be check the server’s access logs. |
|
|
Ok, I have the logs now. Could you please advise on how to make use of them? |
You’ll look at the exact times where you tried to use the app and see if anything was logged at those moments. It may help to try the app, then immediately check the access logs. Also, if the requests from the app are reaching your site, then you can also check what was logged from the WP REST API Log plugin at those same times. |
|
|
I have access to two types of logs (via DirectAdmin)- Web Usage Log and Web Error Log. I reviewed both of them but did not see anything that should represent calls from the app. I’m not too sure though. How would the calls from the app be listed there? |
If your logs include IP addresses, then the IP address of your iphone will be included in the request. If your logs include user agent strings, this is what the typical user agent string from the app: EventEspressoHD\/3 CFNetwork\/808.3 Darwin\/16.3.0 |
|
|
Ok, I dont think I see any request from the app in the logs. How am I supposed to proceed next? |
You can check with your host to see if they have mod_security rules or a firewall configured to block requests from the app. |
|
|
Hi, the host would like to know what would be the request URL of the calls? |
Some examples include:
|
|
|
The host adjusted the firewall and now I’m able to see the calls in the logs file. However, I’m still unable to login with exactly the same errors as before. Here’s what I see in the logs. THis is what’s currently in my htaccess file # END WordPress |
The part in the .htaccess file where you added
needs to get moved to the line before because otherwise the next time the rewrite rules get reset, you’ll lose those changes. Can you check with your host to see if they’ll allow the Authorization header to get passed in the request? |
|
|
Hi Josh, I modified the htaccess again per your instruction but the errors still persist. I also checked with the host and they confirmed that they allow such modification. Now, what might be the next step to resolve this? |
They confirmed that they allow such modification, but can they confirm that they’ll actually allow the Authorization header to get passed when using Basic Auth? |
|
|
Yes, they did confirm that too. (Anyway, is there a way we can check if that’s the case?) |
You can use the Postman app to send a GET request to the /registrations/ route and include your WordPress username and password in the Basic Auth header. This is a screenshot that shows an example of the above request in Postman: https://www.evernote.com/l/AAR1Lix4IyBK5IXi4I8DJ5vuD5rSNWOnr0I |
|
|
In the Postman App, what would be the URL to “Get” for my site? |
No, the /registrations/ route on your site is:
When I try the above URL in Postman, I get a 500 server error, so it’s looking like a fatal error is being thrown on your site when that route is requested. |
|
|
I got a 500 server error too. What can we make of this and what would you suggest I do? |
I can suggest that you activate WP_DEBUG and check the debug.log file in the wp-content folder and/or check the server’s error logs for the time when you got the 500 server error. |
|
|
The error I got is Seems like the path /home/tickettail/.htaccess is incorrect. It should be /home/tickettail/domain/tickettail.com/public_html/.htaccess So I guess we have to modify so that the URL http://tickettail.com/wp-json/ee/v4.8.36/registrations points to the correct path? Please advise |
I can advise that you contact your host about the error because that’s a server configuration issue. You’ll note that there’s no issue with the same URL pattern if it’s a request that doesn’t require authorization, like this one: |
|
|
The host insisted they did not alter the configuration at all. I’m not sure what to do now. Is there a way we can check or change the path called by the URL http://tickettail.com/wp-json/ee/v4.8.36/registrations? |
The host will need to fix the configuration to allow the Authorization header to be passed when Authentication is required for a GET request. How is it that changing the path called by the URL is going to fix anything? Did you actually share the “Permission denied:” error message with the host so they can review? |
|
You can also share the following information with your host: |
|
The support post ‘Event app error’ 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.