# Video attachment error?

**URL:** <https://forum.rasa.com/t/video-attachment-error/49476>\
**Category:** Rasa Open Source\
**Created:** [November 24, 2021, 11:32am UTC](https://forum.rasa.com/t/video-attachment-error/49476 "2021-11-24T11:32:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronankff](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ronankff](https://forum.rasa.com/u/ronankff)\
**Post date:** [November 24, 2021, 11:32am UTC](https://forum.rasa.com/t/video-attachment-error/49476/1 "2021-11-24T11:32:42Z")

</div>

Hi there,

I have been previously embedding videos in a Rasa system as follows:

> dispatcher.utter\_message( attachment={ “type”: “video”, “payload”: { “title”: “Here is a video”, “src”: “[www.youtube.com](http://www.youtube.com)” } } )

However, this has started causing a strange error, the output is as follows:

> 2021-11-24 11:18:03 ERROR asyncio - Task exception was never retrieved future: \<Task finished coro=\<configure\_app..run\_cmdline\_io() done, defined at c:filepath\env\lib\site-packages\rasa\core\run.py:128\> exception=TypeError(‘can only concatenate str (not “dict”) to str’)\> Traceback (most recent call last): File “c:filepath\env\lib\site-packages\rasa\core\run.py”, line 134, in run\_cmdline\_io sender\_id=conversation\_id, File “c:filepath\env\lib\site-packages\rasa\core\channels\console.py”, line 152, in record\_messages button\_question = print\_bot\_output(response) File “c:filepath\env\lib\site-packages\rasa\core\channels\console.py”, line 37, in print\_bot\_output cli\_utils.print\_color("Attachment: " + message.get(“attachment”), color=color) TypeError: can only concatenate str (not “dict”) to str Transport closed @ (‘127.0.0.1’, 54758) and exception experienced during error handling

This error doesn’t happen when I replace the attachment message with a text output. It’s definitely the attachment format that throws this error.

Output HAS to come from actions.py as there is some additional logic to do with the particular link output to the user.

System is using the following versions: rasa==1.10.2 rasa-core==0.8.2 rasa-nlu==0.13.3 rasa-sdk==1.10.3 rasa-x==0.32.2

Any ideas?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 24, 2021, 11:37am UTC](https://forum.rasa.com/t/video-attachment-error/49476/2 "2021-11-24T11:37:46Z")

</div>

@ronankff Try this

```auto

responses:
  utter_greet:
  - text: "Check this video"
    attachment: { "type":"video", "payload":{ "src": "https://youtu.be/Z6v6Dpt05CA" } }

```

OR

```auto
msg = { "type": "video", "payload": { "title": "Link name", "src": "https://youtu.be/Z6v6Dpt05CA" } }

dispatcher.utter_message(text="Check this video",attachment=msg)

```

Can you update the rasa version to at least 2.8.1 and 2.8.1 for Rasa and Rasa-Idk ? If version is not a issue?

**PS:** You need to copy the embed link only.

---

<div class="post-metadata">

**Author:** ![ronankff](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ronankff](https://forum.rasa.com/u/ronankff)\
**Post date:** [November 24, 2021, 11:43am UTC](https://forum.rasa.com/t/video-attachment-error/49476/3 "2021-11-24T11:43:35Z")

</div>

Thanks for the response nik. Unfortunately it’s the same error.

And no, we cannot update to 2.8.1+.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 24, 2021, 11:45am UTC](https://forum.rasa.com/t/video-attachment-error/49476/4 "2021-11-24T11:45:10Z")

</div>

@ronankff what is your front end?

---

<div class="post-metadata">

**Author:** ![ronankff](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ronankff](https://forum.rasa.com/u/ronankff)\
**Post date:** [November 24, 2021, 11:45am UTC](https://forum.rasa.com/t/video-attachment-error/49476/5 "2021-11-24T11:45:40Z")

</div>

I’m currently running through Rasa shell

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 24, 2021, 11:47am UTC](https://forum.rasa.com/t/video-attachment-error/49476/6 "2021-11-24T11:47:29Z")

</div>

@ronankff can you share me the Class/ code for this section only, where you mention the dispatcher?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 24, 2021, 11:50am UTC](https://forum.rasa.com/t/video-attachment-error/49476/7 "2021-11-24T11:50:59Z")

</div>

> [@nik202](#):
>
> ```auto
> msg = { "type": "video", "payload": { "title": "Link name", "src": "https://youtu.be/Z6v6Dpt05CA" } }
> 
> dispatcher.utter_message(text="Check this video",attachment=msg)
> 
> ```

@ronankff Ronan, check my second code please attachment=msg and JSON data should be above not inside dispatcher.utter\_message that why I guess dict issue is coming.

---

<div class="post-metadata">

**Author:** ![ronankff](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ronankff](https://forum.rasa.com/u/ronankff)\
**Post date:** [November 24, 2021, 11:52am UTC](https://forum.rasa.com/t/video-attachment-error/49476/8 "2021-11-24T11:52:22Z")

</div>

![Capture](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/c/d/cd45d8261987d426cb83646098d71bc33cc6abbd.png)

I have placed a print method into the run method and that block of code does execute. It fails when dispatcher tries to utter the message. Replacing it with your solution was the same problem.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 24, 2021, 11:52am UTC](https://forum.rasa.com/t/video-attachment-error/49476/9 "2021-11-24T11:52:45Z")

</div>

> [@ronankff](#):
>
> concatenate str (not “dict”)

string only…

---

<div class="post-metadata">

**Author:** ![ronankff](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ronankff](https://forum.rasa.com/u/ronankff)\
**Post date:** [November 24, 2021, 11:54am UTC](https://forum.rasa.com/t/video-attachment-error/49476/10 "2021-11-24T11:54:51Z")

</div>

Apologies but I don’t understand. Where am I using a dictionary where there should be a string?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 24, 2021, 11:56am UTC](https://forum.rasa.com/t/video-attachment-error/49476/11 "2021-11-24T11:56:06Z")

</div>

@ronankff Did you do this? 🤔🤔

```auto
class ActionIntoShowVideo(Action):

     def name(self) -> Text:
         return "action_intro_show_video"

     def run(self, dispatcher: CollectingDispatcher,
             tracker: Tracker,
             domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

       
         msg = { "type": "video", "payload": { "title": "Link name", "src": "https://youtu.be/Z6v6Dpt05CA" } }

         dispatcher.utter_message(text="Check this video",attachment=msg)
         
         return []

```

---

<div class="post-metadata">

**Author:** ![ronankff](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ronankff](https://forum.rasa.com/u/ronankff)\
**Post date:** [November 24, 2021, 11:57am UTC](https://forum.rasa.com/t/video-attachment-error/49476/12 "2021-11-24T11:57:33Z")

</div>

Yep

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 24, 2021, 11:59am UTC](https://forum.rasa.com/t/video-attachment-error/49476/13 "2021-11-24T11:59:27Z")

</div>

@ronankff strange man!

---

<div class="post-metadata">

**Author:** ![MelT](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/melt/32/21530_2.png) [@MelT](https://forum.rasa.com/u/MelT)\
**Post date:** [November 11, 2022, 9:41am UTC](https://forum.rasa.com/t/video-attachment-error/49476/14 "2022-11-11T09:41:56Z")

</div>

Hi all, I would like to follow up on this as I get the same error when using RASA 3.1 and also having the attachment within the domain.yml as you declared @nik202It shows correctly in the webchat but not in the shell. However, I need the shell for debugging. Any idea whether this could be the case, that rasa shell specifically cannot handle this attachment?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [November 11, 2022, 8:13pm UTC](https://forum.rasa.com/t/video-attachment-error/49476/15 "2022-11-11T20:13:53Z")

</div>

@MelT attachment meant for the GUI not for shell.
