Closed laurent-treeb closed 2 years ago
Hi @laurent-dol, could you explain what the breakage is here---which build failed, and how?
The build with the Dockerfile. It doesn't failed, but the created image fails to run with a script error introduced by the new aioapns version (when an apns app id is configured).
the created image fails to run with a script error
Interesting---could you share traceback from the error message?
2022-01-27 16:20:19,618 [1] INFO main Importing pushkin module: sygnal.apnspushkin
2022-01-27 16:20:19,657 [1] INFO main Creating pushkin: ApnsPushkin
2022-01-27 16:20:19,659 [1] ERROR main Failed to load and create pushkin for kind 'apns'
Error during startup:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sygnal/sygnal.py", line 228, in start
yield ensureDeferred(self.make_pushkins_then_start())
File "/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line 1130, in ensureDeferred
return Deferred.fromCoroutine(coro)
File "/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line 1106, in fromCoroutine
return _cancellableInlineCallbacks(coro)
File "/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line 1816, in _cancellableInlineCallbacks
_inlineCallbacks(None, gen, status)
---
Ahh, I see! I thought when you said "remove loop" you meant the change here to limit the number of times aioapns will repeat a retry loop. But instead the loop argument was removed in https://github.com/Fatal1ty/aioapns/pull/32. I'm not sure what the reason for that was, but I'd guess it's related to this note from the Python 3.10 changelog:
asyncio.get_event_loop() now emits a deprecation warning if there is no running event loop. In the future it will be an alias of get_running_loop(). asyncio functions which implicitly create Future or Task objects now emit a deprecation warning if there is no running event loop and no explicit loop argument is passed: ensure_future(), wrap_future(), gather(), shield(), as_completed() and constructors of Future, Task, StreamReader, StreamReaderProtocol. (Contributed by Serhiy Storchaka in bpo-39529.)
Pinning the dependency sounds like the best way to go. Thank you for reporting!
https://github.com/matrix-org/sygnal/blob/bd1c408902988c624ee6c87e97ec6af454698156/setup.py#L25
aioapns 2.1 introduced a breaking change. (remove loop on APNS instantiation).
to fix it, set the dep to :