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

Computation failed: Server disconnected #99

Closed
mbenke opened this issue Mar 28, 2021 · 27 comments
Closed

Computation failed: Server disconnected #99

mbenke opened this issue Mar 28, 2021 · 27 comments
Labels
beta.2 impact: low impact: some users affected severity: major severity: loss of major functionality

Comments

@mbenke
Copy link

mbenke commented Mar 28, 2021

[2021-03-28 16:36:16,245 DEBUG yapapi.events] ComputationFinished(exc_info=(<class 'aiohttp.client_exceptions.ServerDisconnectedError'>, ServerDisconnectedError('Server dis\
connected'), <traceback object at 0x7f56beee7f00>))
Traceback (most recent call last):
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/executor/__init__.py", line 605, in _submit
    raise cast(BaseException, task.exception())
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/executor/__init__.py", line 384, in find_offers
    async for proposal in proposals:
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/rest/market.py", line 202, in events
    proposals = await self._api.collect_offers(self._id, timeout=10, max_events=10)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_market/api_client.py", line 201, in __call_api
    _request_timeout=_request_timeout,
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_market/rest.py", line 198, in GET
    query_params=query_params,
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_market/rest.py", line 170, in request
    r = await self.pool_manager.request(**args)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/client.py", line 544, in _request
    await resp.start(conn)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 890, in start
    message, payload = await self._protocol.read()  # type: ignore
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/streams.py", line 604, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
[2021-03-28 16:36:16,245 ERROR yapapi.summary] Computation failed, reason: Server disconnected
@cryptobench
Copy link
Member

Possibly related to this error on the provider side?
image

@mbenke
Copy link
Author

mbenke commented Mar 28, 2021

@cryptobench might be related, though this is not a single task failig, but the whole computation.

@mbenke
Copy link
Author

mbenke commented Mar 29, 2021

yagna-210329.log.gz

@mbenke
Copy link
Author

mbenke commented Mar 29, 2021

@mfranciszkiewicz
Copy link

mfranciszkiewicz commented Mar 31, 2021

@mbenke Is it possible that you're running out of file descriptors? Please provide the output of the commands below while computing

lsof -p <yagna process id> | wc -l
lsof -p <yapapi app process id> | wc -l
ulimit -a

@mbenke
Copy link
Author

mbenke commented Mar 31, 2021

@mfranciszkiewicz here you are:

# lsof -p 9614 | wc -l                                     # yagna
245
# lsof -p 9853 | wc -l                                     # python
239
# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 1030476
max locked memory       (kbytes, -l) 65536
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1030476
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

@mfranciszkiewicz
Copy link

@mbenke thanks, it looks that 47% of the open files limit is used by yagna. Could you increase it with:

ulimit -n 10240

in each of the relevant terminals (running the daemon, yapapi) and observe whether that improves the situation?
Limits can be set permanently by editing /etc/security/limits.conf (link to potential solutions in case of problems), in this case they need to be set manually for each new terminal.

@mbenke
Copy link
Author

mbenke commented Mar 31, 2021

@mfranciszkiewicz I did set the ulimit in all places (both terminals, limits.conf and systemd) and it did not help. I got

[2021-03-31 21:17:47,683 ERROR yapapi.summary] Computation failed, reason: Server disconnected     

almost right out of the bat. Number of open files reported by lsof was 251 at the time. Yagna was freshly restarted.

@mbenke
Copy link
Author

mbenke commented Mar 31, 2021

...and again in 10 minutes: [2021-03-31 21:28:15,097 ERROR yapapi.summary] Computation failed, reason: Serve r disconnected

@maaktweluit maaktweluit added impact: low impact: some users affected severity: major severity: loss of major functionality labels Apr 8, 2021
@maaktweluit
Copy link

@mbenke the logs above do not give enough information.

Could you re-produce this with RUST_LOG=debug enabled on the yagna service run

We also added tags with severity and impact, please check if you agree

@mbenke
Copy link
Author

mbenke commented Apr 9, 2021

@maaktweluit here are the logs form yesterday with RUST_LOG=debug
yagna20210408-debug.log.gz

NB this log probably does not contain the Server disconnected instance, even though it does contain a good deal of failed computations (reason 408 seems to be the dominant life-form these days).

@mbenke mbenke assigned maaktweluit and unassigned mbenke Apr 9, 2021
@mbenke
Copy link
Author

mbenke commented Apr 12, 2021

This log (with RUST_LOG=debug) should contain some instances of Server disconnected:

yagna20210411-debug.log.gz

@maaktweluit
Copy link

Thanks for the logs @mbenke !

I have checked both of them and they do not contain the error in the title:

➜  Downloads rg 'Server disconnected' yagna20210411-debug.log | wc -l
       0
➜  Downloads rg 'Server disconnected' yagna20210408-debug.log | wc -l
       0

Could you provide matching yapapi and yagna logs from the same run?
Both on debug please :)

I did see another issue in these logs so reporeted a new issue, linked above

@maaktweluit maaktweluit assigned mbenke and unassigned maaktweluit Apr 16, 2021
@mbenke
Copy link
Author

mbenke commented Apr 17, 2021

@maaktweluit @tworec indeed, the 'Server disconnected` message seems to occur only in yapapi logs. Again, they are big (259M), I am leaving them on server for you, as indicated in the email:

# zcat /home/golem/yapapi210411.log.gz | grep 'reason: Server disconnected'
[2021-04-10 06:51:21,450 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-11 17:07:52,222 ERROR yapapi.summary] Computation failed, reason: Server disconnected

There are also some occurrences in the most recent logs (using latest patch release: yagna 0.6.4 (4fc72117 2021-04-15 build #135):

# zcat /home/golem/logs/yapapi210416.log.gz | grep 'reason: Server disconnected'
[2021-04-16 16:18:47,487 WARNING yapapi.summary] Activity failed on provider 'ATGolem', reason: Server disconnected
[2021-04-16 16:18:47,489 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-17 00:49:46,563 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-17 01:32:23,564 ERROR yapapi.summary] Computation failed, reason: Server disconnected

@mbenke mbenke assigned maaktweluit and unassigned mbenke Apr 17, 2021
@mbenke
Copy link
Author

mbenke commented Apr 26, 2021

Getting hit badly by this today:

[2021-04-25 23:09:49,244 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-25 23:20:06,527 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-25 23:34:08,886 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-25 23:42:41,586 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 00:08:45,729 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 00:32:48,994 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 00:50:21,867 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 01:11:00,523 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 01:22:16,557 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 01:43:06,139 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 02:08:41,888 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 02:20:56,674 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 02:32:21,837 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 02:44:29,132 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 02:53:12,460 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 03:07:16,702 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 03:22:56,170 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 03:37:57,897 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 03:49:59,381 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 04:17:32,069 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 04:35:49,458 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 04:48:30,895 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 04:59:30,647 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 05:12:27,771 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 05:24:27,878 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 05:36:50,092 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 05:49:16,586 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 06:07:54,684 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 06:18:00,739 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 06:30:44,974 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 06:40:26,466 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 06:50:42,580 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 07:07:11,266 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 07:18:40,287 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 07:30:06,217 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 07:39:00,802 ERROR yapapi.summary] Computation failed, reason: Server disconnected                                                                              
[2021-04-26 07:47:03,934 ERROR yapapi.summary] Computation failed, reason: Server disconnected  

@mbenke
Copy link
Author

mbenke commented Apr 27, 2021

The show goes on...

[2021-04-26 23:47:56,583 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 00:11:57,523 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 00:25:24,794 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 00:38:05,309 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 00:49:51,299 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 01:03:20,564 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 01:17:35,655 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 01:35:35,795 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 01:46:59,321 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 01:59:53,812 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 02:16:52,654 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 02:29:32,903 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 02:40:22,105 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 02:50:03,746 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 03:01:33,485 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 03:13:44,793 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 03:44:05,471 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 03:54:27,876 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 04:12:58,461 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 04:21:57,047 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 04:31:58,127 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 04:41:37,434 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 04:51:51,784 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 05:03:38,054 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 05:14:15,827 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 05:26:55,043 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 05:34:22,793 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 05:41:37,510 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 05:52:32,509 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 06:10:00,131 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 06:19:08,368 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 06:33:53,945 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 06:42:54,950 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 06:53:56,567 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 07:05:08,040 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 07:11:48,910 ERROR yapapi.summary] Computation failed, reason: Server disconnected
[2021-04-27 07:20:23,009 ERROR yapapi.summary] Computation failed, reason: Server disconnected

@mbenke
Copy link
Author

mbenke commented Apr 27, 2021

It seems fetching debit notes is more often the culprit now:

[2021-04-26 19:16:00,213 DEBUG yapapi.events] ComputationFinished(exc_info=(<class 'aiohttp.client_exceptions.ServerDisconnectedError'>, ServerDisconnectedError('Server dis\
connected'), <traceback object at 0x7fdf1a4655a0>))
Traceback (most recent call last):
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/executor/__init__.py", line 613, in _submit                                                          
    raise cast(BaseException, task.exception())
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/executor/__init__.py", line 330, in process_debit_notes                                              
    async for debit_note in self._payment_api.incoming_debit_notes():
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/rest/payment.py", line 246, in fetch                                                                 
    debit_note = await self.debit_note(ev.debit_note_id)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/rest/payment.py", line 195, in debit_note                                                            
    debit_note = await self._api.get_debit_note(debit_note_id)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/api_client.py", line 202, in __call_api                                                          
    _request_timeout=_request_timeout,
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/rest.py", line 198, in GET                                                                       
    query_params=query_params,
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/rest.py", line 170, in request
    r = await self.pool_manager.request(**args)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/client.py", line 544, in _request
    await resp.start(conn)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 890, in start
    message, payload = await self._protocol.read()  # type: ignore
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/streams.py", line 604, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

@mbenke
Copy link
Author

mbenke commented Apr 27, 2021

...but sometimes also invoices:

[2021-04-26 20:14:27,857 DEBUG yapapi.events] ComputationFinished(exc_info=(<class 'aiohttp.client_exceptions.ServerDisconnectedError'>, ServerDisconnectedError('Server dis\
connected'), <traceback object at 0x7fe0ac498cd0>))
Traceback (most recent call last):
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/executor/__init__.py", line 613, in _submit
    raise cast(BaseException, task.exception())
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/executor/__init__.py", line 292, in process_invoices
    async for invoice in self._payment_api.incoming_invoices():
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/rest/payment.py", line 217, in fetch
    events = await api.get_invoice_events(after_timestamp=ts)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/api_client.py", line 202, in __call_api
    _request_timeout=_request_timeout,
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/rest.py", line 198, in GET
    query_params=query_params,
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/rest.py", line 170, in request
    r = await self.pool_manager.request(**args)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/client.py", line 544, in _request
    await resp.start(conn)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 890, in start
    message, payload = await self._protocol.read()  # type: ignore
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/streams.py", line 604, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

@azawlocki can you have a look at this (and the comment above)? Can we perhaps catch the excetpion and try to recover/retry instead of crashing the computation?

@mbenke
Copy link
Author

mbenke commented Apr 28, 2021

@azawlocki you can definitely do it better but this diff shows what I mean in the comment above:

diff --git a/yapapi/rest/payment.py b/yapapi/rest/payment.py
index 644d61b..bd65c2e 100644
--- a/yapapi/rest/payment.py
+++ b/yapapi/rest/payment.py
@@ -1,3 +1,4 @@
+import aiohttp
 import asyncio
 import logging
 
@@ -214,7 +215,11 @@ class Payment(object):
                 # In the current version of `ya-aioclient` the method `get_invoice_events`
                 # incorrectly accepts `timeout` parameter, while the server uses `pollTimeout`
                 # events = await api.get_invoice_events(poll_timeout=5, after_timestamp=ts)
-                events = await api.get_invoice_events(after_timestamp=ts)
+                try:
+                    events = await api.get_invoice_events(after_timestamp=ts)
+                except aiohttp.ServerDisconnectedError:
+                    logger.error("Error fetching invoice events", exc_info=True)
+                    events = []
                 for ev in events:
                     logger.debug("Received invoice event: %r, type: %s", ev, ev.__class__)
                     if isinstance(ev, yap.InvoiceReceivedEvent):
@@ -222,8 +227,11 @@ class Payment(object):
                         if not ev.invoice_id:
                             logger.error("Empty invoice id in event: %r", ev)
                             continue
-                        invoice = await self.invoice(ev.invoice_id)
-                        yield invoice
+                        try:
+                            invoice = await self.invoice(ev.invoice_id)
+                            yield invoice
+                        except aiohttp.ServerDisconnectedError:
+                            logger.error("Error fetching invoice %s", ev.invoice_id, exc_info=True)
                 if not events:
                     await asyncio.sleep(1)
 
@@ -235,7 +243,11 @@ class Payment(object):
         async def fetch(init_ts: datetime):
             ts = init_ts
             while True:
-                events = await self._api.get_debit_note_events(after_timestamp=ts)
+                try:
+                    events = await self._api.get_debit_note_events(after_timestamp=ts)
+                except aiohttp.ServerDisconnectedError:
+                    events = []
+                    logger.error("Error fetching debit note events", exc_info=True)
                 for ev in events:
                     logger.debug("Received debit note event: %r, type: %s", ev, ev.__class__)
                     if isinstance(ev, yap.DebitNoteReceivedEvent):
@@ -243,8 +255,12 @@ class Payment(object):
                         if not ev.debit_note_id:
                             logger.error("Empty debit note id in event: %r", ev)
                             continue
-                        debit_note = await self.debit_note(ev.debit_note_id)
-                        yield debit_note
+                        try:
+                            debit_note = await self.debit_note(ev.debit_note_id)
+                            yield debit_note
+                        except aiohttp.ServerDisconnectedError:
+                            logger.error("Error fetching debit note %s", ev.debit_note_id, exc_info=True)
+
                 if not events:
                     await asyncio.sleep(1)

NB This just the handles the exception, withourt attempting to retry, so something more should be done to handle this properly.

@azawlocki
Copy link

@mbenke Thank you for the suggestion, this PR should fix the issue: golemfactory/yapapi#358

@mbenke
Copy link
Author

mbenke commented May 2, 2021

@azawlocki alas, it seems that even with the above PR I am getting

[2021-05-02 21:25:49,912 DEBUG yapapi.events] ComputationFinished(exc_info=(<class 'aiohttp.client_exceptions.ServerDisconnectedError'>, ServerDisconnectedError('Server dis\
connected'), <traceback object at 0x7faa88252190>))
Traceback (most recent call last):
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/executor/__init__.py", line 613, in _submit                                                          
    raise cast(BaseException, task.exception())
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/executor/__init__.py", line 330, in process_debit_notes                                              
    async for debit_note in self._payment_api.incoming_debit_notes():
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/rest/payment.py", line 252, in fetch                                                                 
    debit_note = await self.debit_note(ev.debit_note_id)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/yapapi/rest/payment.py", line 198, in debit_note
    debit_note = await self._api.get_debit_note(debit_note_id)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/api_client.py", line 202, in __call_api
    _request_timeout=_request_timeout,
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/rest.py", line 198, in GET
    query_params=query_params,
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/ya_payment/rest.py", line 170, in request
    r = await self.pool_manager.request(**args)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/client.py", line 544, in _request
    await resp.start(conn)
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 890, in start
    message, payload = await self._protocol.read()  # type: ignore
  File "/root/miniconda3/envs/rdkit/lib/python3.7/site-packages/aiohttp/streams.py", line 604, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
[2021-05-02 21:25:49,959 ERROR yapapi.summary] Computation failed, reason: Server disconnected

(the crucial call at line 252 is not wrapped)

@azawlocki
Copy link

@mbenke I've added retrying for Payment.debit_note() (and some other payment API calls) to golemfactory/yapapi#358

@mbenke
Copy link
Author

mbenke commented May 5, 2021

@azawlocki thanks, but looking at the code it seems will help only for timeouts, not ServerDisconnected. Or am I reading this wrong?

@azawlocki
Copy link

azawlocki commented May 6, 2021

@mbenke yes, you're right! Thanks for catching this, I've added a new commit to fix this. And made you a reviewer of golemfactory/yapapi#358 (since you reviewed already).

@mateuszsrebrny
Copy link

@mbenke traditional question - we hope it has been fixed, are you observing this still? can we close it?

@mateuszsrebrny
Copy link

Closing for now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta.2 impact: low impact: some users affected severity: major severity: loss of major functionality
Projects
None yet
Development

No branches or pull requests

6 participants