question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarify proxy request error message

See original GitHub issue

When 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.

Implementation Brief

  • In includes/Core/Authentication/Setup.php, within the handle_action_setup_start() method:
    • Split out the condition that checks if $oauth_setup_redirect is a WP_Error.
    • If $oauth_setup_redirect is a WP_Error, get the error message using WP_Error::get_error_message() and if it is empty, get the error code WP_Error::get_error_code() and die with the message as per the AC.

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 called test_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 the AuthenticationTest::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. Screenshot 2022-05-23 at 12 28 40

Changelog entry

  • Update the setup error screen to include an error message returned from the proxy server.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
mohitwpcommented, Jun 8, 2022

@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.

0reactions
wpdarrencommented, Jun 16, 2022

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.

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found