forcedotcom / Einstein-GPT-for-Developers

Einstein GPT For Developers
BSD 3-Clause "New" or "Revised" License
38 stars 9 forks source link

502 error when behind corporate proxy #103

Open lechum2 opened 4 weeks ago

lechum2 commented 4 weeks ago

Summary

When trying to use Chat with Dev Assistant I am getting 502 error. We have proxy in our company. I have set it properly in vs code, salesforce cli settings (was not working without it) and in my environment variables.

Steps To Reproduce:

  1. Open Dev Assistant Chat
  2. Type anything and hit Enter

Actual result

502 error

Additional information

Debug log for Agentforce for Developers:

10:47:03.818 sfApiClient.getSfApiUrl
10:47:03.818 DefaultOrg ~ Using cached JWT.
10:47:03.818 sfApiClient.getSfApiRegion
10:47:03.818 Tracing header sfapi /embeddings
10:47:03.971 In AxiosClient, axiosClient.handleError AxiosError: Request failed with status code 502
10:47:03.972 Error creating embeddings
10:47:03.973 Error: Error encountered requesting chat stream: 
11:03:13.675 ActiveTextEditor.changeHandler
11:07:12.979 ActiveTextEditor.changeHandler

Salesforce Extension Version in VS Code: v62.2.0

Salesforce Einstein For Developers Version in VS Code: v1.2.0

OS and version: Windows_NT x64 10.0.19045

VS Code version: 1.93.1

gbockus-sf commented 4 weeks ago

Hi @lechum2 Looks like call to verify the prompt is failing. Are the other features functional?
Are you able to see inline autocompletions in an Apex or LWC file?
If you right click a method in an Apex class can you generate a test? (Agentforce: generate a test)

Trying to narrow down if this is specific to just requests made from the dev assistant.

lechum2 commented 3 weeks ago

Hi @gbockus-sf No, the inline completions and test generation is not working either. Here are some more debug logs:

09:38:53.425 'Congratulations, your extension salesforce.salesforcedx-einstein-gpt is now active!'
09:38:53.426 PromptHistoryViewProvider.constructor
09:38:53.437 START: OramaEmbeddingDatabaseSupplier.startup()
09:38:53.510 END: OramaEmbeddingDatabaseSupplier.startup()
09:38:53.512 ChatFeature.registerProvider for webview
09:38:53.512 ChatFeature.registerCommands
09:38:53.512 Feature: Chat enabled
09:38:53.514 DefaultOrg ~ Initialized with Org ID: *** and Username: ***
09:38:53.514 Getting a JWT from the DefaultOrg. Tracing header for jwt request: 
09:38:53.925 DefaultOrg ~ JWT successfully retrieved.
09:38:53.925 InlineCompletionsFeature.disable
09:38:53.926 TestGenerationFeature.disable
09:38:53.928 Feature: Inline Completions enabled
09:38:53.928 TestGenerationFeature.registerCommands
09:38:53.929 TestGenerationFeature.registerCommands: Test generation enabled
09:38:53.930 salesforce.salesforcedx-einstein-gpt status: Ready
09:38:53.930 salesforce.salesforcedx-einstein-gpt enabled! (default org has permission)
09:38:54.40 WorkspaceStatisticService: Sobject context size: 19
10:11:51.605 inline provider triggered
10:11:51.605 settingsDelay: 
10:11:51.605 delayTime: 
10:11:51.856 JWT is expired.
10:11:51.856 Getting a JWT from the DefaultOrg. Tracing header for jwt request: 
10:11:52.234 DefaultOrg ~ JWT successfully retrieved.
10:11:52.235 InlineCompletionService triggerPredictor.shouldTriggerSuggestions complete
10:11:52.294 contextBuilderDuration took 57.0216 ms
10:11:52.294 InlineContextBuilder.getContext complete
10:11:52.295 sfApiClient.inlineQuery inputs: 
10:11:52.295 sfApiClient.getSfApiUrl
10:11:52.295 DefaultOrg ~ Using cached JWT.
10:11:52.295 sfApiClient.getSfApiRegion
10:11:52.295 Tracing header sfapi /generations
10:11:52.465 In AxiosClient, axiosClient.handleError AxiosError: Request failed with status code 502
10:11:52.467 Failed to retrieve inline completions from SfAPI
10:11:52.467 InlineCompletionService.getInlineCompletions: Error requesting inline completion
10:13:14.692 Starting Agentforce: Generate a Test
10:13:14.692 Enter generateApexTest
10:13:14.692 set promptId
10:13:14.693 Retrieving symbols
10:13:14.715 Symbols retrieved
10:13:14.715 Extracting method to text
10:13:14.716 Retrieving method ranges
10:13:14.716 Retrieving symbols
10:13:14.716 Symbols retrieved
10:13:14.716 Method ranges retrieved
10:13:14.716 TestCaseService.captureSelectedApexTestPath
10:13:16.807 Retrieving method ranges
10:13:16.807 Retrieving symbols
10:13:16.896 Symbols retrieved
10:13:16.897 Method ranges retrieved
10:13:21.713 Generating completion...
10:13:21.713 ApiClient Setting value: Salesforce API
10:13:21.714 Context builder is enabled
10:13:21.714 ContextBuilder.getContext
10:13:21.714 Executing gatherer ApexMethodGatherer
10:13:21.714 Extracting method text
10:13:21.714 Method text extracted
10:13:21.714 Retrieving symbols
10:13:21.729 Symbols retrieved
10:13:21.733 ApexMethodGatherer took 19.4532 ms
10:13:21.734 Time spent running gatherer
10:13:21.734 Executing gatherer ApexSymbolGatherer
10:13:21.734 ApexSymbolGatherer: No apex files found in prompt
10:13:21.734 ApexSymbolGatherer called with context
10:13:21.735 ApexSymbolGatherer took 1.3532 ms
10:13:21.735 Time spent running gatherer
10:13:21.735 Executing gatherer SchemaGatherer
10:13:21.735 No SObject found in prompt
10:13:21.736 SchemaGatherer took 0.4219 ms
10:13:21.736 Time spent running gatherer
10:13:21.736 Gatherer returned empty context
10:13:21.736 contextBuilderDuration took 21.8806 ms
10:13:21.736 ContextBuilder.getContext complete
10:13:21.736 TCG Prompt builder is enabled
10:13:21.736 TestCaseGenPromptBuilder.build
10:13:21.736 TestCaseGenPromptBuilder.build characters available for context: 
10:13:21.736 TestCaseGenPromptBuilder: No test methods provided
10:13:21.736 TestCaseGenPromptBuilder: No schema provided
10:13:21.737 promptBuilderDuration took 0.4082 ms
10:13:21.737 TestCaseGenPromptBuilder.build complete
10:13:21.737 Generating completion...
10:13:21.737 sfApiClient.naturalLanguageQuery
10:13:21.737 Here is some Apex code.

***Apex Code Context***

Now please write a single unit test method for the `anyFromSetIsPartOfValue` method.
10:13:21.737 sfApiClient.getSfApiUrl
10:13:21.737 DefaultOrg ~ Using cached JWT.
10:13:21.738 sfApiClient.getSfApiRegion
10:13:21.738 Tracing header sfapi /generations
10:13:21.922 In AxiosClient, axiosClient.handleError AxiosError: Request failed with status code 502
10:13:21.923 Error encountered attempting to call API endpoint
10:13:21.924 Exit generateApexTest
10:13:21.924 Agentforce: Generate a Test completed.
10:14:21.90 ActiveTextEditor.changeHandler
Kasakasz commented 2 weeks ago

Hi, @gbockus-sf any updates on this? i have the same issue.

mzadworny commented 1 week ago

Same issue

okrystecka commented 1 day ago

Here as well