Genie Community Forum

Almond fails with timeout in Ubuntu 19.04

Hi,

I installed Almond from flathub and its gnome-shell extension in Ubuntu 19.04. This is what I found so far:

  1. Almond starts ok but when it request confirmation for the privacy policy after the first start, it desn’t seem to recognize clicking the ‘yes’ button.

  2. After a while trying to find my way through the interface Almond stopped working at all. When I run it from the shell I get:

    flatpak run  edu.stanford.Almond
    

(edu.stanford.Almond:2): Gjs-WARNING **: 15:46:20.699: JS ERROR: Gio.IOErrorEnum: Timeout was reached
spawnServiceDBusActivation@resource:///edu/stanford/Almond/js/app/servicelaunch.js:47:9
spawnService@resource:///edu/stanford/Almond/js/app/servicelaunch.js:73:9
main@resource:///edu/stanford/Almond/js/app/main.js:114:21
run@resource:///org/gnome/gjs/modules/package.js:225:12
@/app/bin/edu.stanford.Almond:6:1

Script /app/bin/edu.stanford.Almond threw an exception

I tried installing from flathub and nightly both with the same result. Item 2 is the most annoying because I’m unable to start Almond to continue researching what can be wrong with the App and why it is not responding to my commands.

Flatpak version 1.2.4
Ubuntu version 19.04
Gnome-shell version 3.32.0+git20190410-1ubuntu1

flatpak info edu.stanford.Almond

Almond - The Open Virtual Assistant

          ID: edu.stanford.Almond
         Ref: app/edu.stanford.Almond/x86_64/master
        Arch: x86_64
      Branch: master
     Version: 1.4.0
     License: GPL-3.0
      Origin: almond-nightly
  Collection: edu.stanford.AlmondNightly
Installation: system
   Installed: 641.1 MB
     Runtime: org.gnome.Platform/x86_64/3.32
         Sdk: org.gnome.Sdk/x86_64/3.32

      Commit: 4a9211f8f69408cef5f249d9e10dc84725a0132da723b50b863acefd1bef686f
      Parent: ab6246a427e04cab0c501f27a93efe4848036baeafb8f0a2c8ad99e2494ebc5d
     Subject: Export edu.stanford.Almond
        Date: 2019-05-03 00:55:17 +0000

Hi!

Thanks for your report. You should be able to investigate what happens through to journalctl, where messages from the background service are logged.
If not, you can run the background service manually as:

flatpak run --command=/app/bin/node edu.stanford.Almond /app/lib/edu.stanford.Almond/service/main.js

You can also killall node and see if it helps, or use a DBus debugger like D-Feet to locate and kill the background service (which owns the edu.stanford.Almond.BackgroundService name)

Let me know if it helps!

The command you provided helped fixing issue #2.

It complained about a corrupted sqlite DB so I located the db files in the configuration directory and deleted them to force a rebuild. That fixed the issue with Almond not starting at all and failing with a timeout.

Now I’m trying to identify the operation issue #1, Almond doesn’t seem to respond to the voice keyword nor any simple command like open ‘file’ in the chat window returns the intial prompt ‘welcome back’

If I use the gnome skill to send a command like screenshot it actually takes the screenshot.

I just found with D-Feet that everytime I try to peek at the BackGround service d-bus I get a new ID for backgroud service and the UI spells the ‘Welcome Back’ prompt. I cannot actually see the d-bus contents for backgroud service, looks like the process dies everytime.

Hope it helps, I’l continue digging if I can provide better information.

Both issues are solved now

After fixing the issue with the database, the command

flatpak run --command=/app/bin/node edu.stanford.Almond /app/lib/edu.stanford.Almond/service/main.js

was complaining that:

Engine started
Ready
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Almond Says: Welcome back!
Engine running
setAutoTrigger false
outputstream write for Welcome back!, delay of 1130
Record stream is now ready
Traceback (most recent call last):
  File "/app/bin/precise-engine", line 10, in <module>
    sys.exit(main())
  File "/app/lib/python3.7/site-packages/precise/scripts/engine.py", line 52, in main
    listener = Listener(args.model_name, args.chunk_size)
  File "/app/lib/python3.7/site-packages/precise/network_runner.py", line 94, in __init__
    self.runner = runner_cls(model_name)
  File "/app/lib/python3.7/site-packages/precise/network_runner.py", line 74, in __init__
    self.model = load_precise_model(model_name)
  File "/app/lib/python3.7/site-packages/precise/model.py", line 50, in load_precise_model
    return load_keras().models.load_model(model_name)
  File "/app/lib/python3.7/site-packages/precise/functions.py", line 88, in load_keras
    import keras
ModuleNotFoundError: No module named 'keras'

So I manually installed keras, yaml and PyYAML at the site-packages of the app folder. I just copied them from a virtualenv, but your packages are pretty updated so at least it got me working.

So now almond is working for basic functions like basic NLI, chatting, locking the computer.

Now time to do some interesting things…

Thank you!

I was getting the original error. So i tried the following as suggested but getting another error.
I am using Arch though.

        ❯ flatpak run --command=/app/bin/node edu.stanford.Almond /app/lib/edu.stanford.Almond/service/main.js
        ThingEngine-GNOME starting up...
        Unable to load crypto module: crypto will be disabled: Error: global.Olm is not defined
        ** Message: 13:06:26.434: Remote error from secret service: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files
        /app/lib/edu.stanford.Almond/service/main.js:13
        process.on('unhandledRejection', (up) => { throw up; });
                                                   ^

        Error: The name org.freedesktop.secrets was not provided by any .service files

Hi @xavier83 !

What version of Arch and what DE? The error you show arises from not running a compatible keyring daemon, which would be provided by gnome-keyring in GNOME and kwallet in KDE.