-
Notifications
You must be signed in to change notification settings - Fork 418
Intermittent "RuntimeError: no decoder for OID 1015" #241
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Comments
OID 1015 is |
@elprans no schema changes in a long time |
Are you calling |
class PostgreSQLRepository:
MIN_POOL_SIZE = 10
MAX_POOL_SIZE = 20
MAX_CONNECTION_LIFETIME = 300 # seconds
def __init__(self, db_host, db_port, db_name, db_user, db_password):
self.pool = None
self._host = db_host
self._port = db_port
self._database = db_name
self._user = db_user
self._password = db_password
async def init_jsonb_codec(self, connection):
def _encoder(value):
return ujson.dumps(value)
def _decoder(value):
return ujson.loads(value)
await connection.set_type_codec('jsonb', encoder=_encoder, decoder=_decoder, schema='pg_catalog', format='text')
async def setup(self, loop):
self.pool = await asyncpg.create_pool(
host=self._host,
port=self._port,
database=self._database,
user=self._user,
password=self._password,
loop=loop,
min_size=self.MIN_POOL_SIZE,
max_size=self.MAX_POOL_SIZE,
max_inactive_connection_lifetime=self.MAX_CONNECTION_LIFETIME,
init=self.init_jsonb_codec
)
async def teardown(self):
await self.pool.close() |
Yea. That seems to be the cause of the race. Sit tight, I'll have the fix soon. |
Currently the statement codecs are populated just before the first Bind is issued. This is problematic as in the time since Prepare, the codec cache for derived types (arrays, composites etc.) may have been purged by an installation of a custom codec, or general schema state invalidation. Fix this by populating the codecs immediately after the statement data types have been resolved. Fixes: #241.
Currently the statement codecs are populated just before the first Bind is issued. This is problematic as in the time since Prepare, the codec cache for derived types (arrays, composites etc.) may have been purged by an installation of a custom codec, or general schema state invalidation. Fix this by populating the codecs immediately after the statement data types have been resolved. Fixes: #241.
Currently the statement codecs are populated just before the first Bind is issued. This is problematic as in the time since Prepare, the codec cache for derived types (arrays, composites etc.) may have been purged by an installation of a custom codec, or general schema state invalidation. Fix this by populating the codecs immediately after the statement data types have been resolved. Fixes: #241.
the issue with a local PostgreSQL install?: AWS RDS
uvloop?: N/A
I'm seeing intermittent errors in my logs:
The query is very simple:
table:
I've checked and OID 1015 is not defined in asyncpg (https://github.com/MagicStack/asyncpg/blob/master/asyncpg/protocol/pgtypes.pxi), but what bothers me is that I'm not able to reproduce the problem myself. I'm trying to send the same request to our API which caused this error and I don't get any errors in return. So it might not be caused by undefined OID for varchar_array (as found https://jdbc.postgresql.org/development/privateapi/constant-values.html), but something else. Unfortunately I'm out of ideas how to debug it and reproduce, so maybe you could help me with finding the root cause for those errors - please let me know what additional information would be useful to debug it.
The text was updated successfully, but these errors were encountered: