Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builtin_tasks.remove_old_jobs error #1075

Closed
ewjoachim opened this issue Jun 17, 2024 Discussed in #1073 · 4 comments · Fixed by #1076
Closed

builtin_tasks.remove_old_jobs error #1075

ewjoachim opened this issue Jun 17, 2024 Discussed in #1073 · 4 comments · Fixed by #1076

Comments

@ewjoachim
Copy link
Member

ewjoachim commented Jun 17, 2024

Discussed in #1073

Originally posted by @vedanthshetty-739 June 14, 2024
Hi Team,
I'm using Procrastinate in one of my project.
earlier i was using version 0.29.1 now moved to 2.30.0.
Now I'm getting error while calling this built in remove_old_jobs to clean Procrastinate record.,
while debugging I found it's failing in sql query.
error: WHERE job.status = ANY(ARRAY['succeeded','failed'])

Could you please let us know on this issue once.

@ewjoachim
Copy link
Member Author

earlier i was using version 0.29.1 now moved to 2.30.0.

Woo, let me know how the future looks like (the latest released version is 2.3.0) :)

Jokes apart: can you let us know the version of the PG server, and the exact error (you mentionned where the error is, which is great, but I need to know what the error is as well)

@vedanthshetty-739
Copy link

vedanthshetty-739 commented Jun 17, 2024

@ewjoachim Thanks for the reply.
I'm currently using postgres:16-alpine used postgres:11-alpine as well, in both the version i'm getting the same error.

Here is the complete traceback:

Traceback` (most recent call last):\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/procrastinate/contrib/aiopg/aiopg_connector.py\", line 31, in wrap_exceptions\n yield\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/contextlib2/__init__.py\", line 125, in inner\n return await func(*args, **kwds)\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/procrastinate/contrib/aiopg/aiopg_connector.py\", line 62, in wrapped\n return await coro(*args, **kwargs)\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/procrastinate/contrib/aiopg/aiopg_connector.py\", line 246, in execute_query_async\n await cursor.execute(query, self._wrap_json(arguments))\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/aiopg/connection.py\", line 426, in execute\n await self._conn._poll(waiter, timeout)\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/aiopg/connection.py\", line 881, in _poll\n await asyncio.wait_for(self._waiter, timeout)\n File \"/opt/conda/envs/env/lib/python3.9/asyncio/tasks.py\", line 479, in wait_for\n return fut.result()\n File \"/opt/conda/envs/env/lib/python3.9/asyncio/futures.py\", line 201, in result\n raise self._exception\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/aiopg/connection.py\", line 788, in _ready\n state = self._conn.poll()\npsycopg2.errors.UndefinedFunction: operator does not exist: procrastinate_job_status = text\nLINE 10: WHERE job.status = ANY(ARRAY['succeeded','failed'])\n ^\nHINT: No operator matches the given name and argument types. You might need to add explicit type casts.\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/usr/src/python-app/async_jobs/scheduled_system_jobs.py\", line 81, in cleanup_old_jobs\n await builtin_tasks.remove_old_jobs(\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/procrastinate/builtin_tasks.py\", line 32, in remove_old_jobs\n await context.app.job_manager.delete_old_jobs(\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/procrastinate/manager.py\", line 202, in delete_old_jobs\n await self.connector.execute_query_async(\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/contextlib2/__init__.py\", line 125, in inner\n return await func(*args, **kwds)\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/contextlib2/__init__.py\", line 246, in __aexit__\n await self.gen.athrow(typ, value, traceback)\n File \"/opt/conda/envs/env/lib/python3.9/site-packages/procrastinate/contrib/aiopg/aiopg_connector.py\", line 35, in wrap_exceptions\n raise exceptions.ConnectorException from exc\nprocrastinate.exceptions.ConnectorException: \n Database error.\n "

@ewjoachim
Copy link
Member Author

So the issue is No operator matches the given name and argument types. You might need to add explicit type casts

@ewjoachim
Copy link
Member Author

https://github.com/procrastinate-org/procrastinate/releases/tag/2.4.0

I believe it should be fixed in the new release. Feel free to reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants