queue icon indicating copy to clipboard operation
queue copied to clipboard

Cannot install queue_job on odoo 16/windows (OSError: [WinError 10038] An operation was attempted on something that is not a socket)

Open johancitybee opened this issue 2 years ago • 3 comments

When installing queue_job on odoo 16 community + enterprise edition, the queue_job does not start correctly (although jobs seems to be aunched correctly) and the log displays the same error message every 5 seconds

Module

queue_job

Describe the bug

After installing the module on a pristine DB running odoo 16 and following installation instructions (server_wide_modules = web,web_kanban,queue_job), restarting odoo, the following error message shows up every 5 seconds: 2023-09-25 19:48:32,476 4704 INFO ? odoo.addons.queue_job.jobrunner.runner: initializing database connections 2023-09-25 19:48:32,591 4704 INFO ? odoo.addons.queue_job.jobrunner.runner: queue job runner ready for db dev16 2023-09-25 19:48:32,591 4704 INFO ? odoo.addons.queue_job.jobrunner.runner: database connections ready 2023-09-25 19:48:32,591 4704 ERROR ? odoo.addons.queue_job.jobrunner.runner: exception: sleeping 5s and retrying Traceback (most recent call last): File "c:\git\wr-odoo-addons\3rd-parties\addons\queue_job\jobrunner\runner.py", line 521, in run self.wait_notification() File "c:\git\wr-odoo-addons\3rd-parties\addons\queue_job\jobrunner\runner.py", line 494, in wait_notification events = sel.select(timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\selectors.py", line 323, in select r, w, _ = self._select(self._readers, self._writers, [], timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\selectors.py", line 314, in _select r, w, x = select.select(r, w, w, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [WinError 10038] An operation was attempted on something that is not a socket

To Reproduce

16.0.2.5.0

Steps to reproduce the behavior:

  1. Install queue_job on a new DB running odoo 16 / odoo enterrpsie 16 on windows 11
  2. Restart odoo-bin with server_wide_modules conf
  3. Error message shows up.

Expected behavior Not sure the error message should pop up, although feature seems to be working properly

Additional context Windows 11 / python 3.11.4 / pip 23.1.2

johancitybee avatar Sep 25 '23 19:09 johancitybee

I encounter the same issue, and, it is filling the logs with exceptions. The cause is actually described here: https://docs.python.org/3/library/select.html#select.select. Calling select() on something that is not a winsock thing on windows results in this specific error.

The none winsock thing in the list of connections is a pipe that is created. See runner.py, line 368 self._stop_pipe = os.pipe()

This is added to the list of connections (runner.py line 472) to interrupt the select when the stop function is called (runner.py line 505)

This is probably done to free the select call that would otherwise be blocking if no data would be send over the sockets (and you have to wait for the select timeout).

Unfortunately, even though the cause is clear, I do not have a solution (yet)

wimvanhouts avatar Oct 12 '23 11:10 wimvanhouts

Has anyone found a solution?

nesryn avatar Jan 10 '24 14:01 nesryn

I believe I have this resolved in this PR: https://github.com/OCA/queue/pull/647

Maralai avatar May 07 '24 20:05 Maralai