Assets for plugin room_assistance have not been built Error

Hi,
I am trying to use the cern room assistance and after I install the cern plugin I have the following error.

RuntimeError: Assets for plugin room_assistance have not been built

where I can add the assets list as I cannot see anything related to assets at the room_assistance plugin admin area:

Thanks

image

In a dev instance you’d build the assets like this:

./bin/maintenance/build-assets.py plugin --dev --clean ../plugins/cern/vc_assistance/

For a production build, the script that builds a Python wheel will take care of it (internally it calls the script above, just without --dev):

./bin/maintenance/build-wheel.py plugin ../plugins/cern/vc_assistance/
1 Like

I tried to use this command and received the following error:

indico/bin/maintenance/build-wheel.py plugin /opt/indico/plugins/myplugin/room_assistance/

Traceback (most recent call last):
  File "/opt/indico/src/indico/bin/maintenance/dump_url_map.py", line 14, in <module>
    from flask_url_map_serializer import dump_url_map
ModuleNotFoundError: No module named 'flask_url_map_serializer'
Traceback (most recent call last):
  File "/opt/indico/src/indico/./bin/maintenance/build-assets.py", line 273, in <module>
    cli()
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/indico/src/indico/./bin/maintenance/build-assets.py", line 235, in build_plugin
    subprocess.check_call(['python', 'bin/maintenance/dump_url_map.py',
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', 'bin/maintenance/dump_url_map.py', '--output', '/opt/indico/plugins/myplugin/room_assistance/url_map.json', '--plugin', 'room_assistance', '--force']' returned non-zero exit status 1.

Also, I tried the following command

indico/bin/maintenance/dump_url_map.py  plugin  /opt/indico/plugins/myplugin/room_assistance/
indico/bin/maintenance/dump_url_map.py: line 8: import: command not found
indico/bin/maintenance/dump_url_map.py: line 9: import: command not found
indico/bin/maintenance/dump_url_map.py: line 10: import: command not found
indico/bin/maintenance/dump_url_map.py: line 11: import: command not found
indico/bin/maintenance/dump_url_map.py: line 13: import: command not found
from: too many arguments
indico/bin/maintenance/dump_url_map.py: line 17: syntax error near unexpected token `('
indico/bin/maintenance/dump_url_map.py: line 17: `def get_map_version():'

@ThiefMaster is there anything missing? please advise what I should do?

is the Indico venv activated?

and your second error looks like you tried to execute that script as a shell script instead of a python script… but in any case, you never need to call the url map dump script yourself

@ThiefMaster Thanks for your quick reply.

Yes, activated. now I tried with python and received the following error.

(indico) indico@events-1:~/src$ python indico/bin/maintenance/build-wheel.py plugin /opt/indico/plugins/myplugin/room_assistance/


building assets
Error: building assets failed
Traceback (most recent call last):
  File "/opt/indico/src/indico/bin/maintenance/dump_url_map.py", line 14, in <module>
    from flask_url_map_serializer import dump_url_map
ModuleNotFoundError: No module named 'flask_url_map_serializer'
Traceback (most recent call last):
  File "/opt/indico/src/indico/./bin/maintenance/build-assets.py", line 273, in <module>
    cli()
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/indico/src/indico/./bin/maintenance/build-assets.py", line 235, in build_plugin
    subprocess.check_call(['python', 'bin/maintenance/dump_url_map.py',
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', 'bin/maintenance/dump_url_map.py', '--output', '/opt/indico/plugins/myplugin/room_assistance/url_map.json', '--plugin', 'room_assistance', '--force']' returned non-zero exit status 1.

Very strange. The error sounds like the virtualenv isn’t active when the script gets called… because flask_url_map_serializer is a dependency of indico and should thus always be installed in the indico venv

I installed the flask_url_map_serializer using pip install and I received a new error:

(indico) indico@events-1:~/plugins/myplugin/room_assistance$ python /opt/indico/src/indico/bin/maintenance/build-wheel.py  plugin  /opt/indico/plugins/myplugin/room_assistance/
building assets
Error: building assets failed
Plugin room_assistance does not exist
Traceback (most recent call last):
  File "/opt/indico/src/indico/bin/maintenance/dump_url_map.py", line 62, in <module>
    main()
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/indico/src/indico/bin/maintenance/dump_url_map.py", line 54, in main
    rules = get_rules(set(plugins))
  File "/opt/indico/src/indico/bin/maintenance/dump_url_map.py", line 30, in get_rules
    app = make_app(testing=True, config_override={'BASE_URL': 'http://localhost/',
  File "/opt/indico/.venv/lib/python3.9/site-packages/indico/web/flask/app.py", line 423, in make_app
    raise Exception('Could not load some plugins: {}'.format(', '.join(plugin_engine.get_failed_plugins(app))))
Exception: Could not load some plugins: room_assistance
Traceback (most recent call last):
  File "/opt/indico/src/indico/./bin/maintenance/build-assets.py", line 273, in <module>
    cli()
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/indico/src/indico/./bin/maintenance/build-assets.py", line 235, in build_plugin
    subprocess.check_call(['python', 'bin/maintenance/dump_url_map.py',
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', 'bin/maintenance/dump_url_map.py', '--output', '/opt/indico/plugins/myplugin/room_assistance/url_map.json', '--plugin', 'room_assistance', '--force']' returned non-zero exit status 1.

Wait, how were you able to install it? As I said, this is a dependency of Indico so it should already be installed. Are you sure you are in the venv where indico has been installed?

I used this command

(indico) indico@events-1:/$ pip install flask_url_map_serializer
Collecting flask_url_map_serializer
  Downloading flask_url_map_serializer-0.0.1-py2.py3-none-any.whl (2.6 kB)
Requirement already satisfied: flask>=0.11 in /opt/indico/.venv/lib/python3.9/site-packages (from flask_url_map_serializer) (2.0.1)
Requirement already satisfied: click in /opt/indico/.venv/lib/python3.9/site-packages (from flask_url_map_serializer) (7.1.2)
Requirement already satisfied: Werkzeug>=2.0 in /opt/indico/.venv/lib/python3.9/site-packages (from flask>=0.11->flask_url_map_serializer) (2.0.1)
Requirement already satisfied: itsdangerous>=2.0 in /opt/indico/.venv/lib/python3.9/site-packages (from flask>=0.11->flask_url_map_serializer) (2.0.1)
Requirement already satisfied: Jinja2>=3.0 in /opt/indico/.venv/lib/python3.9/site-packages (from flask>=0.11->flask_url_map_serializer) (3.0.1)
Requirement already satisfied: MarkupSafe>=2.0 in /opt/indico/.venv/lib/python3.9/site-packages (from Jinja2>=3.0->flask>=0.11->flask_url_map_serializer) (2.0.1)
Installing collected packages: flask-url-map-serializer
Successfully installed flask-url-map-serializer-0.0.1

Wait, why are you doing this in a production environment? We do not really support this; use a local development environment to build wheels and then copy just the wheel to production in order to install it there.

I installed the indico development environment then used the following command to build plugin:

python ~/dev/indico/src/bin/maintenance/build-assets.py plugin --dev --clean ~/dev/indico/plugins/myplugins/room_assistance/

Plugin room_assistance does not exist
Traceback (most recent call last):
  File "/opt/indico/dev/indico/src/bin/maintenance/dump_url_map.py", line 62, in <module>
    main()
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/indico/dev/indico/src/bin/maintenance/dump_url_map.py", line 54, in main
    rules = get_rules(set(plugins))
  File "/opt/indico/dev/indico/src/bin/maintenance/dump_url_map.py", line 30, in get_rules
    app = make_app(testing=True, config_override={'BASE_URL': 'http://localhost/',
  File "/opt/indico/dev/indico/src/indico/web/flask/app.py", line 423, in make_app
    raise Exception('Could not load some plugins: {}'.format(', '.join(plugin_engine.get_failed_plugins(app))))
Exception: Could not load some plugins: room_assistance
Traceback (most recent call last):
  File "/opt/indico/dev/indico/src/bin/maintenance/build-assets.py", line 273, in <module>
    cli()
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/indico/dev/indico/src/bin/maintenance/build-assets.py", line 235, in build_plugin
    subprocess.check_call(['python', 'bin/maintenance/dump_url_map.py',
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', 'bin/maintenance/dump_url_map.py', '--output', '/opt/indico/dev/indico/plugins/myplugins/room_assistance/url_map.json', '--plugin', 'room_assistance', '--force']' returned non-zero exit status 1.```

Have you installed the plugin in your environment? pip install -e ~/dev/indico/plugins/myplugins/room_assistance/

1 Like

Thanks, I successfully built it. but when I used the following command received the following error:

indico setup list-plugins

Traceback (most recent call last):
  File "/opt/indico/dev/indico/env/bin/indico", line 33, in <module>
    sys.exit(load_entry_point('indico', 'console_scripts', 'indico')())
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/flask/cli.py", line 600, in main
    return super().main(*args, **kwargs)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/indico/dev/indico/src/indico/cli/util.py", line 108, in invoke
    return self._impl.invoke(ctx)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/indico/dev/indico/src/indico/cli/setup.py", line 185, in list_plugins
    plugin = ep.load()
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2465, in load
    return self.resolve()
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2471, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/opt/indico/dev/indico/env/lib/python3.9/site-packages/indico_citadel/plugin.py", line 8, in <module>
    from wtforms.fields.core import BooleanField
ImportError: cannot import name 'BooleanField' from 'wtforms.fields.core' (/opt/indico/dev/indico/env/lib/python3.9/site-packages/wtforms/fields/core.py)

Make sure to use the correct branches. Most likely you used he indico master branch (3.2 dev) instead of the 3.0.x or 3.1.x branch (depending on the version you are using).

1 Like