RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.87k stars 4.63k forks source link

Can not start rasa x, version is None #3604

Closed AlvaroMonteagudo closed 5 years ago

AlvaroMonteagudo commented 5 years ago
**Rasa version**: 1.0.1 **Rasa x version**: 0.19.0 **Python version**: 3.6.4 **Operating system** (windows, osx, ...): Windows **IDE** (in case it matters): PyCharm **Issue**: I have installed rasa x, no problems with that, but when I start it, I have a couple of problems, first of all, you init using the default domain file in the project directory, the thing it's that I got my templates without the label "text", something that works when training but in project_services.py function _templates(...) you got this: ``` templates = domain.get("templates", {}) return [ Template(template=template, content=json.dumps(response), text=response.get("text"), annotator_id=username, annotated_at=time.time(), project_id=project_id) for template, responses in templates.items() for response in responses ] ``` So the text parameter fails when parsing my domain file, of course I fixed this by adding text to my domain file but for big doamins it is such a time-wasting task when trains already works without it. Are you aware of this? Back to the main problem, when I run rasa x I'm getting the next error: ``` Starting Rasa X in local mode... 🚀 Traceback (most recent call last): File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\amonteagudo\PycharmProjects\RasaX\venv\Scripts\rasa.exe\__main__.py", line 9, in File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasa\__main__.py", line 70, in main cmdline_arguments.func(cmdline_arguments) File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasa\cli\x.py", line 243, in rasa_x local.main(args, project_path, args.data, token=rasa_x_token) File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\local.py", line 194, in main session) File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\local.py", line 153, in _initialize_with_local_data model_service.discover_models_on_init() File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\services\model_service.py", line 338, in discover_models_on_init loop.run_until_complete(self._discover_models()) File "C:\Python36\lib\asyncio\base_events.py", line 467, in run_until_complete return future.result() File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\services\model_service.py", line 362, in _discover_models model_version=model_version): File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\services\model_service.py", line 121, in is_model_compatible version.parse(minimum_compatible_version)) File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\packaging\version.py", line 28, in parse return Version(version) File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\packaging\version.py", line 219, in __init__ match = self._regex.search(version) TypeError: expected string or bytes-like object ``` I dig into the trace error and found out that version is None, don't know why, but it is set to None. Why is this? There should be a not None verification somewhere? **Content of configuration file (config.yml)**: ```yml language: es pipeline: supervised_embeddings policies: - name: KerasPolicy batch_size: 50 epochs: 200 max_training_samples: 300 - name: FallbackPolicy fallback_action_name: action_default_fallback - name: MemoizationPolicy ``` **Content of domain file (domain.yml)** (if used & relevant): [domain.txt](https://github.com/RasaHQ/rasa/files/3223586/domain.txt) Great product by the way, seems very promising and thank you in advance Cheers Álvaro
tmbo commented 5 years ago

What does pip show rasa-x yield and how did you install rasa-x?

AlvaroMonteagudo commented 5 years ago

Installed with: pip install rasa-x --extra-index-url https://pypi.rasa.com/simple pip show rasa-x output:

Name: rasa-x
Version: 0.19.0
Summary: Rasa X Community Edition
Home-page: https://rasa.com
Author: Rasa Technologies GmbH
Author-email: hi@rasa.com
License: UNKNOWN
Location: c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages
Requires: pyjwt, sanic-jwt, apscheduler, aiohttp, mixpanel, questionary, python-dateutil, requests, isodate, rasa, jsonschema, simplejson, sanic-cors, SQLAlchemy, pika, sanic
Required-by:
You are using pip version 10.0.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
tmbo commented 5 years ago

Ok, what does pip show rasa and pip show rasa_core yield? something seems to be of with the version Rasa sends to Rasa X when it is started.

tmbo commented 5 years ago

Ah ok, there is an issue with old models. Can you either delete your models folder or move it to a different location? I think there is a model in there which breaks the compatibility check.

tmbo commented 5 years ago

mhm maybe not, looking at the code it might really be due to rasa having an old version, so would be good to see output of pip show rasa

AlvaroMonteagudo commented 5 years ago

I tought about the models too, but since you create one by default I dismiss that option pip show rasa output:

Name: rasa
Version: 1.0.1
Summary: Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
Home-page: https://rasa.com
Author: Rasa Technologies GmbH
Author-email: hi@rasa.com
License: Apache 2.0
Location: c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages
Requires: fbmessenger, pika, pydot, networkx, aiohttp, rasa-sdk, python-socketio, numpy, scipy, apscheduler, fakeredis, python-dateutil, coloredlogs, slackclient, python-telegram-bot, colorclass, sanic-cors, async-generator, pytz, boto3, SQLAlchemy, matplotlib, mat
termostwrapper, tqdm, urllib3, sanic-jwt, attrs, kafka-python, gevent, pymongo, sanic, webexteamssdk, jsonpickle, redis, colorhash, sklearn-crfsuite, questionary, jsonschema, pykwalify, simplejson, scikit-learn, rocketchat-API, scikit-learn, tensorflow, terminaltab
les, ruamel.yaml, twilio, packaging
Required-by: rasa-x

My requirements file generatedby pip freeze is this: requirements.txt

tmbo commented 5 years ago

Okay that looks all good, versions are the correct ones. Can you run the whole thing with --debug and add the created log please? thanks a lot for your help in getting to the bottom of this

AlvaroMonteagudo commented 5 years ago

raxa x --debug log file:

Parameter 'endpoints' not set. Using default location 'endpoints.yml' instead.
validating provided secret
validating keys (if needed)
loading secret and/or keys (if needed)
tmbo commented 5 years ago

Please paste all the output on the command line, including the exception.

AlvaroMonteagudo commented 5 years ago

Sure, sorry, did not understand

(venv) C:\Users\amonteagudo\PycharmProjects\RasaX>rasa x --debug

WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
If you depend on functionality not listed there, please file an issue.

2019-05-28 09:10:51 DEBUG    rasa.cli.utils  - Parameter 'endpoints' not set. Using default location 'endpoints.yml' instead.
Starting Rasa X in local mode... 🚀
2019-05-28 09:10:51 DEBUG    sanic_jwt.configuration  - validating provided secret
2019-05-28 09:10:51 DEBUG    sanic_jwt.configuration  - validating keys (if needed)
2019-05-28 09:10:51 DEBUG    sanic_jwt.configuration  - loading secret and/or keys (if needed)
Traceback (most recent call last):
  File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\amonteagudo\PycharmProjects\RasaX\venv\Scripts\rasa.exe\__main__.py", line 9, in <module>
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasa\__main__.py", line 70, in main
    cmdline_arguments.func(cmdline_arguments)
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasa\cli\x.py", line 243, in rasa_x
    local.main(args, project_path, args.data, token=rasa_x_token)
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\local.py", line 194, in main
    session)
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\local.py", line 153, in _initialize_with_local_data
    model_service.discover_models_on_init()
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\services\model_service.py", line 338, in discover_models_on_init
    loop.run_until_complete(self._discover_models())
  File "C:\Python36\lib\asyncio\base_events.py", line 467, in run_until_complete
    return future.result()
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\services\model_service.py", line 362, in _discover_models
    model_version=model_version):
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\rasax\community\services\model_service.py", line 121, in is_model_compatible
    version.parse(minimum_compatible_version))
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\packaging\version.py", line 28, in parse
    return Version(version)
  File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\packaging\version.py", line 219, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
tmbo commented 5 years ago

Ok, mhm that doesn't show anything interesting. Can you open http://localhost:5005/version while rasa x is running (so basically after the exception is raised - it seems like the server is still running, so this should hopefully work) and paste the response?

AlvaroMonteagudo commented 5 years ago

Well, it stops, I didn't paste it but when the exception is raised it shows:

.
.
.
 File "c:\users\amonteagudo\pycharmprojects\rasax\venv\lib\site-packages\packaging\version.py", line 219, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

(venv) C:\Users\amonteagudo\PycharmProjects\RasaX> <-- forgot this line in my last comment 
AlvaroMonteagudo commented 5 years ago

Any new thoughts? I can't figure out why this is happenning. I will try to create a project without IDE to see if PyCharm is causing the problem

AlvaroMonteagudo commented 5 years ago

Got it working in PyCharm, I don't know what I did, I just created another project, did the very same steps then in the other one but now it worked. I will close this

akelad commented 5 years ago

@tmbo is this still something we need to fix though?

tmbo commented 5 years ago

There is a fix for some part of it in #3678 - there is nothing else to fix atm.

ruiconti commented 5 years ago

I've had the same issue and the exception raised isn't that clarifying. The problem was solved by fixing current user's permissions on sensible directories and files: