Skip to content

Host ID collision error should be a diagnostic event #8949

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

Closed
paulbatum opened this issue Dec 2, 2022 · 3 comments · Fixed by #9061
Closed

Host ID collision error should be a diagnostic event #8949

paulbatum opened this issue Dec 2, 2022 · 3 comments · Fixed by #9061

Comments

@paulbatum
Copy link
Member

For background on hostID collision see:
https://github.com/Azure/azure-functions-host/wiki/Host-IDs

Repro steps

  1. Create two function apps with a deliberate host ID collision, e.g. make them share a storage account and have a name that is longer than 32 characters.
  2. Restart the apps once they are both created, to force the collision check to occur

Expected behavior

One or both the apps should fail to start with the collision error e.g. A collision for Host ID 'asdf' was detected in the configured storage account. For more information, see https://aka.ms/functions-hostid-collision.

This error should be displayed in the portal, as an error banner. Most importantly, the link in the above error message needs to be rendered so that the user can follow it and take the recommended actions. For this to happen, it needs to be logged as a diagnostic event.

Actual behavior

No mention of host ID truncation appears in the portal experience. The user has to go to detailed logs such as app insights to find the details of the truncation error. They may see other error noise that is just a symptom, of the host shutting down to the collision, such as the below message, but this won't lead them to understanding the root of the problem.

2022-12-01T23:26:41.158 [Error] Failed to start a new language worker for runtime: dotnet-isolated.
System.Threading.Tasks.TaskCanceledException : A task was canceled.
   at async Microsoft.Azure.WebJobs.Script.Grpc.GrpcWorkerChannel.StartWorkerProcessAsync(CancellationToken cancellationToken) at /_/src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs : 271
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
@asalvo
Copy link

asalvo commented Dec 29, 2022

This feature would have saved us several days. In our case, we were using an incorrect casing of AzureFunctionsWebHost__hostid to specify a custom Host Id (we had Id instead of id), so we were getting host id collisions.

However, we saw this log line "Host id explicitly set in configuration. This is not a recommended configuration and may lead to unexpected behavior." which implies that our hostId setting was being used. There were no errors logged indicated there was a hostId collision.

@asalvo
Copy link

asalvo commented Dec 29, 2022

There is also a lot of confusion over the casing of hostid vs hostId in the context of the Diagnostics error. See the recent comments (including my own) over here: #2015 (comment)

@scp-mb
Copy link

scp-mb commented Jan 3, 2023

+1 on this, spent time tracking down why we were getting TaskCanceledException seemingly randomly as no error message was present.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants