Getting a null message from bot emulator (Azure Bot Service)

I’m running rasa v 1.7.0 (via rasa run) locally on a windows laptop. When I test it with ngrok and the emulator from Azure Bot service, I get the following error message:

rasa\core\processor.py", line 428, in _parse_message if message.text.startswith(INTENT_MESSAGE_PREFIX): AttributeError: ‘NoneType’ object has no attribute ‘startswith’ ERROR rasa.core.channels.channel - An exception occured while handling user message ‘None’.

I have the following entries in credentials.yml

rasa: url: “http://localhost:5002/api

botframework: app_id: “xxxxxx” app_password: “”

I obtained the app_id from the Bot service and I’m not using any password as I cannot create one in the bot service.

Can anyone please help?

What exact command are you executing? Just rasa run? Is the error occurring immediately or are you sending a message first before it fails?

Can you please run the assistant in debug mode --debug and past the complete log output here? Thanks.

Thanks for your response Tanja.

When I run the command rasa run --debug

I get this output:

2020-06-04 21:23:52 DEBUG    rasa.cli.utils  - Parameter 'endpoints' not set. Us
ing default location 'endpoints.yml' instead.
2020-06-04 21:23:52 DEBUG    rasa.cli.utils  - Parameter 'credentials' not set.
Using default location 'credentials.yml' instead.
2020-06-04 21:23:52 DEBUG    rasa.model  - Extracted model to 'C:\A
ppData\Local\Temp\tmpi0pkg10f'.
2020-06-04 21:23:53 DEBUG    sanic.root  - CORS: Configuring CORS with resources
: {'/*': {'origins': [''], 'methods': 'DELETE, GET, HEAD, OPTIONS, PATCH, POST,
PUT', 'allow_headers': ['.*'], 'expose_headers': None, 'supports_credentials': T
rue, 'max_age': None, 'send_wildcard': False, 'automatic_options': True, 'vary_h
eader': True, 'resources': {'/*': {'origins': ''}}, 'intercept_exceptions': True
, 'always_send': True}}
2020-06-04 21:23:53 DEBUG    rasa.core.utils  - Available web server routes:
/webhooks/botframework                             GET
  botframework_webhook.health
/webhooks/botframework/webhook                     POST
  botframework_webhook.webhook
/webhooks/rasa                                     GET
  custom_webhook_RasaChatInput.health
/webhooks/rasa/webhook                             POST
  custom_webhook_RasaChatInput.receive
/webhooks/rest                                     GET
  custom_webhook_RestInput.health
/webhooks/rest/webhook                             POST
  custom_webhook_RestInput.receive
/                                                  GET
  hello
2020-06-04 21:23:53 INFO     root  - Starting Rasa server on http://localhost:50
05
2020-06-04 21:23:53 DEBUG    rasa.core.utils  - Using the default number of Sani
c workers (1).
2020-06-04 21:23:53 INFO     root  - Enabling coroutine debugging. Loop id 44965
2936.
2020-06-04 21:23:54 DEBUG    rasa.model  - Extracted model to 'C:AppData\Local\Temp\tmpw8uz0x8a'.
2020-06-04 21:23:59 INFO     absl  - Entry Point [tensor2tensor.envs.tic_tac_toe
_env:TicTacToeEnv] registered with id [T2TEnv-TicTacToeEnv-v0]
c:\programdata\miniconda3\envs\rasa\lib\site-packages\thinc\neural\_custom_kerne
ls.py:36: ResourceWarning: unclosed file <_io.TextIOWrapper name='c:\\programdat
a\\miniconda3\\envs\\rasa\\lib\\site-packages\\thinc\\neural\\_custom_kernels.cu
' mode='r' encoding='utf8'>
  SRC = (PWD / "_custom_kernels.cu").open("r", encoding="utf8").read()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
c:\programdata\miniconda3\envs\rasa\lib\site-packages\thinc\neural\_custom_kerne
ls.py:39: ResourceWarning: unclosed file <_io.TextIOWrapper name='c:\\programdat
a\\miniconda3\\envs\\rasa\\lib\\site-packages\\thinc\\neural\\_murmur3.cu' mode=
'r' encoding='utf8'>
  MMH_SRC = (PWD / "_murmur3.cu").open("r", encoding="utf8").read()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
2020-06-04 21:24:01 DEBUG    rasa.core.tracker_store  - Connected to InMemoryTra
ckerStore.
2020-06-04 21:24:01 DEBUG    rasa.core.lock_store  - Connected to lock store 'In
MemoryLockStore'.
2020-06-04 21:24:01 DEBUG    rasa.model  - Extracted model to 'C:\AppData\Local\Temp\tmp36v7com4'.
2020-06-04 21:24:01 DEBUG    pykwalify.compat  - Using yaml library: c:\programdata\miniconda3\envs\rasa\lib\site-packages

\ruamel\yaml\__init__.py
2020-06-04 21:24:03 DEBUG    rasa.core.nlg.generator  - Instantiated NLG to 'Tem
platedNaturalLanguageGenerator'.

When I type “hello” in the bot simulator, I get this error message:

2020-06-04 21:32:26 DEBUG    rasa.core.tracker_store  - Creating a new tracker f
or id 'default'.
2020-06-04 21:32:26 DEBUG    rasa.core.processor  - Starting a new session for c
onversation ID 'default'.
2020-06-04 21:32:26 DEBUG    rasa.core.processor  - Action 'action_session_start
' ended with events '[<rasa.core.events.SessionStarted object at 0x000000001AD96
F08>, <rasa.core.events.ActionExecuted object at 0x000000001AD96FC8>]'.
2020-06-04 21:32:26 DEBUG    rasa.core.processor  - Current slot values:
        assignment_num: None
        name: None
2020-06-04 21:32:26 DEBUG    rasa.core.lock_store  - Deleted lock for conversati
on 'default'.
2020-06-04 21:32:26 ERROR    rasa.core.channels.channel  - An exception occured
while handling user message 'None'.
Traceback (most recent call last):
  File "c:\programdata\miniconda3\envs\rasa\lib\site-packages\rasa\core\channels
\channel.py", line 487, in receive
    metadata=metadata,
  File "c:\programdata\miniconda3\envs\rasa\lib\site-packages\rasa\core\channels
\channel.py", line 83, in handler
    await app.agent.handle_message(*args, **kwargs)
  File "c:\programdata\miniconda3\envs\rasa\lib\site-packages\rasa\core\agent.py
", line 486, in handle_message
    return await processor.handle_message(message)
  File "c:\programdata\miniconda3\envs\rasa\lib\site-packages\rasa\core\processo
r.py", line 94, in handle_message
    tracker = await self.log_message(message, should_save_tracker=False)
  File "c:\programdata\miniconda3\envs\rasa\lib\site-packages\rasa\core\processo
r.py", line 223, in log_message
    await self._handle_message_with_tracker(message, tracker)
  File "c:\programdata\miniconda3\envs\rasa\lib\site-packages\rasa\core\processo
r.py", line 455, in _handle_message_with_tracker
    parse_data = await self._parse_message(message, tracker)
  File "c:\programdata\miniconda3\envs\rasa\lib\site-packages\rasa\core\processo
r.py", line 428, in _parse_message
    if message.text.startswith(INTENT_MESSAGE_PREFIX):
AttributeError: 'NoneType' object has no attribute 'startswith'

Thanks for your help.

Hi @fcheong,

I think this might be a bug in the channel :grimacing: . Could you please create a bug report on GitHub?

Done! Thanks.

1 Like