kuhn-ruess / cmdbsyncer

Rule Based Syncronisation System with Checkmk and Ansible Support
MIT License
41 stars 9 forks source link

cmdb_syncer_api container crashes on startup #28

Closed PhXcell closed 1 year ago

PhXcell commented 1 year ago

Newest Update causes the API container to crash on startup.

* Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
/usr/local/lib/python3.10/site-packages/flask_admin/model/base.py:1415: UserWarning: Fields missing from ruleset: render_full_conditions,render_attribute_outcomes
  warnings.warn(text)
/usr/local/lib/python3.10/site-packages/flask_admin/model/base.py:1415: UserWarning: Fields missing from ruleset: render_full_conditions,render_attribute_rewrite
  warnings.warn(text)
/usr/local/lib/python3.10/site-packages/flask_admin/model/base.py:1415: UserWarning: Fields missing from ruleset: render_full_conditions,render_checkmk_outcome
  warnings.warn(text)
/usr/local/lib/python3.10/site-packages/flask_admin/model/base.py:1415: UserWarning: Fields missing from ruleset: render_full_conditions,render_netbox_outcome
  warnings.warn(text)
Traceback (most recent call last):
  File "/usr/local/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 988, in main
    cli.main()
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 579, in main
    return super().main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 850, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 299, in __init__
    self._load_unlocked()
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 333, in _load_unlocked
    self._app = rv = self.loader()
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 393, in load_app
    app = locate_app(import_name, None, raise_if_not_found=False)
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 234, in locate_app
    __import__(module_name)
  File "/srv/app.py", line 5, in <module>
    from application import app
  File "/srv/application/__init__.py", line 196, in <module>
    admin.add_view(FileAdmin(app.config['FILEADMIN_PATH'], name="Files", category="Config"))
  File "/usr/local/lib/python3.10/site-packages/flask_admin/contrib/fileadmin/__init__.py", line 1239, in __init__
    storage = LocalFileStorage(base_path)
  File "/usr/local/lib/python3.10/site-packages/flask_admin/contrib/fileadmin/__init__.py", line 34, in __init__
    raise IOError('FileAdmin path "%s" does not exist or is not accessible' % self.base_path)
OSError: FileAdmin path "/srv/cmdbsyncer_imports" does not exist or is not accessible
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
/usr/local/lib/python3.10/site-packages/flask_admin/model/base.py:1415: UserWarning: Fields missing from ruleset: render_full_conditions,render_attribute_outcomes
  warnings.warn(text)
/usr/local/lib/python3.10/site-packages/flask_admin/model/base.py:1415: UserWarning: Fields missing from ruleset: render_full_conditions,render_attribute_rewrite
  warnings.warn(text)
/usr/local/lib/python3.10/site-packages/flask_admin/model/base.py:1415: UserWarning: Fields missing from ruleset: render_full_conditions,render_checkmk_outcome
  warnings.warn(text)
/usr/local/lib/python3.10/site-packages/flask_admin/model/base.py:1415: UserWarning: Fields missing from ruleset: render_full_conditions,render_netbox_outcome
  warnings.warn(text)
Traceback (most recent call last):
  File "/usr/local/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 988, in main
    cli.main()
  File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 579, in main
    return super().m *  Terminal will be reused by tasks, press any key to close it
Bastian-Kuhn commented 1 year ago

That's the new Fileadmin, was not aware that there is an effect on docker. Does creating a folder cmdbsyncer_imports fix it? Then I have to create it automatically.

Bastian-Kuhn commented 1 year ago

I disabled it. Will change it a way that the existing of the folder is checked, but currently on holidays

PhXcell commented 1 year ago

I wish a restfull vacation!

Bastian-Kuhn commented 1 year ago

The File admin now checks for an existing Folder which can be overwritten in the local_config.py.