Azure / Azure/app-service-linux-docs

gRPC has stopped working on ASEv3 App Services [.NET 7]

Open
#185 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
150
Forks
90
Avg merge
2m
Merged PRs (30d)
1

Description

We had a working gRPC app deployed an ASEv3 App Service (Linux with .NET 7). We postponed the remainder of our work on the app a couple of months ago, but left the instance be as we were planning to resume our work later.

When we went back to it, our local client started throwing this error:

```
at GrpcClient.Program.<>c__DisplayClass0_1.<b__0>d.MoveNext() in [...]\GrpcClient\Program.cs:line 42
--- End of stack trace from previous location ---
at GrpcClient.Program.Main(String[] args) in [...]\GrpcClient\Program.cs:line 52
at GrpcClient.Program.(String[] args)
```

We tested the app locally - it is working fine - and redeployed to the instance. The issue persisted.

We checked all of our configs, the `HTTP20_ONLY_PORT` is set to 5243, and the HTTP version is set to 2.0, and HTTP 2.0 Proxy is set to true.

We also checked the SCM logs. We can see that the app is successfully initialised:

```
/home/LogFiles/2023_08_31_al0sdlwk00000W_default_docker.log (https://.scm..appserviceenvironment.net/api/vfs/LogFiles/2023_08_31_al0sdlwk00000W_default_docker.log)
2023-08-31T21:03:12.925258658Z Now listening on: http://[::]:8080
2023-08-31T21:03:12.925264958Z info: Microsoft.Hosting.Lifetime[14]
2023-08-31T21:03:12.925269258Z Now listening on: http://[::]:5200
2023-08-31T21:03:12.925273558Z info: Microsoft.Hosting.Lifetime[0]
2023-08-31T21:03:12.925277658Z Application started. Press Ctrl+C to shut down.
2023-08-31T21:03:12.925282058Z info: Microsoft.Hosting.Lifetime[0]
2023-08-31T21:03:12.925286558Z Hosting environment: Production
2023-08-31T21:03:12.925301258Z info: Microsoft.Hosting.Lifetime[0]
2023-08-31T21:03:12.925305659Z Content root path: /home/site/wwwroot
```

This is, however, immediately followed by another log entry:

```
/home/LogFiles/2023_09_01_al0sdlwk00000W_easyauth_docker.log (https://.scm..appserviceenvironment.net/api/vfs/LogFiles/2023_09_01_al0sdlwk00000W_easyauth_docker.log)
2023-09-01T10:10:46.489989416Z Updated CA certificates
2023-09-01T10:10:48.374354668Z warn: Microsoft.AspNetCore.Server.Kestrel[0]
2023-09-01T10:10:48.374399369Z Overriding address(es) 'http://0.0.0.0:8181'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.

/home/LogFiles/2023_09_01_al0sdlwk00000W_msi_docker.log (https://.scm..appserviceenvironment.net/api/vfs/LogFiles/2023_09_01_al0sdlwk00000W_msi_docker.log)
2023-09-01T11:03:15.047861773Z Content root path: /app
2023-09-01T11:03:15.047867573Z Now listening on: http://[::]:8081
```

I'm not entirely sure what this one is about, but it seems to be switching ports and excluding the HTTP2 port.

Just in case this had something to do with our code, I deployed a version of the Greeter sample that you supply on a fresh instance of App Service (still on ASEv3), and it didn't work.

Please note that the Http 1.1 requests are successful in both instances. Calling the endpoint yields the boilerplate response:
> Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909

The error occurs when we use a gRPC client. As seen above, the error message that we get from our .NET client app isn't very descriptive. When, however, we call the endpoint with `grpcurl`, we get the following response:

```
Error invoking method "proxy.ServiceBusProxy/Publish": rpc error: code = Unknown desc = failed to query for service descriptor "proxy.ServiceBusProxy": unexpected HTTP status code received from server: 500 (Internal Server Error); malformed header: missing HTTP content-type
```

The response is the same whether we call our own gRCP server (above), or the Greeter server:

```
Error invoking method "greet.Greeter/SayHello": rpc error: code = Unknown desc = failed to query for service descriptor "greet.Greeter": unexpected HTTP status code received from server: 500 (Internal Server Error); malformed header: missing HTTP content-type
```

Both of these work when they are run in our local environment.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.