Skip to content

"hyperglass start" fails during an async call within util.build_frontend #56

Description

@linuxgemini

On a valid configuration set, you can run hyperglass build-ui without issues. Regardless of the UI build state with the same configuration set however, you cannot run hyperglass start. You can run hyperglass with the --direct flag: hyperglass start -d

Bug Description

https://github.com/checktheroads/hyperglass/blob/ee87c34ff162693b7a039027c12211930b409c44/hyperglass/util.py#L637-L647
The code block pointed above fails to the user with an empty RuntimeError:

unhandled exception during asyncio.run() shutdown
task: <Task finished coro=<build_ui() done, defined at /usr/local/lib/python3.6/dist-packages/hyperglass/main.py:59> exception=RuntimeError('',)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/hyperglass/main.py", line 70, in build_ui
    app_path=CONFIG_PATH,
  File "/usr/local/lib/python3.6/dist-packages/hyperglass/util.py", line 696, in build_frontend
    raise RuntimeError(str(e)) from None
RuntimeError
❌

However, the error is not empty. You have to dig deeper (aka adding a try/except block on the linked code above) to get the error: <class 'concurrent.futures._base.CancelledError'>

Expected behavior

hyperglass starting up. (and building the UI/frontend if not done before)

Steps to Reproduce

  • Install hyperglass manually with pip3 (or with python3 -m pip)
  • Run hyperglass setup and choose /etc/hyperglass as configuration base folder
  • Setup a sample config that is connected to a BIRD instance, see "runnable" example config linked below (this should've been easier if the documentation and the example wasn't out of sync, see: Online Documentation for "Adding Devices" is out of date/incomplete #55)
  • run hyperglass start

Local Configurations

commands.yaml: empty
devices.yaml: https://files.linuxgemini.space/hyperglass/devices-clearpass.yaml
hyperglass.yaml: https://files.linuxgemini.space/hyperglass/hyperglass.yaml

hyperglass-agent/config.yaml: https://files.linuxgemini.space/hyperglass/agent/config.yaml

Logs

root@hell:~# hyperglass start
[INFO] 20200716 01:08:30 | hyperglass.configuration:43 | <module> → Configuration directory: /etc/hyperglass
[INFO] 20200716 01:08:31 | hyperglass.main:101 | on_starting → Python 3.6.9 detected (3.6 required)
unhandled exception during asyncio.run() shutdown
task: <Task finished coro=<build_ui() done, defined at /usr/local/lib/python3.6/dist-packages/hyperglass/main.py:59> exception=RuntimeError('',)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/hyperglass/main.py", line 70, in build_ui
    app_path=CONFIG_PATH,
  File "/usr/local/lib/python3.6/dist-packages/hyperglass/util.py", line 696, in build_frontend
    raise RuntimeError(str(e)) from None
RuntimeError
❌
root@hell:~#

Possible Solution

Sadly, I am not really sure. I haven't messed with async in Python much; or Python in general.

Environment

Server

  • OS: Ubuntu 18.04.4 LTS: Kernel 4.15.0-99-generic
  • Python Version: 3.6.9
  • hyperglass Version: 1.0.0-beta.51

Route Server

  • OS: Ubuntu 18.04.4 LTS: Kernel 4.15.0-106-generic
  • Python Version: 3.6.9
  • hyperglass-agent Version: 0.1.0
  • BIRD Version: 2.0.7

Client

not applicable

Smartphone Details (if applicable)

not applicable

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions