Skip to content
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

build failed due to aioapns dependency version #293

Closed
laurent-treeb opened this issue Jan 21, 2022 · 5 comments · Fixed by #294
Closed

build failed due to aioapns dependency version #293

laurent-treeb opened this issue Jan 21, 2022 · 5 comments · Fixed by #294

Comments

@laurent-treeb
Copy link

"aioapns>=1.10",

aioapns 2.1 introduced a breaking change. (remove loop on APNS instantiation).

to fix it, set the dep to :

"aioapns==2.0.2",
@DMRobertson
Copy link
Contributor

Hi @laurent-dol, could you explain what the breakage is here---which build failed, and how?

@DMRobertson DMRobertson added the X-Needs-Info This issue is blocked awaiting information from the reporter label Jan 24, 2022
@laurent-treeb
Copy link
Author

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).

@DMRobertson DMRobertson removed the X-Needs-Info This issue is blocked awaiting information from the reporter label Jan 27, 2022
@richvdh richvdh changed the title build failed due to aioapns dependancy version build failed due to aioapns dependency version Jan 27, 2022
@DMRobertson
Copy link
Contributor

the created image fails to run with a script error

Interesting---could you share traceback from the error message?

@laurent-treeb
Copy link
Author

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)
--- ---
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 1661, in _inlineCallbacks
result = current_context.run(gen.send, result)
File "/usr/local/lib/python3.7/site-packages/sygnal/sygnal.py", line 200, in make_pushkins_then_start
self.pushkins[app_id] = await self._make_pushkin(app_id, app_cfg)
File "/usr/local/lib/python3.7/site-packages/sygnal/sygnal.py", line 195, in _make_pushkin
return await clarse.create(app_name, self, app_config)
File "/usr/local/lib/python3.7/site-packages/sygnal/notifications.py", line 169, in create
return cls(name, sygnal, config)
File "/usr/local/lib/python3.7/site-packages/sygnal/apnspushkin.py", line 188, in init
loop=loop,
builtins.TypeError: init() got an unexpected keyword argument 'loop'

@DMRobertson
Copy link
Contributor

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 Fatal1ty/aioapns#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!

DMRobertson pushed a commit that referenced this issue Jan 27, 2022
Fixes #293.

aioapns 2.1 made a breaking change: one can no longer pass an event loop directly to APNs.__init__. We could change our code to fix it, but (regrettably) I think it's quicker to avoid using that version. See also #293 (comment)
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

Successfully merging a pull request may close this issue.

2 participants