Aria Automation Config error: "NameError: name 'math' is not defined"
search cancel

Aria Automation Config error: "NameError: name 'math' is not defined"

book

Article ID: 375483

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite) SaltStack entitlement to VMware VMware SaltStack

Issue/Introduction

Symptoms:

  • Error 404 seen in UI when upgraded to 8.17.0.6 and NameError Exception Aria Config in RaaS Log
    • This may only show when the raas service has been up for some time.
    • Restarting the Aria Automation Config allows users to log in again for an indeterminate amount of time. 
  • After upgrading to Aria Automation Config the error message "NameError: name 'math' is not defined" is seen repeated in the /var/log/raas/raas log.
  • Experiencing issues with external authentication methods in Aria Config and see messages like the following in /var/log/raas/raas

 

##-#-# #:#:# [org_id:None][celery.app.trace  ][ERROR   :216 ][ForkPoolWorker-2:XXX] Task sync_auth_backends[##-#-#-#-####] raised unexpected: NameError("name 'math' is not defined")
Traceback (most recent call last):
  File "celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
  File "raas/utils/org.py", line 194, in wraps
    return func(*args, **kwargs)
  File "raas/tasks/__init__.py", line 21, in __call__
    return self.run(*args, **kwargs)
  File "raas/tasks/__init__.py", line 94, in wrapper
    return target(*args, **kwargs)
  File "raas/tasks/auth.py", line 46, in sync_auth_backends
    self.app.hub.db.op.sync_auth_backends()
  File "pop/contract.py", line 170, in __call__
    return self.func(*args, **kwargs)
  File "/var/lib/raas/unpack/_####/raas/mods/db/sqla.py", line 13362, in sync_auth_backends
NameError: name 'math' is not defined

 

Or with the error traceback above finishing as follows:

[...]
  File "/var/lib/raas/unpack/_####/raas/mods/db/sqla.py", line 13362, in sync_auth_backends
    elapsed = math.floor((now - auth_config["last_sync"]).total_seconds() / 60)
NameError: name 'math' is not defined

or:

[...]
  File "/var/lib/raas/unpack/_####/raas/mods/db/sqla.py", line 13365, in sync_auth_backends
    remain = math.ceil(auth_config["data"]["sync_schedule"]) - elapsed
NameError: name 'math' is not defined

Environment

VMware Aria Config 8.17.0.6

 

Cause

This is due to a known defect in this version of RaaS. 

Resolution

To resolve this issue you will need to upgrade the RaaS daemon.

To obtain the updated version 8.17.0.30, please file a Broadcom Support Request and reference this Knowledge article #375483 and your version of Aria Config.

 

Workaround

Restarting the raas service may provide temporary relief from the issue:

systemctl restart raas

Additional Information

If you are not able to upgrade further then another solution is to downgrade back to 8.16.2.x if you have a good backup.

Please see the article Backing Up and Restoring Your Postgresql Database for RaaS or Aria Config for information on how to create to backups prior to upgrades.