RasaHQ / pokedex-demo

Rasa Demo for a digital assistant for pokemon
Apache License 2.0
35 stars 39 forks source link

File name too long error while training #23

Open AkshayBhimani opened 3 years ago

AkshayBhimani commented 3 years ago

Rasa version: 2.5.1

Rasa SDK version (if used & relevant): 2.5.0

Python version: Python 3.8.5

Operating system (windows, osx, ...): Ubuntu(Linux)

Bug Getting file name too long error while traing Rasa .

Error :

OSError: [Errno 36] File name too long: 'bulbasaur\nivysaur\nvenusaur\ncharmander\ncharmeleon\ncharizard\nsquirtle\nwartortle\nblastoise\ncaterpie\nmetapod\nbutterfree\nweedle\nkakuna\nbeedrill\npidgey\npidgeotto\npidgeot\nrattata\nraticate\nspearow\nfearow\nekans\narbok\npikachu\nraichu\nsandshrew\nsandslash\nnidorina\nnidoqueen\nnidorino\nnidoking\nclefairy\nclefable\nvulpix\nninetales\njigglypuff\nwigglytuff\nzubat\ngolbat\noddish\ngloom\nvileplume\nparas\nparasect\nvenonat\nvenomoth\ndiglett\ndugtrio\nmeowth\npersian\npsyduck\ngolduck\nmankey\nprimeape\ngrowlithe\narcanine\npoliwag\npoliwhirl\npoliwrath\nabra\nkadabra\nalakazam\nmachop\nmachoke\nmachamp\nbellsprout\nweepinbell\nvictreebel\ntentacool\ntentacruel\ngeodude\ngraveler\ngolem\nponyta\nrapidash\nslowpoke\nslowbro\nmagnemite\nmagneton\ndoduo\ndodrio\nseel\ndewgong\ngrimer\nmuk\nshellder\ncloyster\ngastly\nhaunter\ngengar\nonix\ndrowzee\nhypno\nkrabby\nkingler\nvoltorb\nelectrode\nexeggcute\nexeggutor\ncubone\nmarowak\nhitmonlee\nhitmonchan\nlickitung\nkoffing\nweezing\nrhyhorn\nrhydon\nchansey\ntangela\nkangaskhan\nhorsea\nseadra\ngoldeen\nseaking\ns ..... 

basically its having issue with file named pokenames.txt in data directory

Steps I have followed To install rasa pip install rasa

To train model rasa train

Whole Error with Traceback :

2021-05-04 18:01:34 INFO     rasa.shared.utils.validation  - The 'version' key is missing in the training data file /mnt/sda7/6thSem/NLP/final/rasaa/pokedex-demo/domain.yml. Rasa Open Source will read the file as a version '2.0' file. See https://rasa.com/docs/rasa/training-data-format.
2021-05-04 18:01:34 WARNING  rasa.shared.core.domain  - You are using an experiential feature: Action 'action_query_knowledge_base'!
/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/shared/nlu/training_data/formats/markdown.py:56: FutureWarning: NLU data in Markdown format is deprecated and will be removed in Rasa Open Source 3.0.0. Please convert your Markdown NLU data to the new YAML training data format.
  rasa.shared.utils.io.raise_deprecation_warning(
/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/shared/utils/io.py:97: UserWarning: Action 'utter_faq' is listed as a response action in the domain file, but there is no matching response defined. Please check your domain.
  More info at https://rasa.com/docs/rasa/responses
2021-05-04 18:01:34 INFO     rasa.model  - Data (messages) for NLU model section changed.
Traceback (most recent call last):
  File "/home/akshay/.virtualenvs/rasaChat/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/__main__.py", line 117, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/cli/train.py", line 59, in <lambda>
    train_parser.set_defaults(func=lambda args: run_training(args, can_exit=True))
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/cli/train.py", line 91, in run_training
    training_result = train_all(
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/api.py", line 109, in train
    return rasa.utils.common.run_in_loop(
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/utils/common.py", line 310, in run_in_loop
    result = loop.run_until_complete(f)
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/model_training.py", line 108, in train_async
    return await _train_async_internal(
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/model_training.py", line 272, in _train_async_internal
    new_fingerprint = await model.model_fingerprint(file_importer)
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/model.py", line 364, in model_fingerprint
    FINGERPRINT_NLU_DATA_KEY: nlu_data.fingerprint(),
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/shared/nlu/training_data/training_data.py", line 105, in fingerprint
    "lookup_tables": [
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/shared/nlu/training_data/training_data.py", line 106, in <listcomp>
    self._load_lookup_table(table) for table in self.lookup_tables
  File "/home/akshay/.virtualenvs/rasaChat/lib/python3.8/site-packages/rasa/shared/nlu/training_data/training_data.py", line 82, in _load_lookup_table
    if Path(potential_file).is_file():
  File "/usr/lib/python3.8/pathlib.py", line 1420, in is_file
    return S_ISREG(self.stat().st_mode)
  File "/usr/lib/python3.8/pathlib.py", line 1194, in stat
    return self._accessor.stat(self)
OSError: [Errno 36] File name too long: 'bulbasaur\nivysaur\nvenusaur\ncharmander\ncharmeleon\ncharizard\nsquirtle\nwartortle\nblastoise\ncaterpie\nmetapod\nbutterfree\nweedle\nkakuna\nbeedrill\npidgey\npidgeotto\npidgeot\nrattata\nraticate\nspearow\nfearow\nekans\narbok\npikachu\nraichu\nsandshrew\nsandslash\nnidorina\nnidoqueen\nnidorino\nnidoking\nclefairy\nclefable\nvulpix\nninetales\njigglypuff\nwigglytuff\nzubat\ngolbat\noddish\ngloom\nvileplume\nparas\nparasect\nvenonat\nvenomoth\ndiglett\ndugtrio\nmeowth\npersian\npsyduck\ngolduck\nmankey\nprimeape\ngrowlithe\narcanine\npoliwag\npoliwhirl\npoliwrath\nabra\nkadabra\nalakazam\nmachop\nmachoke\nmachamp\nbellsprout\nweepinbell\nvictreebel\ntentacool\ntentacruel\ngeodude\ngraveler\ngolem\nponyta\nrapidash\nslowpoke\nslowbro\nmagnemite\nmagneton\ndoduo\ndodrio\nseel\ndewgong\ngrimer\nmuk\nshellder\ncloyster\ngastly\nhaunter\ngengar\nonix\ndrowzee\nhypno\nkrabby\nkingler\nvoltorb\nelectrode\nexeggcute\nexeggutor\ncubone\nmarowak\nhitmonlee\nhitmonchan\nlickitung\nkoffing\nweezing\nrhyhorn\nrhydon\nchansey\ntangela\nkangaskhan\nhorsea\nseadra\ngoldeen\nseaking\nstaryu\nstarmie\nscyther\njynx\nelectabuzz\nmagmar\npinsir\ntauros\nmagikarp\ngyarados\nlapras\nditto\neevee\nvaporeon\njolteon\nflareon\nporygon\nomanyte\nomastar\nkabuto\nkabutops\naerodactyl\nsnorlax\narticuno\nzapdos\nmoltres\ndratini\ndragonair\ndragonite\nmewtwo\nmew\nchikorita\nbayleef\nmeganium\ncyndaquil\nquilava\ntyphlosion\ntotodile\ncroconaw\nferaligatr\nsentret\nfurret\nhoothoot\nnoctowl\nledyba\nledian\nspinarak\nariados\ncrobat\nchinchou\nlanturn\npichu\ncleffa\nigglybuff\ntogepi\ntogetic\nnatu\nxatu\nmareep\nflaaffy\nampharos\nbellossom\nmarill\nazumarill\nsudowoodo\npolitoed\nhoppip\nskiploom\njumpluff\naipom\nsunkern\nsunflora\nyanma\nwooper\nquagsire\nespeon\numbreon\nmurkrow\nslowking\nmisdreavus\nunown\nwobbuffet\ngirafarig\npineco\nforretress\ndunsparce\ngligar\nsteelix\nsnubbull\ngranbull\nqwilfish\nscizor\nshuckle\nheracross\nsneasel\nteddiursa\nursaring\nslugma\nmagcargo\nswinub\npiloswine\ncorsola\nremoraid\noctillery\ndelibird\nmantine\nskarmory\nhoundour\nhoundoom\nkingdra\nphanpy\ndonphan\nporygon2\nstantler\nsmeargle\ntyrogue\nhitmontop\nsmoochum\nelekid\nmagby\nmiltank\nblissey\nraikou\nentei\nsuicune\nlarvitar\npupitar\ntyranitar\nlugia\nho-oh\ncelebi\ntreecko\ngrovyle\nsceptile\ntorchic\ncombusken\nblaziken\nmudkip\nmarshtomp\nswampert\npoochyena\nmightyena\nzigzagoon\nlinoone\nwurmple\nsilcoon\nbeautifly\ncascoon\ndustox\nlotad\nlombre\nludicolo\nseedot\nnuzleaf\nshiftry\ntaillow\nswellow\nwingull\npelipper\nralts\nkirlia\ngardevoir\nsurskit\nmasquerain\nshroomish\nbreloom\nslakoth\nvigoroth\nslaking\nnincada\nninjask\nshedinja\nwhismur\nloudred\nexploud\nmakuhita\nhariyama\nazurill\nnosepass\nskitty\ndelcatty\nsableye\nmawile\naron\nlairon\naggron\nmeditite\nmedicham\nelectrike\nmanectric\nplusle\nminun\nvolbeat\nillumise\nroselia\ngulpin\nswalot\ncarvanha\nsharpedo\nwailmer\nwailord\nnumel\ncamerupt\ntorkoal\nspoink\ngrumpig\nspinda\ntrapinch\nvibrava\nflygon\ncacnea\ncacturne\nswablu\naltaria\nzangoose\nseviper\nlunatone\nsolrock\nbarboach\nwhiscash\ncorphish\ncrawdaunt\nbaltoy\nclaydol\nlileep\ncradily\nanorith\narmaldo\nfeebas\nmilotic\ncastform\nkecleon\nshuppet\nbanette\nduskull\ndusclops\ntropius\nchimecho\nabsol\nwynaut\nsnorunt\nglalie\nspheal\nsealeo\nwalrein\nclamperl\nhuntail\ngorebyss\nrelicanth\nluvdisc\nbagon\nshelgon\nsalamence\nbeldum\nmetang\nmetagross\nregirock\nregice\nregisteel\nlatias\nlatios\nkyogre\ngroudon\nrayquaza\njirachi\nturtwig\ngrotle\ntorterra\nchimchar\nmonferno\ninfernape\npiplup\nprinplup\nempoleon\nstarly\nstaravia\nstaraptor\nbidoof\nbibarel\nkricketot\nkricketune\nshinx\nluxio\nluxray\nbudew\nroserade\ncranidos\nrampardos\nshieldon\nbastiodon\nburmy\nmothim\ncombee\nvespiquen\npachirisu\nbuizel\nfloatzel\ncherubi\ncherrim\nshellos\ngastrodon\nambipom\ndrifloon\ndrifblim\nbuneary\nlopunny\nmismagius\nhonchkrow\nglameow\npurugly\nchingling\nstunky\nskuntank\nbronzor\nbronzong\nbonsly\nhappiny\nchatot\nspiritomb\ngible\ngabite\ngarchomp\nmunchlax\nriolu\nlucario\nhippopotas\nhippowdon\nskorupi\ndrapion\ncroagunk\ntoxicroak\ncarnivine\nfinneon\nlumineon\nmantyke\nsnover\nabomasnow\nweavile\nmagnezone\nlickilicky\nrhyperior\ntangrowth\nelectivire\nmagmortar\ntogekiss\nyanmega\nleafeon\nglaceon\ngliscor\nmamoswine\nporygon-z\ngallade\nprobopass\ndusknoir\nfroslass\nrotom\nuxie\nmesprit\nazelf\ndialga\npalkia\nheatran\nregigigas\ncresselia\nphione\nmanaphy\ndarkrai\narceus\nvictini\nsnivy\nservine\nserperior\ntepig\npignite\nemboar\noshawott\ndewott\nsamurott\npatrat\nwatchog\nlillipup\nherdier\nstoutland\npurrloin\nliepard\npansage\nsimisage\npansear\nsimisear\npanpour\nsimipour\nmunna\nmusharna\npidove\ntranquill\nunfezant\nblitzle\nzebstrika\nroggenrola\nboldore\ngigalith\nwoobat\nswoobat\ndrilbur\nexcadrill\naudino\ntimburr\ngurdurr\nconkeldurr\ntympole\npalpitoad\nseismitoad\nthroh\nsawk\nsewaddle\nswadloon\nleavanny\nvenipede\nwhirlipede\nscolipede\ncottonee\nwhimsicott\npetilil\nlilligant\nbasculin\nsandile\nkrokorok\nkrookodile\ndarumaka\nmaractus\ndwebble\ncrustle\nscraggy\nscrafty\nsigilyph\nyamask\ncofagrigus\ntirtouga\ncarracosta\narchen\narcheops\ntrubbish\ngarbodor\nzorua\nzoroark\nminccino\ncinccino\ngothita\ngothorita\ngothitelle\nsolosis\nduosion\nreuniclus\nducklett\nswanna\nvanillite\nvanillish\nvanilluxe\ndeerling\nsawsbuck\nemolga\nkarrablast\nescavalier\nfoongus\namoonguss\nfrillish\njellicent\nalomomola\njoltik\ngalvantula\nferroseed\nferrothorn\nklink\nklang\nklinklang\ntynamo\neelektrik\neelektross\nelgyem\nbeheeyem\nlitwick\nlampent\nchandelure\naxew\nfraxure\nhaxorus\ncubchoo\nbeartic\ncryogonal\nshelmet\naccelgor\nstunfisk\nmienfoo\nmienshao\ndruddigon\ngolett\ngolurk\npawniard\nbisharp\nbouffalant\nrufflet\nbraviary\nvullaby\nmandibuzz\nheatmor\ndurant\ndeino\nzweilous\nhydreigon\nlarvesta\nvolcarona\ncobalion\nterrakion\nvirizion\nreshiram\nzekrom\nkyurem\ngenesect\nchespin\nquilladin\nchesnaught\nfennekin\nbraixen\ndelphox\nfroakie\nfrogadier\ngreninja\nbunnelby\ndiggersby\nfletchling\nfletchinder\ntalonflame\nscatterbug\nspewpa\nvivillon\nlitleo\npyroar\nflabébé\nfloette\nflorges\nskiddo\ngogoat\npancham\npangoro\nfurfrou\nespurr\nmeowsticmale\nmeowsticfemale\nhonedge\ndoublade\nspritzee\naromatisse\nswirlix\nslurpuff\ninkay\nmalamar\nbinacle\nbarbaracle\nskrelp\ndragalge\nclauncher\nclawitzer\nhelioptile\nheliolisk\ntyrunt\ntyrantrum\namaura\naurorus\nsylveon\nhawlucha\ndedenne\ncarbink\ngoomy\nsliggoo\ngoodra\nklefki\nphantump\ntrevenant\nbergmite\navalugg\nnoibat\nnoivern\nxerneas\nyveltal\ndiancie\nvolcanion  

Some Other Warnings :

You are using an experiential feature: Action 'action_query_knowledge_base'! 

The 'version' key is missing in the training data file /mnt/sda7/6thSem/NLP/final/rasaa/pokedex-demo/domain.yml. Rasa Open Source will read the file as a version '2.0' file. See https://rasa.com/docs/rasa/training-data-format. 

Error can be solved if I have only some names in pokenames.txt

sara-tagger commented 3 years ago

Thanks for the issue, @wochinge will get back to you about it soon!

You may find help in the docs and the forum, too 🤗
wochinge commented 3 years ago

@alwx Do you think this might be caused by the recent changes to Markdown lookup tables? 🤔

koaning commented 3 years ago

Technically, this repo is deprecated. It seems that I forgot to archive it.

Also, if memory serves, the code in this repo is from Rasa version 1.x.

koaning commented 3 years ago

Actually, I might want to delete this repo. Pokemon a licensed part of Nintendo and we wouldn't want to suggest that we're using their IP.

@wochinge let me know when you're done debugging on that issue.

AkshayBhimani commented 3 years ago

@koaning So will I able to use this repo or not after error solved?

koaning commented 3 years ago

You're free to clone the repo and do what you want with it, but we've stopped maintaining it and will be dropping the repo soon.

rlinke commented 3 years ago

Hi I have the same issue with

Rasa Version      :         2.6.1
Minimum Compatible Version: 2.6.0
Rasa SDK Version  :         2.6.0
Rasa X Version    :         None
Python Version    :         3.8.8
Operating System  :         Linux-5.4.0-74-generic-x86_64-with-glibc2.10
Python Path       :         /home/<username>/anaconda3/envs/rasa/bin/python

and my own project.

I think the offending line is actually here: https://github.com/RasaHQ/rasa/blob/d4d606b12370d440d9f9ed3f9e4d8e2a23b959b8/rasa/shared/nlu/training_data/training_data.py#L82

for some reason the lookup table contains either file pathes OR the loaded file content. If the content of the file is too long (in our case some hundred street names), the Pathlib excepts with OSError(36) "FilenameTooLong", and breaks training. Straight forward catching this exception solves the issue for me.

        try:
            if Path(potential_file).is_file():
                try:
                    lookup_table["elements"] = rasa.shared.utils.io.read_file(
                        potential_file
                    )
                    return lookup_table
                except (FileNotFoundError, UnicodeDecodeError):
                    return lookup_table
        except OSError as exp:
            if exp.errno == 36:
                # lookup table element was already read as file and now reading it again turns into an error
                # because the lookup table element may be to long for the pathlib
                return lookup_table
rlinke commented 3 years ago

@koaning My "fix" is only a workaround for the underlying problem, which is probably a bug in rasa core. Do you have a suggestion how to handle the problem or want me to debug/try sth. else?

I could try to create a minimal test case. Happy to help out any way possible.

koaning commented 3 years ago

@rlinke I might check the main Rasa repo for this bug. Mainly because it's unrelated to this repository, but also because somebody may already be working on a fix.

jeanveau commented 2 years ago

Hello, I'm using rasa 3.0, this bug still exist!