Skip to content

Issue running migration against DB with sslmode=require #8

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

Open
lossyrob opened this issue Jun 24, 2021 · 3 comments
Open

Issue running migration against DB with sslmode=require #8

lossyrob opened this issue Jun 24, 2021 · 3 comments

Comments

@lossyrob
Copy link
Member

Running migrations against a --dsn that has ?sslmode=require (or with PGSSLMODE=require), I get:

ERROR:asyncio:Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f4882e35e20>
transport: <_SelectorSocketTransport closing fd=8>
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/asyncio/selector_events.py", line 910, in write
    n = self._sock.send(data)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/asyncio/sslproto.py", line 685, in _process_write_backlog
    self._transport.write(chunk)
  File "/opt/conda/lib/python3.8/asyncio/selector_events.py", line 916, in write
    self._fatal_error(exc, 'Fatal write error on socket transport')
  File "/opt/conda/lib/python3.8/asyncio/selector_events.py", line 711, in _fatal_error
    self._force_close(exc)
  File "/opt/conda/lib/python3.8/asyncio/selector_events.py", line 723, in _force_close
    self._loop.call_soon(self._call_connection_lost, exc)
  File "/opt/conda/lib/python3.8/asyncio/base_events.py", line 719, in call_soon
    self._check_closed()
  File "/opt/conda/lib/python3.8/asyncio/base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

I'm able to connect to the database using the same dsn using psql. Any ideas?

@lossyrob
Copy link
Member Author

.. It seems that pypgstac did run the migration, but perhaps this is an error that happens on closing?

I'm not seeing any of the logging output when running pypgstac migrate - perhaps that should be output another way?

@bitner
Copy link
Collaborator

bitner commented Jul 12, 2021

Looks like this is related to MagicStack/asyncpg#737

@bitner
Copy link
Collaborator

bitner commented Jul 15, 2021

I think this might be fixed in asyncpg 2.3
MagicStack/asyncpg#720

I'll try updating the asyncpg version pin.

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

No branches or pull requests

2 participants