queue icon indicating copy to clipboard operation
queue copied to clipboard

OperationalError: Unable to use a closed cursor

Open m3asmi opened this issue 2 years ago • 3 comments

I have this everytime, the server is runing on multi jobs

2023-11-20 11:51:56,807 2315175 INFO Database werkzeug: 127.0.0.1 - - [20/Nov/2023 11:51:56] "GET /queue_job/runjob?db=tecnibo&job_uuid=592f8f47-3fbd-4811-899d-ee2f22b8fa74 HTTP/1.1" 500 - 43 0.033 0.877
2023-11-20 11:51:56,808 2315183 ERROR ? odoo.addons.queue_job.jobrunner.runner: exception in GET http://localhost:8869/queue_job/runjob?db=tecnibo&job_uuid=592f8f47-3fbd-4811-899d-ee2f22b8fa74 
Traceback (most recent call last):
  File "/odoo/custom/others/queue_job/jobrunner/runner.py", line 242, in urlopen
    response.raise_for_status()
  File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:8869/queue_job/runjob?db=tecnibo&job_uuid=592f8f47-3fbd-4811-899d-ee2f22b8fa74
2023-11-20 11:51:56,810 2315175 ERROR tecnibo werkzeug: Error on request:
Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/odoo/odoo-server/odoo/http.py", line 815, in dispatch
    r = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 368, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 357, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 921, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 546, in response_wrap
    response = f(*args, **kw)
  File "/odoo/custom/others/queue_job/controllers/main.py", line 149, in runjob
    self._enqueue_dependent_jobs(env, job)
  File "/odoo/custom/others/queue_job/controllers/main.py", line 47, in _enqueue_dependent_jobs
    job.enqueue_waiting()
  File "/odoo/custom/others/queue_job/job.py", line 566, in enqueue_waiting
    self.env.cr.execute(sql, (PENDING, self.uuid, DONE, WAIT_DEPENDENCIES))
  File "<decorator-gen-3>", line 2, in execute
    
  File "/odoo/odoo-server/odoo/sql_db.py", line 89, in check
    raise psycopg2.OperationalError('Unable to use a closed cursor.')
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/serving.py", line 306, in run_wsgi
    execute(self.server.app)
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/serving.py", line 294, in execute
    application_iter = app(environ, start_response)
  File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 112, in application
    return application_unproxied(environ, start_response)
  File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 87, in application_unproxied
    result = odoo.http.root(environ, start_response)
  File "/odoo/odoo-server/odoo/http.py", line 1305, in __call__
    return self.dispatch(environ, start_response)
  File "/odoo/odoo-server/odoo/http.py", line 1271, in __call__
    return self.app(environ, start_wrapped)
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
    return self.app(environ, start_response)
  File "/odoo/odoo-server/odoo/http.py", line 1500, in dispatch
    result = ir_http._dispatch()
  File "/odoo/odoo-server/addons/website_sale/models/ir_http.py", line 15, in _dispatch
    return super(IrHttp, cls)._dispatch()
  File "/odoo/odoo-server/addons/website/models/ir_http.py", line 198, in _dispatch
    response = super(Http, cls)._dispatch()
  File "/odoo/odoo-server/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
    return super(Http, cls)._dispatch()
  File "/odoo/odoo-server/addons/web_editor/models/ir_http.py", line 21, in _dispatch
    return super(IrHttp, cls)._dispatch()
  File "/odoo/odoo-server/addons/utm/models/ir_http.py", line 29, in _dispatch
    response = super(IrHttp, cls)._dispatch()
  File "/odoo/odoo-server/addons/http_routing/models/ir_http.py", line 519, in _dispatch
    result = super(IrHttp, cls)._dispatch()
  File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 241, in _dispatch
    return cls._handle_exception(e)
  File "/odoo/odoo-server/addons/utm/models/ir_http.py", line 34, in _handle_exception
    response = super(IrHttp, cls)._handle_exception(exc)
  File "/odoo/odoo-server/addons/http_routing/models/ir_http.py", line 620, in _handle_exception
    return super(IrHttp, cls)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 209, in _handle_exception
    return request._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 759, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
psycopg2.OperationalError: Unable to use a closed cursor. - - -

m3asmi avatar Nov 20 '23 11:11 m3asmi

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar May 19 '24 12:05 github-actions[bot]

@m3asmi do you still have this issue?

simahawk avatar May 20 '24 12:05 simahawk