Error log - 'NoneType' object has no attribute 'loop'

My controller is not operating as I expected it would.

After restarting the daemon server and checking the daemon logs, there appears to be an error, but I am unsure what has caused it and how to fix it (searched for the error message and also checked my inputs, outputs & functions)?

Can someone explain if this is a major issue?

AttributeError: 'NoneType' object has no attribute 'loop'
2021-10-10 13:58:09,913 - INFO - mycodo.daemon - Mycodo daemon v8.12.6 starting
2021-10-10 13:58:11,377 - INFO - mycodo.outputs.kp303_c983552d - Initialized in 564.4 ms
2021-10-10 13:58:11,957 - INFO - mycodo.outputs.kp303_d109aaaa - Initialized in 576.6 ms
2021-10-10 13:58:11,959 - INFO - mycodo.controllers.controller_output - Activated in 1604.6 ms
2021-10-10 13:58:12,461 - INFO - mycodo.daemon - All activated Conditional controllers started
2021-10-10 13:58:12,461 - INFO - mycodo.daemon - All activated Trigger controllers started
2021-10-10 13:58:12,842 - INFO - mycodo.controllers.controller_input_177ea012 - Activated in 239.1 ms
2021-10-10 13:58:13,179 - INFO - mycodo.controllers.controller_input_5e0431a1 - Activated in 181.8 ms
2021-10-10 13:58:13,567 - INFO - mycodo.controllers.controller_input_f0e2e8d7 - Activated in 197.6 ms
2021-10-10 13:58:14,017 - INFO - mycodo.controllers.controller_input_6b2fa857 - Activated in 183.0 ms
2021-10-10 13:58:14,018 - INFO - mycodo.daemon - All activated Input controllers started
2021-10-10 13:58:14,019 - INFO - mycodo.daemon - All activated Math controllers started
2021-10-10 13:58:14,020 - INFO - mycodo.daemon - All activated PID controllers started
2021-10-10 13:58:14,020 - INFO - mycodo.daemon - All activated LCD controllers started
2021-10-10 13:58:14,260 - ERROR - mycodo.controllers.controller_function_a1d10220 - initialize_variables() Exception: module 'mycodo.function.function_spacer' has no attribute 'CustomModule'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 74, in run
    self.initialize_variables()
  File "/var/mycodo-root/mycodo/controllers/controller_function.py", line 110, in initialize_variables
    self.run_function = function_loaded.CustomModule(self.function)
AttributeError: module 'mycodo.function.function_spacer' has no attribute 'CustomModule'
2021-10-10 13:58:14,261 - INFO - mycodo.controllers.controller_function_a1d10220 - Activated in 108.0 ms
2021-10-10 13:58:14,262 - ERROR - mycodo.controllers.controller_function_a1d10220 - Exception while running loop(): 'NoneType' object has no attribute 'loop'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_function.py", line 71, in loop
    self.run_function.loop()
AttributeError: 'NoneType' object has no attribute 'loop'
2021-10-10 13:58:14,516 - ERROR - mycodo.controllers.controller_function_a1d10220 - Exception while running loop(): 'NoneType' object has no attribute 'loop'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_function.py", line 71, in loop
    self.run_function.loop()
AttributeError: 'NoneType' object has no attribute 'loop'
2021-10-10 13:58:14,643 - ERROR - mycodo.controllers.controller_function_720e9792 - initialize_variables() Exception: module 'mycodo.function.function_spacer' has no attribute 'CustomModule'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 74, in run
    self.initialize_variables()
  File "/var/mycodo-root/mycodo/controllers/controller_function.py", line 110, in initialize_variables
    self.run_function = function_loaded.CustomModule(self.function)
AttributeError: module 'mycodo.function.function_spacer' has no attribute 'CustomModule'
2021-10-10 13:58:14,646 - INFO - mycodo.controllers.controller_function_720e9792 - Activated in 224.2 ms
2021-10-10 13:58:14,647 - ERROR - mycodo.controllers.controller_function_720e9792 - Exception while running loop(): 'NoneType' object has no attribute 'loop'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_function.py", line 71, in loop
    self.run_function.loop()
AttributeError: 'NoneType' object has no attribute 'loop'
2021-10-10 13:58:14,648 - INFO - mycodo.daemon - All activated Function controllers started
2021-10-10 13:58:14,772 - ERROR - mycodo.controllers.controller_function_a1d10220 - Exception while running loop(): 'NoneType' object has no attribute 'loop'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_function.py", line 71, in loop
    self.run_function.loop()
AttributeError: 'NoneType' object has no attribute 'loop'
2021-10-10 13:58:14,899 - ERROR - mycodo.controllers.controller_function_720e9792 - Exception while running loop(): 'NoneType' object has no attribute 'loop'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_function.py", line 71, in loop
    self.run_function.loop()

Are you running the latest version?

Yes. This is the message on the upgrade screen:

No upgrade is available. You are running the latest release, version 8.12.6

Do you have empty elements on the function page?

No. I have double checked them. All are assigned and activated.

Try deleting the spacers and adding them again.

I deleted the spacers for the functions. The error still occurred.

I then deleted all the spacers for the inputs and outputs. The error still occurred.

I then deleted all the inputs, all the outputs and all the functions. The error was resolved.

I added back all the spacers, all the inputs, all the outputs and all the functions. The error did not occur.

Problem solved.

1 Like