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

Issue with cookie update function / Illegal key '"s_ips' #102

Open
akdk7 opened this issue Dec 1, 2024 · 2 comments
Open

Issue with cookie update function / Illegal key '"s_ips' #102

akdk7 opened this issue Dec 1, 2024 · 2 comments

Comments

@akdk7
Copy link

akdk7 commented Dec 1, 2024

Hi.

The linkedin bridge is having issues with updating cookies, especially with s_ips.

Here is the stack trace:

matrix-beeper-linkedin[51149]: [2024-11-30 12:09:32,299] [[email protected]] Unexpected error in main event loop
matrix-beeper-linkedin[51149]: Traceback (most recent call last):
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/util/program.py", line 211, in _run
matrix-beeper-linkedin[51149]:     self.loop.run_until_complete(self.start())
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
matrix-beeper-linkedin[51149]:     return future.result()
matrix-beeper-linkedin[51149]:            ^^^^^^^^^^^^^^^
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/linkedin_matrix/__main__.py", line 95, in start
matrix-beeper-linkedin[51149]:     await super().start()
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/bridge/bridge.py", line 256, in start
matrix-beeper-linkedin[51149]:     await super().start()
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/util/program.py", line 246, in start
matrix-beeper-linkedin[51149]:     await asyncio.gather(*(self.startup_actions or []))
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/util/program.py", line 280, in _unpack_async_iterator
matrix-beeper-linkedin[51149]:     await asyncio.gather(*tasks)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/linkedin_matrix/user.py", line 198, in load_session
matrix-beeper-linkedin[51149]:     self.client = LinkedInMessaging.from_cookies_and_headers(
matrix-beeper-linkedin[51149]:                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
matrix-beeper-linkedin[51149]:   File "/opt/linkedin-matrix/linkedin_messaging/linkedin.py", line 150, in from_cookies_and_headers
matrix-beeper-linkedin[51149]:     linkedin.session.cookie_jar.update_cookies(cookies)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/aiohttp/cookiejar.py", line 172, in update_cookies
matrix-beeper-linkedin[51149]:     tmp[name] = cookie  # type: ignore[assignment]
matrix-beeper-linkedin[51149]:     ~~~^^^^^^
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/http/cookies.py", line 498, in __setitem__
matrix-beeper-linkedin[51149]:     self.__set(key, rval, cval)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/http/cookies.py", line 488, in __set
matrix-beeper-linkedin[51149]:     M.set(key, real_value, coded_value)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/http/cookies.py", line 353, in set
matrix-beeper-linkedin[51149]:     raise CookieError('Illegal key %r' % (key,))
matrix-beeper-linkedin[51149]: http.cookies.CookieError: Illegal key '"s_ips'
matrix-beeper-linkedin[51149]: [2024-11-30 12:09:32,301] [[email protected]] Failed to store next batch
matrix-beeper-linkedin[51149]: Traceback (most recent call last):
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/util/program.py", line 211, in _run
matrix-beeper-linkedin[51149]:     self.loop.run_until_complete(self.start())
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
matrix-beeper-linkedin[51149]:     return future.result()
matrix-beeper-linkedin[51149]:            ^^^^^^^^^^^^^^^
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/linkedin_matrix/__main__.py", line 95, in start
matrix-beeper-linkedin[51149]:     await super().start()
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/bridge/bridge.py", line 256, in start
matrix-beeper-linkedin[51149]:     await super().start()
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/util/program.py", line 246, in start
matrix-beeper-linkedin[51149]:     await asyncio.gather(*(self.startup_actions or []))
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/util/program.py", line 280, in _unpack_async_iterator
matrix-beeper-linkedin[51149]:     await asyncio.gather(*tasks)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/linkedin_matrix/user.py", line 198, in load_session
matrix-beeper-linkedin[51149]:     self.client = LinkedInMessaging.from_cookies_and_headers(
matrix-beeper-linkedin[51149]:                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
matrix-beeper-linkedin[51149]:   File "/opt/linkedin-matrix/linkedin_messaging/linkedin.py", line 150, in from_cookies_and_headers
matrix-beeper-linkedin[51149]:     linkedin.session.cookie_jar.update_cookies(cookies)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/aiohttp/cookiejar.py", line 172, in update_cookies
matrix-beeper-linkedin[51149]:     tmp[name] = cookie  # type: ignore[assignment]
matrix-beeper-linkedin[51149]:     ~~~^^^^^^
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/http/cookies.py", line 498, in __setitem__
matrix-beeper-linkedin[51149]:     self.__set(key, rval, cval)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/http/cookies.py", line 488, in __set
matrix-beeper-linkedin[51149]:     M.set(key, real_value, coded_value)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/http/cookies.py", line 353, in set
matrix-beeper-linkedin[51149]:     raise CookieError('Illegal key %r' % (key,))
matrix-beeper-linkedin[51149]: http.cookies.CookieError: Illegal key '"s_ips'
matrix-beeper-linkedin[51149]: During handling of the above exception, another exception occurred:
matrix-beeper-linkedin[51149]: Traceback (most recent call last):
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/client/syncer.py", line 462, in _start
matrix-beeper-linkedin[51149]:     await self.sync_store.put_next_batch(next_batch)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/crypto/store/asyncpg/store.py", line 102, in put_next_batch
matrix-beeper-linkedin[51149]:     await self.db.execute(q, self._sync_token, self.account_id)
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/util/async_db/database.py", line 135, in execute
matrix-beeper-linkedin[51149]:     async with self.acquire() as conn:
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
matrix-beeper-linkedin[51149]:     return await anext(self.gen)
matrix-beeper-linkedin[51149]:            ^^^^^^^^^^^^^^^^^^^^^
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/mautrix/util/async_db/asyncpg.py", line 100, in acquire
matrix-beeper-linkedin[51149]:     async with self.pool.acquire() as conn:
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/asyncpg/pool.py", line 981, in __aenter__
matrix-beeper-linkedin[51149]:     self.connection = await self.pool._acquire(self.timeout)
matrix-beeper-linkedin[51149]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
matrix-beeper-linkedin[51149]:   File "/usr/lib/python3.11/site-packages/asyncpg/pool.py", line 817, in _acquire
matrix-beeper-linkedin[51149]:     raise exceptions.InterfaceError('pool is closing')
matrix-beeper-linkedin[51149]: asyncpg.exceptions._base.InterfaceError: pool is closing

Is is fixable from my side (users side) or did linked in change something so it brakes the bridge?

Thank you for the awesome work!

@halkeye
Copy link

halkeye commented Dec 22, 2024

Is this just randomly happening? or are you trying to login or something? Its so weird that the key has a quote in it.

@akdk7
Copy link
Author

akdk7 commented Dec 22, 2024

Me and another user tired to log into Linkedin and that error appears all the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants