awx icon indicating copy to clipboard operation
awx copied to clipboard

AWX task error: django.db.utils.ProgrammingError: trailing junk after numeric literal at or near 10m, LINE 1: SET idle_in_transaction_session_timeout = 500s

Open jerryqzhang opened this issue 6 months ago • 9 comments

Please confirm the following

  • [X] I agree to follow this project's code of conduct.
  • [X] I have checked the current issues for duplicates.
  • [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • [X] I am NOT reporting a (potential) security vulnerability. (These should be emailed to [email protected] instead.)

Bug Summary

awx task error "django.db.utils.ProgrammingError: trailing junk after numeric literal at or near..." when pg config "idle_in_transaction_session_timeout"

AWX version

24.6.1

Select the relevant components

  • [ ] UI
  • [ ] UI (tech preview)
  • [X] API
  • [ ] Docs
  • [ ] Collection
  • [ ] CLI
  • [ ] Other

Installation method

openshift

Modifications

no

Ansible version

No response

Operating system

No response

Web browser

Chrome

Steps to reproduce

  1. openshift use awx operator 2.19.1
  2. use default config install awxoperator and awx instance
  3. exec pg container change pc config, set global idle_in_transaction_session_timeout to 600000 or other value, pg store will change the unit, restart the pg process
  4. check the awx task log, find the error

Expected results

no error log

Actual results

many error log similar to " django.db.utils.ProgrammingError: trailing junk after numeric literal at or near "500s" LINE 1: SET idle_in_transaction_session_timeout = 500s"

Additional information

2024-07-29 05:25:58,176 ERROR    [-] awx.main.dispatch Worker failed to run task awx.main.tasks.system.awx_periodic_scheduler(*[], **{}
 Traceback (most recent call last):
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/db/backends/utils.py", line 87, in _execute
     return self.cursor.execute(sql)
            ^^^^^^^^^^^^^^^^^^^^^^^^
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
     raise ex.with_traceback(None)
 psycopg.errors.SyntaxError: trailing junk after numeric literal at or near "500s"
 LINE 1: SET idle_in_transaction_session_timeout = 500s
                                                   ^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/awx/main/dispatch/worker/task.py", line 103, in perform_work
     result = self.run_callable(body)
              ^^^^^^^^^^^^^^^^^^^^^^^
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/awx/main/dispatch/worker/task.py", line 78, in run_callable
     return _call(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/awx/main/tasks/system.py", line 719, in awx_periodic_scheduler
     with advisory_lock('awx_periodic_scheduler_lock', lock_session_timeout_milliseconds=lock_session_timeout_milliseconds, wait=False) as acquired:
   File "/usr/lib64/python3.11/contextlib.py", line 144, in exit
     next(self.gen)
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/awx/main/utils/pglock.py", line 26, in advisory_lock
     cur.execute(f"SET idle_in_transaction_session_timeout = {idle_in_transaction_session_timeout}")
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
     return self._execute_with_wrappers(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
     return executor(sql, params, many, context)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
     with self.db.wrap_database_errors:
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/db/utils.py", line 91, in exit
     raise dj_exc_value.with_traceback(traceback) from exc_value
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/django/db/backends/utils.py", line 87, in _execute
     return self.cursor.execute(sql)
            ^^^^^^^^^^^^^^^^^^^^^^^^
   File "/var/lib/awx/venv/awx/lib64/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
     raise ex.with_traceback(None)
 django.db.utils.ProgrammingError: trailing junk after numeric literal at or near "500s"
 LINE 1: SET idle_in_transaction_session_timeout = 500s

jerryqzhang avatar Jul 29 '24 05:07 jerryqzhang