Clarify proxy request error message
See original GitHub issueWhen the proxy request to register the site or sync site fields fails, the plugin currently shows a generic message: The request to the authentication proxy has failed. Please, try again later.
This message lacks any detail about the actual error that occurred, so this should be enhanced.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The error message The request to the authentication proxy has failed. Please, try again later. should be refined to include information about the actual error that occurred, if available:
- If there is a
WP_Error
, the message should include detail from there as follows: The request to the authentication proxy has failed with an error: %s - The placeholder should be the
WP_Error
’s error message if not empty, or its error code otherwise (as a fallback in case there’s no error message). - In case the error is just due to the
filter_var
call, the original message can remain.
- If there is a
Implementation Brief
- In
includes/Core/Authentication/Setup.php
, within thehandle_action_setup_start()
method:- Split out the condition that checks if
$oauth_setup_redirect
is aWP_Error
. - If
$oauth_setup_redirect
is aWP_Error
, get the error message usingWP_Error::get_error_message()
and if it is empty, get the error codeWP_Error::get_error_code()
and die with the message as per the AC.
- Split out the condition that checks if
Test Coverage
- Add a PHPUnit test similar to
Setup_Test::test_handle_action_setup_start__syncs_site_fields()
that returns a WP_Error when a request to the Google Proxy server is made. It can be calledtest_handle_action_setup_start__dies_if_proxy_server_errors()
. The logic to mock a WP_Error when an HTTP request is made can be similar to theAuthenticationTest::test_cron_update_remote_features__wp_erro()
method.
QA Brief
- To reproduce the error that this issue enhances:
- Disconnect SiteKit and then navigate again to the Google SiteKit Dashboard. You should be on the “Setup SiteKit” splash screen with “Sign in with Google” as the CTA.
- Disconnect your computer from the internet and then click the CTA (which will prevent the next immediate request being made to the proxy server). The request should fail with a WP Die / Error screen like below. Verify the error is as per the AC.
Changelog entry
- Update the setup error screen to include an error message returned from the proxy server.
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top Results From Across the Web
404 Unable to identify proxy for host: <virtual host name> and url
The client application gets an HTTP status code of 404 with the message Not Found and the error message Unable to identify proxy...
Read more >Guide to Solving Proxy Status Errors - Oxylabs
Briefly, a proxy server error is an HTTP error status. It occurs when the request you sent to a web server via a...
Read more >Linkerd Proxy Error: "Failed to proxy request: request timed out"
Hi all,. I deployed the linkerd service mesh on a GKE cluster several weeks ago. Setup was straightforward and the mesh has been...
Read more >Proxy error: Could not proxy request from localhost:3000 to ...
I I am trying to execute an HTTP Request to an endpoint from client side code. I used the default ASP.NET SPA template...
Read more >Error in outbound proxy - SAP Community
If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@wpdarren I tried to replicate issue following the steps mentioned under QAB. I’m also redirecting to ‘No internet page’ after clicking on ‘Sign in with Google’ button. Tried on both ‘revoke site kit’ and ‘setup sitekit’ splash screen. I’m not getting any error as per AC.
QA Update: ✅
Going through changing the wp-config file with
define( 'WP_HTTP_BLOCK_EXTERNAL', true );
I do see a similar error message as per the screenshot in the QAB.