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

SFApiRequestError: Maximum number of redirects exceeded #60

Closed
debprotim opened this issue Mar 27, 2024 · 12 comments
Closed

SFApiRequestError: Maximum number of redirects exceeded #60

debprotim opened this issue Mar 27, 2024 · 12 comments
Labels
INVESTIGATION P3 More Information Required More info required to triage issue

Comments

@debprotim
Copy link

Summary
While clicking on the "ask" tin the "Einstein for developers" extension in VScode, we are receiving an error defined below,

SFApiRequestError: Maximum number of redirects exceeded

Steps To Reproduce:
Go to "Einstein for Developers" extension and click on "Ask"
This throws an error saying "SFApiRequestError: Maximum number of redirects exceeded"
Expected result
This should not throw an error.

Actual result
This is throwing an error and obstructing the usage of functionality.

Describe what actually happened instead.

Additional information:
Have tried with latest version of VS code also but still error persists.

Salesforce Einstein For Developers Version in VS Code: v0.39.0

VS Code version: 1.86

@smarvez
Copy link

smarvez commented Mar 29, 2024

Hi @debprotim, thanks for the info and for your patience as we try to resolve this issue for you! Can you let me know if you're getting this error for all Einstein for Developers features? I.e. - Can you use our inline autocomplete feature? Does the command "Einstein: Generate Code" return a completion if you're in an Apex file? I would assume you'd see the same error for these features as well but I just want to rule out something specific to the sidebar. Additionally, I noticed your Einstein for Developers extension version is a little out of date so if you could update to the latest that would be great.

@smarvez
Copy link

smarvez commented Mar 29, 2024

Assuming you’re not able to get a response from any Einstein for Developers features, our suspicion is that the proxy you’re using is causing the redirects. By default our extension is setting the maximum number of redirects to 5. One way for us to test this would be to have you run a cURL command and see if the request shows up in our logs.

@debprotim
Copy link
Author

Yes, it is not working. Same error is popping up.

@RitamAgrawal
Copy link
Member

@debprotim I have increased the max_redirect limit and and would like to share the vsixes with you. GH doesn't support the VSIX to be shared here. What else would be a great way to connect with you? Also have you tried with latest version of Einstein For Developers v0.43.0 ?

@debprotim
Copy link
Author

I installed the vsix file. Anything particular you are looking for?

@RitamAgrawal
Copy link
Member

@debprotim Then re run the steps and let us know if you still see the error.

@debprotim
Copy link
Author

Same error:
image

@floralan
Copy link

Hi @debprotim, given that the new VSIX file with a raised max-redirect limit didn't resolve the issue, it seems likely that the proxy settings on your end are causing an infinite redirect loop or an excessively high number of redirections. I have asked the support engineer to assist you in investigating the proxy settings on your machine. Please let us know if you have any questions or need further assistance with this.

@RitamAgrawal
Copy link
Member

@debprotim This seems like a one-off user settings issue. Let us know how else if we can help you, otherwise would like to close this issue. Thank you for raising your concerns.

Copy link

git2gus bot commented Apr 23, 2024

Error while creating work item!

@RitamAgrawal RitamAgrawal added the More Information Required More info required to triage issue label Apr 23, 2024
@smarvez
Copy link

smarvez commented Apr 29, 2024

Hi @debprotim - Closing this issue out since the root cause appears to be a proxy setting issue. Please feel free to re-open or create a new issue if you have further questions.

@smarvez smarvez closed this as completed Apr 29, 2024
@gbockus-sf
Copy link
Contributor

gbockus-sf commented May 3, 2024

We had a follow up support meeting to help the user debug the proxy issue further and found the following:
There was a http_proxy setting in vscode. When removed the user was able to successfully hit the E4D endpoints for all features.
However without that setting the user was unable to auth against their orgs.

We provided the following guidance:
Work around:

  • Use CLI with proxy env vars set to do auth
  • Remove http_proxy setting from vscode
    This allows the user to still auth as necessary but decouples the proxy from VSCode so both E4D and standard SFVSCE tools works as expected.

Recommendations:
User should reach out to their IT support and have them follow up on why their proxy is hitting max redirect with E4D generation endpoints: https://api.salesforce.com/einstein/gpt/code/v1-alpha.1/

Attempted to utilize curl to track the redirects taking place, but got the expected 404 from the command line

curl -sLD - https://api.salesforce.com/einstein/gpt/code/v1-alpha.1/generations -o /dev/null -w '%{url_effective}'

Was also going to follow up by having the user attempt an auth'd curl request, but had issues getting a usable curl to the user. Could be a path in the future if other issues like this arise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INVESTIGATION P3 More Information Required More info required to triage issue
Projects
None yet
Development

No branches or pull requests

5 participants