question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ambiguous PSQL function when `delete_job` undefined

See original GitHub issue

Summary

When delete_job of the current procrastinate_finish_job function is None, the current procrastinate_finish_job, defined here, becomes ambiguous with the old(est) one defined here.

Trace

The resulting bug looks like:

  File "aiopg/connection.py", line 106, in _ready
    state = self._conn.poll()
psycopg2.errors.AmbiguousFunction: function procrastinate_finish_job(integer, unknown, unknown) is not unique
LINE 1: SELECT procrastinate_finish_job(4, 'succeeded', NULL);
               ^
HINT:  Could not choose a best candidate function. You might need to add explicit type casts.

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

[...]
 File "/procrastinate/worker.py", line 171, in process_job
    await self.job_manager.finish_job(
 File "/procrastinate/manager.py", line 135, in finish_job
    await self.connector.execute_query_async(
 File "/procrastinate/aiopg_connector.py", line 35, in wrapped
    raise exceptions.ConnectorException from exc
procrastinate.exceptions.ConnectorException: 
    Database error.

Sadly, I don’t have a minimal example for reproduction at the moment. The error occured when starting one worker after a job was deferred.

A possible solution would be enforcing a boolean value of the delete_job param of finish_job.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
BracketJohncommented, Jan 26, 2021

Sure thing.

From our perspective no worries - migrating to 0.18 is no problem/was already done, just not locally. However, I do see that this may be a problem for others and for the contract you’ve defined.

0reactions
elemoinecommented, Jan 26, 2021

Thanks for confirming that the failing instance ran on v0.17.x. That makes more sense now. We’ll see how we can fix that. Sorry for the trouble.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why postgres trigger function returns some columns ...
I have no idea why. It returns an error: ERROR: column reference "sum_value" is ambiguous LINE 13: sum_value = sum_value + delta_value. Where ......
Read more >
Documentation: 8.4: PostgreSQL Error Codes
Error Code Meaning Condition Name 00000 SUCCESSFUL COMPLETION successful_completion 01000 WARNING warning 0100C DYNAMIC RESULT SETS RETURNED dynamic_result_sets_returned
Read more >
Column name qualifiers to avoid ambiguity - Db2 SQL
Avoiding undefined or ambiguous references in Db2 SQL: When a column name refers to values of a column, the following situations result in...
Read more >
postgresql - 42702 'column reference "id" is ambiguous' for ...
The solution is to qualify all columns from RETURNING which have the same name as the columns from RETURNS TABLE with the name...
Read more >
How to solve "ambiguous column" warning in PostgreSQL ...
Minimal SQL file that can be loaded into a clean database: create function sc.authenticate(_email text) returns sc.jwt_token as $$ declare ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found