grei-ufc / mosaik-demo-wesaac-2019

Code example demostrating the PADE integration with Mosaik standard demo, published in WESAAC 2019 paper.
GNU Lesser General Public License v2.1
4 stars 1 forks source link

Demo not working #2

Open LorenzoBottaccioli opened 5 years ago

LorenzoBottaccioli commented 5 years ago

Hi the demo is not working.

If I run python launcher.py I get the following error:


        This is
         ____   _    ____  _____ 
        |  _ \ / \  |  _ \| ____|
        | |_) / _ \ | | | |  _|  
        |  __/ ___ \| |_| | |___ 
        |_| /_/   \_\____/|_____|

        Python Agent DEvelopment framework   

        PADE is a free software under development by
        Electric Smart Grid Group - GREI
        Federal University of Ceara - UFC - Brazil

        https://github.com/grei-ufc/pade
 * Serving Flask app "pade.web.flask_server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
Process FlaskServerProcess-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/pade-2.1.2-py3.6.egg/pade/cli/pade_cmd.py", line 21, in run
    run_server()
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/pade-2.1.2-py3.6.egg/pade/web/flask_server.py", line 206, in run_server
    app.run(host='0.0.0.0', port=5000, debug=None)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/flask/app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/werkzeug/serving.py", line 1010, in run_simple
    inner()
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/werkzeug/serving.py", line 963, in inner
    fd=fd,
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/werkzeug/serving.py", line 806, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/werkzeug/serving.py", line 699, in __init__
    HTTPServer.__init__(self, server_address, handler)
  File "/usr/lib/python3.6/socketserver.py", line 456, in __init__
    self.server_bind()
  File "/usr/lib/python3.6/http/server.py", line 136, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.6/socketserver.py", line 470, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
Traceback (most recent call last):
  File "/home/lorenzo/mosaik-demo/bin/pade", line 11, in <module>
    load_entry_point('pade==2.1.2', 'console_scripts', 'pade')()
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/click/core.py", line 1058, in invoke
    sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/click/core.py", line 620, in make_context
    self.parse_args(ctx, args)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/click/core.py", line 874, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/click/core.py", line 1398, in handle_parse_result
    self.callback, ctx, self, value)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/click/core.py", line 77, in invoke_param_callback
    return callback(ctx, param, value)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/pade-2.1.2-py3.6.egg/pade/cli/pade_cmd.py", line 45, in run_config_file
    main(config)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/pade-2.1.2-py3.6.egg/pade/cli/pade_cmd.py", line 134, in main
    from pade.core import sniffer
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/pade-2.1.2-py3.6.egg/pade/core/sniffer.py", line 25, in <module>
    MESSAGES = Table('messages', METADATA, autoload=True, autoload_with=ENGINE)
  File "<string>", line 2, in __new__
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/util/deprecations.py", line 128, in warned
    return fn(*args, **kwargs)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 506, in __new__
    metadata._remove_table(name, schema)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 501, in __new__
    table._init(name, metadata, *args, **kw)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 595, in _init
    resolve_fks=resolve_fks,
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 619, in _autoload
    _extend_on=_extend_on,
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2160, in run_callable
    return conn.run_callable(callable_, *args, **kwargs)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1612, in run_callable
    return callable_(self, *args, **kwargs)
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 459, in reflecttable
    table, include_columns, exclude_columns, resolve_fks, **opts
  File "/home/lorenzo/mosaik-demo/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 659, in reflecttable
    raise exc.NoSuchTableError(table.name)
sqlalchemy.exc.NoSuchTableError: messages
[AMS] 07/10/2019 18:31:14 --> creating tables in database...
[AMS] 07/10/2019 18:31:14 --> tables created in database.
[ams@localhost:8001] 07/10/2019 18:31:14 --> PADE AMS service running right now....
Starting "PyPower" as "PyPower-0" ...
Starting "HouseholdSim" as "HouseholdSim-0" ...
Starting "CSV" as "CSV-0" ...
Starting "DeviceAgentSimnode_d10" as "DeviceAgentSimnode_d10-0" ...
ERROR: Simulator "DeviceAgentSimnode_d10" could not be started: Could not connect to "localhost:1234"
Mosaik terminating

Can you upload a tutorial to run the demo?

Best,

Lorenzo

lucassm commented 5 years ago

Hello Lorenzo, I think that this error occur because the pade tables were not created in the database. To create the tables, juste type in the command line:

pade  create-pade-db

and then try to launche the demo again. Tell me if this solve the problem.