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:NullPointer Exceptions during plugin registration (Registration and invocation still works, but this show up in logs constantly) #10052

Open
prajwalpyakurelMS opened this issue Jan 2, 2025 · 1 comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@prajwalpyakurelMS
Copy link

Describe the bug
We are seeing Nullpointer exceptions for some of our OpenAI plugins when registering plugin to a kernel object.
This exception is not causing plugin registration to fail. However, it does appear constantly in logs which might need to be cleaned up or suppressed?

We use the method: .
await kernelWithOpenAIEndpoint.kernel.ImportPluginFromOpenApiAsync(
plugin.Key,
plugin.Value.ToStream(),
new OpenApiFunctionExecutionParameters()
{
HttpClient = client
});

Event time | 1/2/2025, 9:23:32.2170333 AM (Local time) |   -- | -- | -- Message | Object reference not set to an instance of an object. |   Exception type | System.NullReferenceException |   Failed method | Microsoft.SemanticKernel.Plugins.OpenApi.OpenApiKernelExtensions.ConvertOperationIdToValidFunctionName |  

Custom Properties

 

0 | MembershipOffersPlugin |   -- | -- | -- 2 | Object reference not set to an instance of an object. |   ActionName | Microsoft.Partner.Portals.FrontdoorServices.Controllers.CoPilotController.GetAnswerEvents (Partner.Portals.FrontdoorServices) |   TraceId | 13a860c902901a19ec29b74516009d65 |   ActionId | 10e6f1f3-517a-4735-8e23-810b9b041f68 |   SpanId | 0ac273d0b40e5af0 |   AspNetCoreEnvironment | PROD |   OriginalFormat | Something went wrong while rendering the Rest function. Function: {0}.{1}. Error: {2} |   FormattedMessage | Something went wrong while rendering the Rest function. Function: MembershipOffersPlugin.(null). Error: Object reference not set to an instance of an object. |   RequestId | 4000ecf5-0000-8d00-b63f-84710c7967bb |   ParentId | d89546fb70f68f99 |   RequestPath | /portal/api/v1/copilot/chatEvents |   CategoryName | Microsoft.SemanticKernel.Plugins.OpenApi.OpenApiKernelExtensions

System.NullReferenceException: at Microsoft.SemanticKernel.Plugins.OpenApi.OpenApiKernelExtensions.ConvertOperationIdToValidFunctionName (Microsoft.SemanticKernel.Plugins.OpenApi, Version=1.3.1.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3) at Microsoft.SemanticKernel.Plugins.OpenApi.OpenApiKernelExtensions.CreateRestApiFunction (Microsoft.SemanticKernel.Plugins.OpenApi, Version=1.3.1.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3) at Microsoft.SemanticKernel.Plugins.OpenApi.OpenApiKernelExtensions+d__6.MoveNext (Microsoft.SemanticKernel.Plugins.OpenApi, Version=1.3.1.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3)

To Reproduce
Steps to reproduce the behavior:
Register a plugin to the kernel where given method can have a null object.

Example plugin used where it failed:
MembershipOffersPlugin: {
PluginId: "7759a288-5a45-43ae-9c1c-ddcb38fb5b1f",
NameForHuman: "Membership Purchase and Offers",
NameForModel: "MembershipOffersPlugin",
DescriptionForHuman: "Plugin for answering partner's questions in membership workspace related to buy now, renew now, purchase and eligible offers for programs like Solutions Partner Designation, MAPS, Legacy Gold, Legacy Silver, Partner launch benefits, Partner success core benefits, Partner Success Expanded benefits, ISV Success and Training Partner",
DescriptionForModel: "Membership Purchase and Offers plugin must ALWAYS be invoked in Membership workspace. It can provide answers for questions regarding 'Membership purchase' such as 'help me make a purchase', 'status of buy now button', 'reason buy now button is disabled', 'when will the buy now button be enabled', 'Why buy now button is disabled?', 'Why renew now button is disabled?'. This plugin gives content as well as sources. If using this plugin, you MUST always cite the sources inline in your response.",
},

Expected behavior
Plugin registration shouldn't result in this nullpointer exception.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform

  • OS: [e.g. Windows, Mac]
  • IDE: [e.g. Visual Studio, VS Code]
  • Language: [e.g. C#, Python]
  • Source:


Additional context
Add any other context about the problem here.

@prajwalpyakurelMS prajwalpyakurelMS added the bug Something isn't working label Jan 2, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel triage labels Jan 2, 2025
@github-actions github-actions bot changed the title Bug: Python: Bug: Jan 2, 2025
@github-actions github-actions bot changed the title Python: Bug: .Net: Bug: Jan 2, 2025
@prajwalpyakurelMS prajwalpyakurelMS changed the title .Net: Bug: Bug:NullPointer Exceptions during plugin registration (Registration and invocation still works, but this show up in logs constantly) Jan 2, 2025
@evchaki
Copy link
Contributor

evchaki commented Jan 2, 2025

@RogerBarreto can you take a look?

@evchaki evchaki removed python Pull requests for the Python Semantic Kernel triage labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

No branches or pull requests

3 participants