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.

'NoneType' object has no attribute 'handle_message'

See original GitHub issue

Rasa Core version: 0.12.3 RASA NLU :: 0.13.8

Python version: 3.6.1

Operating system (windows, osx, …):

Issue: ‘NoneType’ object has no attribute ‘handle_message’

Below is code snippet for server.py file which is causing an error ::

`@app.route('/api/v1/<sender_id>/respond', methods=['GET', 'POST'])

    def respond(self, request, sender_id):
        request.setHeader('Content-Type', 'application/json')
        request.setHeader('Access-Control-Allow-Origin', '*')
        
        request_params = request_parameters(request)
        print("=========Request PARam================: ",request_params)
        if 'query' in request_params:
        	message = request_params.pop('query')
        elif 'q' in request_params:
        	message = request_params.pop('q')
        else:
        	request.setResponseCode(400)
        	return json.dumps({"error": "Invalid parse parameter specified"})
        try:
            out = CollectingOutputChannel()
            print("***********", message, "====", out, "====", sender_id)
            response = self.agent.handle_message(message, output_channel=out, sender_id=sender_id) #response = UserMessage(message, out, sender_id)
            #processor = self.agent._create_processor()
            #response = processor.handle_message(UserMessage(message, out, sender_id))
            print("==UserMessage==", response.__dict__)
            request.setResponseCode(200)
            print("TRY: " , response)
            return json.dumps(response)
        except Exception as e:
            request.setResponseCode(500)
            logger.error("Caught an exception during parse: {}".format(e), exc_info=1)
            return json.dumps({"error": "{}".format(e)})
		

Below is the error screenshot error_feb11 2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Pras-commitscommented, Feb 13, 2019

Hi,I created a weatherbot on version 7 of RASA.Everything is perfectly fine.However,I happened to upgrade RASA to version 12,after which I’m getting empty response from this agent.

The code snippet in my previous reply is from server.py file

The pieces of code which doesnot contain “”"resp = agent.handle_message(“hello”) “” are giving me the response properly. Im not able to figure out why there is a problem with agent.handle_message()

Other observation is that,the code which contains agent.handle_message() ,which is giving empty response on version 12 of RASA is giving the proper response on version 7 of RASA.

Ive upgraded RASA from version 7 to version 12 based on @JustinaPetr tutorial on weatherbot using latest version of RASA.Here is the link :: https://github.com/JustinaPetr/Weatherbot_Tutorial/tree/master/Full Code [Latest release of Rasa NLU and Rasa Core]

@wochinge @akelad @JustinaPetr @tmbo Please help me in resolving this issue…I was trying to resolve this since past few days…Tried posting it in RASA forums but no response …

0reactions
Pras-commitscommented, Feb 18, 2019

@wochinge , My issue is not solved… 1.I want to migrate from version 7 to version 13 of RASA which less changes possible.So kept the channel as it is. 2.I happened to re-train NLU.I have close to 50 examples for the 3 intents i used in my bot. 3.I happened to resolve a minor issue(User_id not getting captured in the slot) caused due to lack of proper training.

My endpoint server is up and running .The bot works just fine from the command line. I…But im getting empty response when im trying to hit it through postman… Can someone help me out with this… Here is my error_screenshot in postman:

error_postman

Read more comments on GitHub >

github_iconTop Results From Across the Web

'NoneType' object has no attribute 'send' even though it should ...
What's happening is jeneral_channel = client.get_channel(...) is resulting in jeneral_channel being a None object because client.get_channel ...
Read more >
Failed to handle message, error: 'NoneType' object has no ...
Failed to handle message, error: 'NoneType' object has no attribute 'get', Line: 54 · Plugins Sécurité · plugin-dahuavto.
Read more >
AttributeError: 'NoneType' object has no attribute 'sendMessage'
AttributeError : 'NoneType' object has no attribute 'sendMessage' I am getting this error message, what is the problem exactly? Tagged:.
Read more >
AttributeError: 'NoneType' object has no attribute 'call' on ...
Hello, I'm at a loss to explain why this flow fails and succeeds at the same time… It only consists in triggering a...
Read more >
AttributeError: 'NoneType' object has no attribute 'event' #553
I get the AttributeError: 'NoneType' object has no attribute 'event' error when making future dataframe. It's probably something I overlooked but assistance ...
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