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

[Injection] Injection fail when JSON contains an empty value #192

Open
deniseBrise opened this issue Sep 11, 2019 · 1 comment

Comments

@deniseBrise
Copy link

commented Sep 11, 2019

What's the issue?
Snips injection fails when JSON message is correct but contains an empty value, or a value with space(s). Injection will work first time, and fail afterwards.

Use Cases Impacted
Injection of unverified data.

How to reproduce
mosquitto_pub -h localhost -p 1883 -t hermes/injection/perform -m "{\"operations\":[[\"addFromVanilla\",{\"firstname\":[\" \"]}]]}" => will work only once

Expected behavior
The injection is successful the first time, it should be then.

Version and Environment

$ sam --version
0.0.55
$ sam status
OS version ................... Raspbian GNU/Linux 9 (stretch)
snips-analytics .............. (not running)
snips-asr .................... 0.63.3 (running)
snips-audio-server ........... 0.63.3 (running)
snips-dialogue ............... 0.63.3 (running)
snips-hotword ................ 0.63.3 (running)
snips-nlu .................... 0.63.3 (running)
snips-skill-server ........... 0.63.3 (not running)
snips-tts .................... 0.63.3 (running)

Logs

$tail -F -n 500 /var/log/syslog | grep -i injection
Sep 11 14:38:09 snips-injection[1051]: INFO:snips_asr_injection                                : ASR Injections started
Sep 11 14:38:09 snips-injection[1051]: INFO:snips_asr_injection::core                          : Number of new words: 0
Sep 11 14:38:09 snips-injection[1051]: INFO:snips_asr_injection                                : prepare_injections done in 0.004s.
Sep 11 14:38:09 snips-injection[1051]: INFO:snips_asr_injection                                : Generating missing words pronunciations
Sep 11 14:38:16 snips-injection[1051]: INFO:snips_asr_injection                                : g2p done in 6.976s.
Sep 11 14:38:16 snips-injection[1051]: INFO:snips_asr_injection::model_version_2               : Updating pronunciations' graph
Sep 11 14:38:16 snips-injection[1051]: INFO:snips_asr_injection::model_version_2               : pronunciations' graph done in 0.004s.
Sep 11 14:38:16 snips-injection[1051]: INFO:snips_asr_injection::model_version_2               : Updating entities' graph
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_asr_injection::model_version_2               : Entity firstname done in 0.304s.
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_asr_injection::model_version_2               : entities' graph done in 0.312s.
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_asr_injection::core                          : Injections performed with success
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_asr_injection                                : ASR injections done
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::injection::injection                : Starting injection...
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::injection::injection                : Retrieving parsers paths...
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::resources::loading                  : Loading stemmer ("/var/lib/snips/injections/20190911T123348995799597/inj_20190911T123809694623712.XGuowv1d7en9/nlu_engine/resources/fr/stemming/stems.txt") ...
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::resources::loading                  : Stemmer loaded
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::resources::loading                  : Loading gazetteer 'top_10000_words_stemmed' ("/var/lib/snips/injections/20190911T123348995799597/inj_20190911T123809694623712.XGuowv1d7en9/nlu_engine/resources/fr/gazetteers/top_10000_words_stemmed.txt") ...
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::resources::loading                  : Gazetteer 'top_10000_words_stemmed' loaded
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::resources::loading                  : Loading stop words ("/var/lib/snips/injections/20190911T123348995799597/inj_20190911T123809694623712.XGuowv1d7en9/nlu_engine/resources/fr/stop_words.txt") ...
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::resources::loading                  : Stop words loaded
Sep 11 14:38:17 snips-injection[1051]: INFO:snips_nlu_lib::entity_parser::builtin_entity_parser: Loading builtin entity parser ("/var/lib/snips/injections/20190911T123348995799597/inj_20190911T123809694623712.XGuowv1d7en9/nlu_engine/builtin_entity_parser") ...
Sep 11 14:38:18 snips-injection[1051]: INFO:snips_nlu_lib::entity_parser::builtin_entity_parser: Builtin entity parser loaded
Sep 11 14:38:18 snips-injection[1051]: INFO:snips_nlu_lib::entity_parser::custom_entity_parser : Loading custom entity parser ("/var/lib/snips/injections/20190911T123348995799597/inj_20190911T123809694623712.XGuowv1d7en9/nlu_engine/custom_entity_parser") ...
Sep 11 14:38:18 snips-injection[1051]: INFO:snips_nlu_lib::entity_parser::custom_entity_parser : Custom entity parser loaded
Sep 11 14:38:18 snips-injection[1051]: INFO:snips_nlu_lib::injection::injection                : Normalizing injected values...
Sep 11 14:38:18 snips-injection[1051]: INFO:snips_nlu_lib::injection::injection                : Injecting values for entity 'firstname'
Sep 11 14:38:18 snips-injection[1051]: ERROR:snips_injection_hermes                             : injection failed for injection: Injection { root_dir: "/var/lib/snips/injections/20190911T123348995799597/inj_20190911T123809694623712.XGuowv1d7en9", date: 2019-09-11T12:38:09.694623712Z }
Sep 11 14:38:18 snips-injection[1051]:  -> caused by: Internal injection error: could not inject values for entity 'firstname'
Sep 11 14:38:18 snips-injection[1051]:  -> caused by: Error when retrieving tokens of resolved value '  '
Sep 11 14:38:18 snips-injection[1051]:  -> caused by: Cannot find resolved value index 15 in `resolved_value_to_tokens`

Additional information

Workaround
Reboot of the device is not enough, "sam install assistant" will works.

@cpoisson

This comment has been minimized.

Copy link
Collaborator

commented Sep 12, 2019

@deniseBrise

Nice catch, we could reproduce easily this one thanks to your precise description.
We are investigating the root cause.

Thanks again for your feedback!

@cpoisson cpoisson changed the title Injection fail when JSON contains empty value [Injection] Injection fail when JSON contains an empty value Sep 12, 2019
@cpoisson cpoisson added this to the Snips Flow - Next milestone Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.