TypeError: type object argument after ** must be a mapping, not str

Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/shell.py", line 101, in shell
    rasa.cli.run.run(args)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/run.py", line 104, in run
    endpoints = AvailableEndpoints.read_endpoints(args.endpoints)
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/utils.py", line 394, in read_endpoints
    action = read_endpoint_config(endpoint_file, endpoint_type="action_endpoint")
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/endpoints.py", line 29, in read_endpoint_config
    return EndpointConfig.from_dict(content[endpoint_type])
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/endpoints.py", line 154, in from_dict
    return EndpointConfig(**data)
TypeError: type object argument after ** must be a mapping, not str

I tried to run this command - “rasa shell --debug”, and getting this error.

Hi there, can you post your endpoints.yml please?

try to run rasa shell --endpoints endpoints.yml --debug and make sur that your rasa server run on another terminal " rasa run actions"

I restarted my editor, and it again started working without any changes, I don’t know how this occured, and this is the 3rd time I faced this issue.

That’s really strange, so it’s probably an editor problem somehow? What editor do you use?

I’m using Visual Studio Code. This same error I got earlier also.

@Mayankgbrc @erohmensing
I am facing this same issue. I am following Rasa Master Class #6 and have set up and started the action server. The server is started and the action function is registered at this point the error occurs.

TypeError: type object argument after ** must be a mapping, not NoneType. I am using PyCharm as my editor, if that matters.

Any help / direction would be much appreciated.

VN

Same problem here. But msg i’m getting is:

File “c:\python37\lib\site-packages\rasa\utils\endpoints.py”, line 154, in from_dict return EndpointConfig(**data) TypeError: type object argument after ** must be a mapping, not NoneType

@Jmg007 @Mayankgbrc @erohmensing I was able to resolve this issue after further search on Stack Overflow. Issue seems to be the Sanic Package version 19.12.2 is not compatible with Rasa. I had to downgrade the Sanic from version 19.12.2 to 19.9.0.

reference:

  1. Rasa Shell error following tutorial · Issue #5019 · RasaHQ/rasa · GitHub
action_endpoint:
  url: "http://localhost:5055/webhook"

there may be some typo mistake. copy and paste the above code. @Mayankgbrc

1 Like

@sushilr007 This solved my issue thanks!, apparently wrong identation can cause this error as well.