question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dialogflow Client Library: FormatException: "Name does not match template: incorrect number of segments"

See original GitHub issue

We are encountering a problem with the “Google.Cloud.Dialogflow.V2.ContextName.Parse” method. The full stacktrace can be found at the end of this issue. It seems like the method is completely fine with contexts such as: projects/{project-id}/agent/sessions/{sessionId}/contexts/{context-name} but fails at contexts in the following format: projects/{project-id}/agent/environments/{environment-id}/users/{user-id}/sessions/{sessionId}/contexts/{context-name}

We currently can not reproduce when a request session is in the former or in the latter format. Both behaviors are currently observed with two different google users testing an action-on-google with dialogflow which is currently in Alpha phase.

Environment details

  • OS: Windows 10
  • .NET version: Net Standard (2.0.3)
  • Package name and version: Google.Cloud.Dialogflow.V2 (1.0.0-beta02)

Steps to reproduce

  1. Build an action-on-google with dialogflow and put it into alpha
  2. Try get a specific context by name such as in the folling code: webhookRequest.QueryResult.OutputContexts.SingleOrDefault(context => context.ContextName.ContextId == "some-context-i-need-to-read")
  3. If your session contains the /environment path it will fire the exception of the title.

Stacktrace:

System.FormatException:
   at Google.Api.Gax.PathTemplate.ParseName (Google.Api.Gax, Version=2.5.0.0, Culture=neutral, PublicKeyToken=3ec5ea7f18953e47)
   at Google.Cloud.Dialogflow.V2.ContextName.Parse (Google.Cloud.Dialogflow.V2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=185c282632e132a0)
   at Google.Cloud.Dialogflow.V2.Context.get_ContextName (Google.Cloud.Dialogflow.V2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=185c282632e132a0)
 ...

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:23

github_iconTop GitHub Comments

1reaction
jskeetcommented, Mar 26, 2020

Great - glad you’ve got something for now. I’ve created #4665 to handle this “new and slightly different but with the same cause” breakage. I suggest you subscribe to that issue, and I’ll close it when I publish 3.0.0-beta01.

1reaction
jskeetcommented, Mar 22, 2019

Thanks. On the move right now, but will look when I’m back at a laptop

Read more comments on GitHub >

github_iconTop Results From Across the Web

DialogFlow v2 Error: [ResourceName error] Path '' does not ...
It looks like your connection request is failing (first error says ... the URI you are attempting to request from to ensure the...
Read more >
Troubleshooting | Dialogflow Documentation
The requests are handled as no input or no match. Listen to the audio recording to confirm that it contains speech.
Read more >
PeopleSoft CRM 9.2: PeopleSoft Online Marketing
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for...
Read more >
Troubleshoot Google Cloud Dialogflow CX and ES integrations
I have an agreement with Genesys for my Google Cloud Dialogflow service. Open a Genesys Cloud Customer Care case in My Support Portal....
Read more >
Build fulfillment (Dialogflow)
Fulfillment defines the conversational interface for your Action to obtain user input and the logic to process the input and eventually fulfill the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found