Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'DISPLAY_RAW' #172

Open
ghost opened this issue May 31, 2023 · 4 comments
Open

AttributeError: 'NoneType' object has no attribute 'DISPLAY_RAW' #172

ghost opened this issue May 31, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented May 31, 2023

This does not run.
Cloned repo, copy template_config.yaml, and api will not start tested in multiple environments.

internal-api     | CRITICAL:root:Using config `config.yaml`
worker-server    | CRITICAL:root:Using config `config.yaml`
internal-api     | /usr/local/lib/python3.7/site-packages/paramiko/transport.py:208: CryptographyDeprecationWarning: Blowfish has been deprecated
internal-api     |   "class": algorithms.Blowfish,
internal-api     | Traceback (most recent call last):
internal-api     |   File "/usr/local/lib/python3.7/pydoc.py", line 347, in safeimport
internal-api     |     module = __import__(path)
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/plugins/executors/python/local.py", line 30, in <module>
internal-api     |     _resource_manager = plynx.utils.plugin_manager.get_resource_manager()
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/utils/plugin_manager.py", line 109, in get_resource_manager
internal-api     |     _RESOURCE_MANAGER = _ResourceManager(_plugins)
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/utils/plugin_manager.py", line 38, in __init__
internal-api     |     self.kind_to_resource_dict[kind]['display_raw'] = resource_class.DISPLAY_RAW
internal-api     | AttributeError: 'NoneType' object has no attribute 'DISPLAY_RAW'
internal-api     |
internal-api     | During handling of the above exception, another exception occurred:
internal-api     |
internal-api     | Traceback (most recent call last):
internal-api     |   File "/usr/local/bin/plynx", line 33, in <module>
internal-api     |     sys.exit(load_entry_point('plynx==1.10.0', 'console_scripts', 'plynx')())
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/bin/__init__.py", line 15, in main
internal-api     |     args.func(kwargs)
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/bin/cli.py", line 38, in api
internal-api     |     from plynx.web.common import run_api  # noqa: E402  # pylint: disable=import-outside-toplevel
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/web/__init__.py", line 7, in <module>
internal-api     |     import plynx.web.health
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/web/health.py", line 3, in <module>
internal-api     |     from plynx.web.common import app, handle_errors
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/web/common.py", line 17, in <module>
internal-api     |     from plynx.utils.content import create_default_templates
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/utils/content.py", line 9, in <module>
internal-api     |     executor_manager = plynx.utils.plugin_manager.get_executor_manager()
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/utils/plugin_manager.py", line 141, in get_executor_manager
internal-api     |     _EXECUTOR_MANAGER = _ExecutorManager(_plugins)
internal-api     |   File "/usr/local/lib/python3.7/site-packages/plynx-1.10.0-py3.7.egg/plynx/utils/plugin_manager.py", line 48, in __init__
internal-api     |     self.kind_to_executor_class[o_or_w.kind] = pydoc.locate(o_or_w.executor)    # type: ignore
internal-api     |   File "/usr/local/lib/python3.7/pydoc.py", line 1607, in locate
internal-api     |     nextmodule = safeimport('.'.join(parts[:n+1]), forceload)
internal-api     |   File "/usr/local/lib/python3.7/pydoc.py", line 362, in safeimport
internal-api     |     raise ErrorDuringImport(path, sys.exc_info())
internal-api     | pydoc.ErrorDuringImport: problem in plynx.plugins.executors.python.local - AttributeError: 'NoneType' object has no attribute 'DISPLAY_RAW'
@khaxis
Copy link
Collaborator

khaxis commented May 31, 2023

No it does not look right. I tried to replicate but it won't work.
Can you please git pull? I've added one logging line to narrow down the resource that fails to initialize. And could you post the output?

@ghost
Copy link
Author

ghost commented Jun 1, 2023

So this is interesting.

Windows I can't make build and it is pulling plynxteam/backend:latest which is using python:3.7-slim and gives the same error above.

Linux after making using python:3.8-slim:

api         | /usr/local/lib/python3.8/site-packages/paramiko/transport.py:208: CryptographyDeprecationWarning: Blowfish has been deprecated
api         |   "class": algorithms.Blowfish,
api         | Traceback (most recent call last):
api         |   File "/usr/local/bin/plynx", line 33, in <module>
api         |     sys.exit(load_entry_point('plynx==1.11.0', 'console_scripts', 'plynx')())
api         |   File "/usr/local/lib/python3.8/site-packages/plynx-1.11.0-py3.8.egg/plynx/bin/__init__.py", line 15, in main
api         |     args.func(kwargs)
api         |   File "/usr/local/lib/python3.8/site-packages/plynx-1.11.0-py3.8.egg/plynx/bin/cli.py", line 38, in api
api         |     from plynx.web.common import run_api  # noqa: E402  # pylint: disable=import-outside-toplevel
api         |   File "/usr/local/lib/python3.8/site-packages/plynx-1.11.0-py3.8.egg/plynx/web/__init__.py", line 8, in <module>
api         |     import plynx.web.node
api         |   File "/usr/local/lib/python3.8/site-packages/plynx-1.11.0-py3.8.egg/plynx/web/node.py", line 31, in <module>
api         |     hub_manager = plynx.utils.plugin_manager.get_hub_manager()
api         |   File "/usr/local/lib/python3.8/site-packages/plynx-1.11.0-py3.8.egg/plynx/utils/plugin_manager.py", line 126, in get_hub_manager
api         |     _HUB_MANAGER = _HubManager(_plugins)
api         |   File "/usr/local/lib/python3.8/site-packages/plynx-1.11.0-py3.8.egg/plynx/utils/plugin_manager.py", line 78, in __init__
api         |     self.kind_to_hub_class: Dict[str, BaseHub] = {
api         |   File "/usr/local/lib/python3.8/site-packages/plynx-1.11.0-py3.8.egg/plynx/utils/plugin_manager.py", line 79, in <dictcomp>
api         |     hub.kind: pydoc.locate(hub.cls)(**hub.args)     # type: ignore
api         |   File "/usr/local/lib/python3.8/site-packages/plynx-1.11.0-py3.8.egg/plynx/plugins/hubs/static_list.py", line 63, in __init__
api         |     raise Exception(f"List of nodes `{list_nodes_path}` not found")
api         | Exception: List of nodes `/app/nodes.json` not found

I added the following to the Dockerfile which seemed to have it up and running.

RUN echo '[]' > /app/nodes.json

@khaxis
Copy link
Collaborator

khaxis commented Jun 2, 2023

Thanks for the feedback! Do I understand it correctly, it worked eventually on Linux but not Windows? Only when you changed base docker image to python:3.8-slim? I should be python:3.8-slim by default.

@ghost
Copy link
Author

ghost commented Jun 5, 2023

Windows was pulling from docker registry (because I could not build it) which was using python:3.7-slim. So I think there is incompatibility with 3.7. When I built the image it used 3.8 and worked fine.

We decided to move away from this project as I had many other issues from logging in after creating a user and the lack of documentation.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant