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

[bug bash] The Core Tools hang if an error is encountered when indexing PowerShell functions #964

Open
Francisco-Gamino opened this issue Jun 8, 2023 · 0 comments

Comments

@Francisco-Gamino
Copy link
Contributor

The hang is probably being caused by the Functions Host, but I am adding an issue here for tracking.

TODO: Need to check with the Python and NodeJs teams to see if the same happens in their new programming models.

Repro steps:
Define a PowerShell function with a syntax issue in it, and start the Core Tools

This is my function definition in my functions.psm1 file:

function GenericHttpTriggerImplementation()
{
    [Function()]
    [OutputBinding(Type='http', Name='Response')]
    param(
        [InputBinding(Type='httpTrigger')]
        [AdditionalInformation()] # This is the line with the issue where the binding name is missing
        [AdditionalInformation(BindingName='Request', Name='authLevel', Value='anonymous')]
        [AdditionalInformation(BindingName='Request', Name='methods', Value=('GET', 'POST'))]
        [AdditionalInformation(BindingName='Request', Name='route', Value='')]
        $Request,
        $TriggerMetadata
    )
}

The Core Tools hang even after pressing Ctrl + C

Core Tools output:

PS C:\MyFunctionApps\PSNPMBugBash> func start

Azure Functions Core Tools
Core Tools Version:       4.0.5210 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.21.1.20667

[2023-06-08T22:01:36.567Z] Language Worker Process exited. Pid=13800.
[2023-06-08T22:01:36.568Z] C:\Program Files\dotnet\dotnet.exe exited with code -532462766 (0xE0434352). Unhandled exception. System.Exception: Errors reported while executing Get-FunctionsMetadata cmldet. System.Management.Automation.CmdletInvocationException: The following problems exist with AdditionalInformation: \n The BindingName is missing,   at Microsoft.Azure.Functions.PowerShell.SDK.WorkerIndexingHelper.IndexFunctions(DirectoryInfo baseDir, List`1& errors).
[2023-06-08T22:02:30.191Z] Requesting metadata from worker failed.
[2023-06-08T22:02:30.197Z] Microsoft.Azure.WebJobs.Script.Grpc: The operation has timed out.
@Francisco-Gamino Francisco-Gamino transferred this issue from Azure/azure-functions-powershell-library Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant