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

Container Apps ingress returns "Bad Request" to Salesforce (works fine in App Service) #567

Closed
1 of 3 tasks
onionhammer opened this issue Jan 17, 2023 · 8 comments
Closed
1 of 3 tasks
Labels
bug Something isn't working Networking Related to ACA networking

Comments

@onionhammer
Copy link

onionhammer commented Jan 17, 2023

This issue is a: (mark with an x)

  • bug report -> please search issues before submitting
  • documentation issue or request
  • regression (a behavior that used to work and stopped in a new release)

Issue description

When issuing a new request from Salesforce, no matter which container is running, the request is stopped at ingress and responds with "Bad Request" and a status code of 400.

Steps to reproduce

  1. Create a new Azure Container App via the portal, using the 'hello world'
  2. IN SALESFORCE: Execute anonymous request in salesforce (code below)
    or CURL: curl -X GET -H "sfdc_stack_depth: 1" https://your-aca-endpoint.centralus.azurecontainerapps.io

Expected behavior [What you expected to happen.]
The container's http server should be invoked, allowing the container to handle the request

Actual behavior [What actually happened.]
Ingress stops the request and returns literal string "Bad Request" with status code of 400. The same container running on Azure App Service works fine via Salesforce

Screenshots
Bad request in debug output of salesforce
image

hello world running, works fine in browser and postman:
image

Additional context
Code to execute:

Http http = new Http();
HttpRequest request = new HttpRequest();

request.setEndpoint('https://test.someaca-210420418.centralus.azurecontainerapps.io/');
request.setMethod('GET');

HttpResponse response = http.send(request);
System.debug(response.getStatus());
System.debug(response.getStatusCode());
System.debug('response headers:');
for(String headerKey : response.getHeaderKeys()){
    System.debug(headerKey + ': ' + response.getHeader(headerKey));
}
System.debug('response body:');
System.debug(response.getBody());
@ghost ghost added the Needs: triage 🔍 Pending a first pass to read, tag, and assign label Jan 17, 2023
@onionhammer onionhammer changed the title Container Apps ingress returns "Bad Request" from Salesforce Container Apps ingress returns "Bad Request" to Salesforce Jan 17, 2023
@onionhammer onionhammer changed the title Container Apps ingress returns "Bad Request" to Salesforce Container Apps ingress returns "Bad Request" to Salesforce (works fine in App Service) Jan 17, 2023
@SSilence
Copy link

I have the same Bad Request error using custom http header parameters with an underscore _ in the name. e.g. my_header: xyz. Removing this underscore solves the problem.

@onionhammer
Copy link
Author

Indeed salesforce does send a header with sfdc_stack_depth: 1, which is the culprit.

@onionhammer
Copy link
Author

Relates to #264

@onionhammer
Copy link
Author

I believe ACA uses Envoy as ingress; perhaps this setting is wrong?

https://cloudnative.to/envoy/api-v2/api/v2/core/protocol.proto.html#enum-core-httpprotocoloptions-headerswithunderscoresaction

image

@anrub
Copy link

anrub commented Jan 18, 2023

imho, I would suggest allowing header names with underscore, because, why not? I don't think that some legacy CGI system will be using container apps.

@torosent
Copy link
Member

Hi. We are working on a solution to this restriction.

@SophCarp SophCarp added bug Something isn't working Networking Related to ACA networking In progress Solution/feature is being worked on and removed Needs: triage 🔍 Pending a first pass to read, tag, and assign labels Jan 20, 2023
@torosent torosent removed the In progress Solution/feature is being worked on label Jan 30, 2023
@torosent
Copy link
Member

torosent commented Jan 30, 2023

HI @anrub,@onionhammer, @SSilence . The fix is deployed in all regions. We are allowing header names with underscore.

@onionhammer
Copy link
Author

HI @anrub,@onionhammer, @SSilence . The fix is deployed in all regions. We are allowing header names with underscore.

Should this issue be marked as closed then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Networking Related to ACA networking
Projects
None yet
Development

No branches or pull requests

6 participants