microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
870 stars 371 forks source link

Conversational Core Template: Cannot read property 'content' of undefined #5433

Closed chrisshaw closed 3 years ago

chrisshaw commented 3 years ago

Describe the bug

Creating a new bot with the Conversational Core (preview) template throws the error TypeError Cannot read property 'content' of undefined.

Version

image

Browser

OS

To Reproduce

Steps to reproduce the behavior:

  1. Select New
  2. Select the Conversational Core template. Hit Next.
  3. Select a directory to store the bot. Next.
  4. Watch the loader say Getting template.
  5. Watch the loader say Building runtime.

I continued the following, which may provide additional useful (or unrelated) details about a second error:

  1. Select Conversational Core from the Examples shortcut
  2. Select a directory to store the bot. Next.
  3. Get a 500 error.
  4. Repeat the first 5 steps to try again
  5. Get the same error

Expected behavior

The bot creates using the conversational core template. Composer does not throw the error.

Screenshots

Screenshot from 2021-01-02 16-40-48 Screenshot from 2021-01-02 16-41-07 Screenshot from 2021-01-02 16-41-33 Screenshot from 2021-01-02 16-42-14 Screenshot from 2021-01-02 16-44-08

gabog commented 3 years ago

Hi @pavolum, can you take a look at this one? Thanks

pavolum commented 3 years ago

Excuse the delay! @chrisshaw I am unable to repro from either creation flow you outlined but have not yet run it in an Ubuntu setting.

To provide a bit of additional troubleshooting info...

1) Can you repro the error while also running fiddler. I have noticed that the 500 response call occasionally has additional info besides what is outputted to the dev tool console/error modal. The 500 call should be coming from the api/status/ endpoint. Please send over the full raw response.

2) Can you open a CLI and run 'dotnet new -u' and send over the version details for the following package image

Many thanks!

chrisshaw commented 3 years ago

Hi @pavolum image

I'll update this with the raw response I see in fiddler when I'm able.

pavolum commented 3 years ago

Thanks @chrisshaw, hmm so its not a template version issue, interesting. Hopefully the response will give some hints. Ill try and get my hands on an ubuntu machine to try in repro in a more accurate environment.

chrisshaw commented 3 years ago

@pavolum could you point me to more guidance on Fiddler? I'm new to Fiddler (and the C# ecosystem for that matter) and it's starting to feel like I'm doing it wrong. I don't suppose you know how to get Fiddler listening to localhost within the electron distribution? All the support options seem to imply I control the request (which seems like that would defeat the purpose of a repro).

In my efforts I did notice the message that came with the 500 was something like "directory with name already exists." That feels like a symptom of trying to create the project again. Meanwhile, the first time I get the TypeError, the status requests actually return 200s.

If you'll let me speculate, my WAG would be that the /status response body result.files[4] (the .qna file) is the culprit as its content property is an empty string.

image

srinaath commented 3 years ago

@pavolum Can you drive this ticket forward?

pavolum commented 3 years ago

@chrisshaw I believe your hypothesis is correct. I remember having similar issue due to blank content in the qna file but we released a new version of the template package that should have resolved this. As far as the dir already exists that seems to be a symptom of the erroneous creation flow leaving files in your dir even though it did not successfully create. Trying a different bot name in creation should result in it not trying to write to the same file again but as you have noted that seems to still throw an error (hypothesis being the empty qna file).

We will be releasing a new version of Composer in the next few weeks. The conversational core functionality has been greatly refactored and enhanced and both the 'clean up files when creation errors' and 'empty qna' file have been resolved in the new implementation. The new implementation also using local yeomen env generators for templates as opposed to the C# nuget implementation of the preview release you are having issues with.

I recommend we wait for that release and try and reproduce the issue in the updated flow. My hopes are that the large refactor results in resolving this particular issue.

I will leave this issue open and follow up once R12 has gone GA to walk you through the new flow. Then we can validate if this issue still exists in the new implementation and tackle troubleshooting if it does.

Many thanks for your patience and outlining the issue thus far. I have high hopes that the new implementation will resolve the issue and you will be able to create component model templates without a hitch!

cwhitten commented 3 years ago

Hi @chrisshaw this has been addressed and will be available in a new release.