roscisz / TensorHive

Tool for managing exclusive GPU access for distributed machine learning workloads
Apache License 2.0
155 stars 27 forks source link

NoneType object has not attribute get #375

Open willyd opened 2 years ago

willyd commented 2 years ago

NoneType object has not attribute get

Tensorhive works great but I get the error messages below on every startup. Everything seems to work fine. Is this something I should worry about?

INFO     | 2022-09-29 07:57:41 | MainThread                     | MSG: [⚙] Starting Vue web app with gunicorn backend                                  | FROM: tensorhive.app.web.AppServer
INFO     | 2022-09-29 07:57:41 | MainThread                     | MSG: [✔] Web App available at: http://0.0.0.0:5000                     | FROM: tensorhive.app.web.AppServer
ERROR    | 2022-09-29 07:57:41 | UsageLoggingService_Thread-4   | MSG: 'NoneType' object has no attribute 'get'                               | FROM: tensorhive.core.services.UsageLoggingService
ERROR    | 2022-09-29 07:57:41 | UsageLoggingService_Thread-4   | MSG: 'NoneType' object has no attribute 'get'                               | FROM: tensorhive.core.services.UsageLoggingService

Your environment

List relevant info:

Expected behaviour

No Error messages

Actual behaviour

Error messages corresponding to attribute error on NoneType object.

willyd commented 1 year ago

This line is causing the error: https://github.com/roscisz/TensorHive/blob/master/tensorhive/core/services/UsageLoggingService.py#L237 Would it make sense to change it to:

# gpu_data = infrastructure[hostname].get('GPU').get(uuid)
gpu_data = infrastructure[hostname].get('GPU', {}).get(uuid)

?