aws-deadline / deadline-cloud-for-cinema-4d

AWS Deadline Cloud for Cinema 4D
Apache License 2.0
6 stars 8 forks source link

Bug: Adaptor reports windows OS as posix. Fails on importing HTTPClientInterface #48

Closed yuanmich2 closed 2 months ago

yuanmich2 commented 3 months ago

Expected Behaviour

I expect to be able to render with the adaptor.

Current Behaviour

When I run a job I get this error:

2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT: cannot import name 'HTTPClientInterface' from 'openjd.adaptor_runtime_client' (C:\Program Files\Python311\Lib\site-packages\openjd\adaptor_runtime_client\__init__.py)
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT: Traceback (most recent call last):
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT: (null)  File "C:\Program Files\Python311\Lib\site-packages\deadline\cinema4d_adaptor\Cinema4DClient\plugin\DeadlineCloudClient.pyp", line 26, in <module>
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT:     from deadline.cinema4d_adaptor.Cinema4DClient.cinema4d_client import main
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT: (null)  File "C:\Program Files\Python311\Lib\site-packages\deadline\cinema4d_adaptor\Cinema4DClient\__init__.py", line 3, in <module>
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT:     from .cinema4d_client import Cinema4DClient
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT: (null)  File "C:\Program Files\Python311\Lib\site-packages\deadline\cinema4d_adaptor\Cinema4DClient\cinema4d_client.py", line 14, in <module>
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT:     from openjd.adaptor_runtime_client import (
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT: (null)ImportError: cannot import name 'HTTPClientInterface' from 'openjd.adaptor_runtime_client' (C:\Program Files\Python311\Lib\site-packages\openjd\adaptor_runtime_client\__init__.py)
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDERR: QFileSystemWatcher: Removable drive notification will not work if there is no QCoreApplication instance.
2024/06/12 10:09:36-07:00 ADAPTOR_OUTPUT: STDOUT: (null)Failed to watch these AWS Deadline Cloud configurations: ['C:\\Users\\deadline-worker\\.aws']
2024/06/12 10:09:37-07:00 ADAPTOR_OUTPUT: STDOUT: (null)Traceback (most recent call last):
2024/06/12 10:09:37-07:00 ADAPTOR_OUTPUT: STDOUT: (null)  File "C:\Program Files\Python311\Lib\site-packages\deadline\cinema4d_adaptor\Cinema4DClient\plugin\DeadlineCloudClient.pyp", line 42, in PluginMessage
2024/06/12 10:09:37-07:00 ADAPTOR_OUTPUT: STDOUT: (null)    return parse_argv(sys.argv)
2024/06/12 10:09:37-07:00 ADAPTOR_OUTPUT: STDOUT: (null)           ^^^^^^^^^^^^^^^^^^^^
2024/06/12 10:09:37-07:00 ADAPTOR_OUTPUT: STDOUT: (null)  File "C:\Program Files\Python311\Lib\site-packages\deadline\cinema4d_adaptor\Cinema4DClient\plugin\DeadlineCloudClient.pyp", line 35, in parse_argv
2024/06/12 10:09:37-07:00 ADAPTOR_OUTPUT: STDOUT: (null)    main()
2024/06/12 10:09:37-07:00 ADAPTOR_OUTPUT: STDOUT: (null)    ^^^^
2024/06/12 10:09:37-07:00 ADAPTOR_OUTPUT: STDOUT: (null)NameError: name 'main' is not defined. Did you mean: 'min'?
2024/06/12 10:09:38-07:00 ADAPTOR_OUTPUT: STDOUT: MaxonEnd: 06/12/24 at 17:09:37
2024/06/12 10:09:38-07:00 openjd_fail: Error encountered while starting adaptor: Cinema4D encountered an error and was not able to complete initialization actions.
2024/06/12 10:09:38-07:00 ERROR: Entrypoint failed: STDOUT: MaxonEnd: 06/12/24 at 17:09:37
2024/06/12 10:09:38-07:00  
2024/06/12 10:09:38-07:00 openjd_fail: Error encountered while starting adaptor: Cinema4D encountered an error and was not able to complete initialization actions.

The first error thrown is a failure to import HTTPClientInterface in this file: https://github.com/OpenJobDescription/openjd-adaptor-runtime-for-python/blob/mainline/src/openjd/adaptor_runtime_client/__init__.py

The problem is that import is not supposed to happen on a Windows because of the check on line 10.

Reproduction Steps

Start a Windows CMF worker. Install C4D Install Python 3.11.4 pip install deadline-cloud-for-cinema4d and the worker agent Add C4D and python to path Configure the worker agent Set DEADLINE_CLOUD_PYTHONPATH, DEADLINE_CINEMA4D_EXE, and g_additionalModulePath Run "C:\Program Files\Maxon Cinema 4D 2024\resource\modules\python\libs\win64\python.exe" -m ensurepip
"C:\Program Files\Maxon Cinema 4D 2024\resource\modules\python\libs\win64\python.exe" -m pip install pywin32 "C:\Program Files\Maxon Cinema 4D 2024\resource\modules\python\libs\win64\python.exe" -m pip install xxhash

Submit a job and try to render it.

Code Snippet

n/a

epmog commented 3 months ago

Fix is in here: https://github.com/aws-deadline/deadline-cloud-for-cinema-4d/pull/44 but has not been released yet

yuanmich2 commented 2 months ago

I updated my adaptor to the latest release and I'm no longer getting this error.