-
Notifications
You must be signed in to change notification settings - Fork 31
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
ReplayMarkerStorage with PgSQL not working with a saved replay id #19
Comments
welcomemat-services
changed the title
Help needed with my custom replay marker storage
ReplayMarkerStorage with PgSQL not working with a saved replay id
Feb 11, 2022
This was referenced Feb 11, 2022
Closed
This is the code I am using and it works for me
|
Same issue. The problem was on replay_id data type. Must be int!!! |
@trankos thanks, that saved me some hair-pulling |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the below code that is working if the Pgsql table is empty. But if it pulls an existing replay id, it is throwing the below exception.
Thanks for any help provided here.
Code:
Error log:
DEBUG:asyncio:Using proactor: IocpProactor
Connected to DB
DEBUG:aiosfstream.client:Client created with replay storage: <main.MyReplayMarkerStorage object at 0x0000024E0287CA30>, replay fallback: <ReplayOption.ALL_EVENTS: -2>
DEBUG:aiosfstream.client:Authenticating using PasswordAuthenticator(consumer_key='xxxxx',consumer_secret='yyyyy', username='test.test.com', password='abcde').
INFO:aiosfstream.client:Successful authentication. Instance URL: 'https://test.my.salesforce.com'.
INFO:aiocometd.client:Opening client with connection types ['websocket', 'long-polling'] ...
INFO:aiocometd.client:Connection types supported by the server: ['long-polling']
DEBUG:aiocometd.transports.base:Connect task finished with: {'clientId': 'kvl2mi3sd9hs6ei1m3vnsilh4nb9', 'advice': {'interval': 0, 'timeout': 110000, 'reconnect': 'retry'}, 'channel': '/meta/connect', 'id': '1', 'successful': True}
INFO:aiocometd.client:Client opened with connection_type 'long-polling'
/event/Notification__e - 7785481 - 2022-02-10T23:23:49.572Z
INFO:aiocometd.client:Closing client...
ERROR:asyncio:Exception in callback TransportBase._connect_done(<Task cancell...\utils.py:22>>)
handle: <Handle TransportBase._connect_done(<Task cancell...\utils.py:22>>)>
Traceback (most recent call last):
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiocometd\utils.py", line 27, in wrapper
return await coro_func(*args, **kwargs)
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiocometd\transports\base.py", line 524, in _connect
result = await self._send_payload_with_auth(payload)
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiocometd\transports\base.py", line 323, in _send_payload_with_auth
await self._auth.authenticate()
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiosfstream\auth.py", line 96, in authenticate
status_code, response_data = await self._authenticate()
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiosfstream\auth.py", line 173, in _authenticate
response = await session.post(self._token_url, data=data)
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiohttp\client.py", line 535, in _request
conn = await self._connector.connect(
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiohttp\connector.py", line 542, in connect
proto = await self._create_connection(req, traces, timeout)
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiohttp\connector.py", line 907, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiohttp\connector.py", line 1154, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiocometd\client.py", line 385, in _raise_server_error
raise ServerError(message, response)
aiocometd.exceptions.ServerError: ('Subscribe request failed.', {'clientId': 'kvl2mi3sd9hs6ei1m3vnsilh4nb9', 'channel': '/meta/subscribe', 'id': '2', 'subscription': '/event/Notification__e', 'error': 'Failed to create an internal subscription!', 'successful': False})
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\code\Python\scheduled_processes\processor.py", line 70, in process_events
await client.subscribe("/event/Notification__e")
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiosfstream\exceptions.py", line 143, in async_wrapper
return await func(*args, **kwargs)
File "C:\Users\test\AppData\Local\Programs\Python\Python39\lib\contextlib.py", line 137, in exit
self.gen.throw(typ, value, traceback)
File "C:\Users\test.virtualenvs\scheduled_processes-vrvgpOGN\lib\site-packages\aiosfstream\exceptions.py", line 123, in translate_errors_context
raise error_cls(*cometd_error.args) from cometd_error
aiosfstream.exceptions.ServerError: ('Subscribe request failed.', {'clientId': 'kvl2mi3sd9hs6ei1m3vnsilh4nb9', 'channel': '/meta/subscribe', 'id': '2', 'subscription': '/event/Notification__e', 'error': 'Failed to create an internal subscription!', 'successful': False})
The text was updated successfully, but these errors were encountered: