Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Tried to set non existent slot" error persists after deleting all instances of slots and retraining #3294

Closed
anoop2503 opened this issue Apr 22, 2019 · 47 comments
Labels
status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question

Comments

@anoop2503
Copy link

Rasa version:
rasa-core==0.13.7
rasa-core-sdk==0.12.2
rasa-nlu==0.14.6

Python version: Python 3.6.7

Operating system (windows, osx, ...):
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

Issue: The slots which were used for previous experiments are not resetting even after removing these slots from all files (nlu.md, stories.md, domain.yml and actions.py)
I tried deleting the entire model directory and trained the models again. but still it showing the errors with previously used slot. Please find the error message below.

2019-04-22 09:56:44 ERROR    rasa_core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your s
lots to your domain file.
2019-04-22 09:56:44 ERROR    rasa_core.trackers  - Tried to set non existent slot 'platform'. Make sure you added all your slot
s to your domain file.

I just executed a grep command from my project directory to make sure these slots are not using anymore.

~/project/slackbot$ grep "environment" * -R

Notebook/Conversational_Chatbot.ipynb:        "# In your environment run:\n",
(sample_bot_env) ubuntu@ip-172-31-21-57:~/project/slackbot$ grep "platform" * -R
Notebook/Conversational_Chatbot.ipynb:            "Requirement already satisfied, skipping upgrade: greenlet>=0.4.14; platform_python_implementation == \"CPython\" in /usr/local/lib/python3.6/dist-packages (from gevent->rasa_nlu[spacy]) (0.4.15)\n",
credentials.yml:# This file contains the credentials for the voice & chat platforms
nohup.out:2019-04-03 09:58:46.340534: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

Kindly note that I had used these slots before (not in the current stories) for doing some experiments.

Thank you,

@anoop2503
Copy link
Author

anoop2503 commented Apr 23, 2019

Any update on this please?

It seems like, I am getting these errors when I remove an already used slot/entity.
Steps to reproduce:

  • Create an intent with an entity
  • Train the model
  • Remove that intent and entity details from all files.
  • Now train again
  • Try to talk to agent, you will see the error related to the old entity/slot (which we removed.)

I am getting this error even in the rasa master branch also.

2019-04-23 17:54:18 ERROR    rasa.core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:18 ERROR    rasa.core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:18 ERROR    rasa.core.trackers  - Tried to set non existent slot 'requested_slot'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:18 ERROR    rasa.core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:18 ERROR    rasa.core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:18 ERROR    rasa.core.trackers  - Tried to set non existent slot 'requested_slot'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:18 ERROR    rasa.core.trackers  - Tried to set non existent slot 'greet'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:18 ERROR    rasa.core.trackers  - Tried to set non existent slot 'greet'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:19 ERROR    rasa.core.trackers  - Tried to set non existent slot 'greet'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:19 ERROR    rasa.core.trackers  - Tried to set non existent slot 'greet'. Make sure you added all your slots to your domain file.
2019-04-23 17:54:19 ERROR    rasa.core.trackers  - Tried to set non existent slot 'greet'. Make sure you added all your slots to your domain file

@anoop2503
Copy link
Author

I tried again after removing the current model directory and trained again, but still getting these errors.
Is this some this related to the caching issue? I tried even after clearing PageCache, dentries and inodes. But there is no change, still getting the errors.

@akelad
Copy link
Contributor

akelad commented Apr 24, 2019

Thanks for raising this issue, @erohmensing will get back to you about it soon.

@anoop2503
Copy link
Author

I think I found the culprit. I was using the MongoTrackerStore to store the conversation. When i removed the collection from mongo db, all the unwanted track history (which were used before) disappeared.

But, why this is making an issue? That mean's, we need to clear the stored collection from mongodb every time when we change/rename an existing entity/slot value? Is there any proper way to handle this?

@anoop2503
Copy link
Author

ah.. I am sorry. It started showing the same errors again after some time. Not sure where it is coming from now :(

@erohmensing
Copy link
Contributor

Hm this is really strange. I'll look into it and see if I can replicate it. How are you talking to the agent -- command line, python API, rest API? Could it be the case that you're re-training your agent but haven't re-instantiated it first?

@anoop2503
Copy link
Author

Hey @erohmensing, I created the bot for slack integration and using webhook mechanism (by enabling ngrok) to communicate to the rasa.

@erohmensing
Copy link
Contributor

Did you also restart your action server after updating actions.py?

@akelad akelad added the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Apr 25, 2019
@anoop2503
Copy link
Author

anoop2503 commented Apr 25, 2019

yes @erohmensing. I restarted the rasa service, actions after the code change.

In fact, I did the following things

  • Deleted my virtual environment,
  • Deleted the mongo collection
  • Cleared memory buff/cache
  • Deleted the model directory
  • Deleted the temp files stored in /tmp directory
  • Created a new virtual environment
  • Re-installed the rasa packages
  • Trained the models again
  • Finally, restarted the rasa service and actions.

But, still I am getting those errors. Not sure what else I can do in my server LOL.

@no-response no-response bot removed the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label Apr 25, 2019
@erohmensing
Copy link
Contributor

Did you factory reset your computer? 😄Just kidding. If you add a new slot and try to set it via a custom action does it successfully do that?

@anoop2503
Copy link
Author

😂😂😂

Yes @erohmensing, fortunately the new slot is working fine. Only the logs showing these annoying messages.

@erohmensing
Copy link
Contributor

I know you've restarted about everything so the answer is probably yes, but have you restarted the kernel and cleared the output of your ipy notebook?

@erohmensing erohmensing changed the title Old slot values in tracker is not resetting even after retrain the models "Tried to set non existent slot" error persists after deleting all instances of slots and retraining Apr 25, 2019
@erohmensing
Copy link
Contributor

When in the conversation does the error show up? Does it also appear when running the bot in the command line?

@anoop2503
Copy link
Author

anoop2503 commented Apr 26, 2019

Hey @erohmensing, there is a good news.

I am using an aws EC2 instance. Today I tired all the above things (delete all the tmp, files, models, virtual environment etc), in addition to that I RESTARTED my ec2 instance and reinstalled everything. Now those unwanted logs are disappeared. So, how do we manage this case? Restarting the machine will not be recommended, if you ask me :)

Answer for your next question: The error was showing up when sending the message from slack only. I haven't tried that through the command line.

@anoop2503
Copy link
Author

I don't know what is happening, but it starts showing up those logs again after some time. So, even the server restart didn't make any difference I think.

May be, I had not tried those stories (which were using these slots before) after restarting the instance and now started showing them, since I tried those same conversations from slack now? Strange.

2019-04-26 08:47:06 ERROR    rasa_core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.
2019-04-26 08:47:06 ERROR    rasa_core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.
2019-04-26 08:47:06 ERROR    rasa_core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.
2019-04-26 08:47:06 ERROR    rasa_core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.
2019-04-26 08:47:06 ERROR    rasa_core.trackers  - Tried to set non existent slot 'environment'. Make sure you added all your slots to your domain file.

@erohmensing
Copy link
Contributor

So then it only happens when you go down the paths for those stories that used to use the slots? Seems like it's a story issue then. I know grep should have pulled everything, but can you open the files and manually search for any instances of the slots in the stories?

@anoop2503
Copy link
Author

Hi @erohmensing, I terminated my old EC2 instance and started a new one. Now I can't see that logs. But, I checked it manually in my stories.md file and confirmed there is no slot added with name "environment".

@anoop2503
Copy link
Author

anoop2503 commented Apr 26, 2019

Let me play with my new EC2 instance and will update this ticket, if I get the same issue in the new instance too.

@erohmensing
Copy link
Contributor

I did finally run into this issue! For me it was because I didn't restart the action server.

restarted the rasa service, actions after the code change.

Are you running your action server and core server in the same terminal? (like with a make command that runs both together?) I find sometimes that in that case I run into the issue where I seemingly shut down both servers but don't actually shut down the action server. Then i have to kill the port manually to really restart it.

Let me know if you run into the issue on your new instance.

@erohmensing erohmensing added the status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question label May 5, 2019
@no-response
Copy link

no-response bot commented May 19, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. Without this, we don't have enough information to help you. Please comment below with the requested information if you still need help.

@no-response no-response bot closed this as completed May 19, 2019
@sonakshisaxena1
Copy link

Hi @erohmensing
I am facing a similar issue.
I have no slots that are undefined in the domain.yml and I have ensured that the action server is restarted.
Furthermore, the form action was working smoothly earlier, and suddenly these errors started showing up despite of making no changes to the code.

@erohmensing
Copy link
Contributor

Hi @sonakshisaxena1, Yes, we've discovered that on the latest version too. The relevant issue is here: #3803
Someone is already working on a fix.

@sonakshisaxena1
Copy link

Thanks for the information! @erohmensing
Do you happen to know a workaround for this (for the time being)? Actually, I had a project up and running when this suddenly popped up. And I have to submit it by the end of the week.

@erohmensing
Copy link
Contributor

Hm, did you change your rasa version at all? There shouldn't be a reason why it showed up with no change to the code, since everything is local and doesn't pull any changes from us

@sonakshisaxena1
Copy link

I didn’t change the rasa version at all. I had made a copy of the main project and tried adding a slot to the copied project. The errors initially showed up only on the copied project and not on running the main project. After a day or two, I changed the location of my main project. On running it, the same errors started showing up.

@erohmensing
Copy link
Contributor

Did you retrain the model with the copy after moving it?

@sonakshisaxena1
Copy link

No, I didn’t retrain it with copy.
Infact I tried running the previously trained models too in the interactive (the ones which were working fine earlier) still the errors are there

@erohmensing
Copy link
Contributor

Hm okay. At this point I think the only thing to try is patching your local version with the fix that's not merged yet: https://github.com/RasaHQ/rasa/pull/3897/files

In this case you'd only have to update your rasa/core/trackers.py file. See if that helps

@dptelecom
Copy link

Hi i have the same issue i renamed a slot and did it every where.
also search the whole project folder nowhere a trace find of the slot name and i get this now every time

Screen Shot 2019-07-06 at 01 32 12

@erohmensing
Copy link
Contributor

@dptelecom have you

  1. made sure to also re-start your action server
  2. Tried using the local patch I mentioned above?

@dptelecom
Copy link

dptelecom commented Jul 6, 2019

@erohmensing
Hi i did a re-start of action server,
i also deleted the old trained model.

i just added the 2 line to my:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rasa_core/trackers.py

Screen Shot 2019-07-06 at 20 51 51

after that i did a re-train off the model.
but if i run:
rasa x --endpoints endpoints.yml --cors "*" -v
i still get this?
Screen Shot 2019-07-06 at 20 56 32

what am i doing wrong here?

@TQuy
Copy link

TQuy commented Jul 22, 2019

I also face the same issue, I have deleted the price_form from every file in the project directory, and I also change the data\nlu.md file. Howeverm when I run rasa train nlu, it shows the warning about the old data, and when I run rasa train , it keep referring to the old price_form that I have all deleted

@erohmensing
Copy link
Contributor

Hi @TQuy, i believe this should have been fixed in 1.1.5. which version are you running?

@TQuy
Copy link

TQuy commented Jul 22, 2019

mine is rasa 1.1.6

@TQuy
Copy link

TQuy commented Jul 22, 2019

It temporarily disappear whenever I copy all the file to new directory

@imLew
Copy link
Contributor

imLew commented Jul 22, 2019

@dptelecom are you still experiencing this issue?
@TQuy can you please provide more details on how you issue may be reproduced?
If possible please try to reproduce it with the formbot example in our repo to verify the issue.

@TQuy
Copy link

TQuy commented Jul 23, 2019

I've tried to run the formbot several times but it always shows the error when I answer the question "How many people"

Failed to extract slot num_people with action restaurant_form
I have already run the command rasa run actions on different cm window, which point to the formbot directory. In addition, there are the warnings about duckling which I don't want to install

@erohmensing
Copy link
Contributor

In addition, there are the warnings about duckling which I don't want to install

Duckling is used to extract numbers, you will always get that error as well as Failed to extract slot num_people if you don't install it

@TQuy
Copy link

TQuy commented Jul 23, 2019

thanks for your help, it seems like the problem about referring old data has stopped appearing

@ankan97dutta
Copy link

Hi there, it seems that this error is occurring due to inconsistency in your database .db file.

@TQuy
Copy link

TQuy commented Aug 6, 2019

Hi there, it seems that this error is occurring due to inconsistency in your database .db file.

thank you, I realized that and it solves the problem

@sibbsnb
Copy link
Contributor

sibbsnb commented Apr 27, 2020

for me same issue is happening when i remove a slot

@marcco411
Copy link

same here

@erohmensing
Copy link
Contributor

@sibbsnb @marcco411 this issue is from before Rasa 1.0, please open a new issue with all of the relevant information if you still think there is a bug

@leenaborasahaj
Copy link

If domain file is correct... then you possibly you might be missing out on retraining and starting rasa server again and not just rasa action server

@PriyaASiva
Copy link

I am too facing the same issue when migrated from Rasa 2.x to RASA 3.0 Any fix for this?

@usholanb
Copy link

usholanb commented Jun 7, 2022

I found a fix for my case of this error

I encountered this bug :

"ERROR rasa.shared.core.trackers - Tried to set non existent slot 'requested_slot'. Make sure you added all your slots to your domain file."

because I removed the slot from domain(in purpose) and forgot to remove it's mentions in data/stories.yml

Just do grep -rnw '/path/to/somewhere/' -e 'that_slot_name_of_yours' .
It will show all the files that still contain that slot. Remove the code that mentions that slot and train again

Removed .rasa/cache and models/* files first just in case before training

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:more-details-needed Waiting for the user to provide more details / stacktraces / answer a question
Projects
None yet
Development

No branches or pull requests