Skip to content

Unable to parser server version from Yugabyte #771

New issue

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

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

Already on GitHub? # to your account

Closed
zopyx opened this issue Jun 16, 2021 · 0 comments
Closed

Unable to parser server version from Yugabyte #771

zopyx opened this issue Jun 16, 2021 · 0 comments

Comments

@zopyx
Copy link

zopyx commented Jun 16, 2021

  File "/home/ajung/src/fastapi/lib/python3.8/site-packages/asyncpg/connection.py", line 86, in __init__
    serverversion.split_server_version_string(ver_string)
  File "/home/ajung/src/fastapi/lib/python3.8/site-packages/asyncpg/serverversion.py", line 50, in split_server_version_string
    versions = [int(p) for p in parts][:3]
  File "/home/ajung/src/fastapi/lib/python3.8/site-packages/asyncpg/serverversion.py", line 50, in <listcomp>
    versions = [int(p) for p in parts][:3]
ValueError: invalid literal for int() with base 10: '2-YB-2'

> /home/ajung/src/fastapi/lib/python3.8/site-packages/asyncpg/serverversion.py(51)split_server_version_string()
-> versions = [int(p) for p in parts][:3]
(Pdb) pp parts
['11', 0, '2-YB-2', '4', '1', '0']
@zopyx zopyx changed the title Unable to parser server version against Yugabyte Unable to parser server version from Yugabyte Jun 16, 2021
Natrinicle added a commit to Natrinicle/asyncpg that referenced this issue Jun 25, 2021
MagicStack#250
MagicStack#261
MagicStack#771

Just tried to use this library through Ormar->Databases->AsyncPG against
a Yugabyte cluster and hit issue 771. Looks like this has been a problem
for a while now so going for a complete overhaul of the server version
extraction method. Using a groupdict regex against the version string
allows for much higher flexibility in extracting what we're looking for
and fixes 771 while not breaking any of the existing version patterns.
@elprans elprans closed this as completed in d076169 Aug 2, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant