fact-project / shifthelper

So we can sleep at night.
4 stars 0 forks source link

exceptions from: sfc.main_page() #259

Closed dneise closed 6 years ago

dneise commented 6 years ago

I was called about every hour or two the entire night with exceptions like this:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/custos/checks/__init__.py", line 82, in wrapped_check
    self.check(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/checks.py", line 38, in check
    if all([f() for f in self.checklist]):
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/checks.py", line 38, in <listcomp>
    if all([f() for f in self.checklist]):
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/debug_log_wrapper.py", line 9, in log_call_and_result
    result = wrapped(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/conditions.py", line 96, in is_data_run
    result = sfc.main_page().system_status
  File "/opt/conda/lib/python3.6/site-packages/retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "/opt/conda/lib/python3.6/site-packages/retrying.py", line 212, in call
    raise attempt.get()
  File "/opt/conda/lib/python3.6/site-packages/retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "/opt/conda/lib/python3.6/site-packages/six.py", line 686, in reraise
    raise value
  File "/opt/conda/lib/python3.6/site-packages/retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/retry_smart_fact_crawler.py", line 77, in main_page
    return sfc.main_page(url=url, timeout=timeout, fallback=True)
  File "/opt/conda/lib/python3.6/site-packages/smart_fact_crawler/__init__.py", line 319, in main_page
    trigger_val, trigger_unit, _ = get(table, 5, 1, default='nan nan nan').split()
ValueError: not enough values to unpack (expected 3, got 2)
2018-01-23 04:01:25,700 - custos.checks.FactIntervalCheck - ERROR - Exception while running check
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/custos/checks/__init__.py", line 82, in wrapped_check
    self.check(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/checks.py", line 38, in check
    if all([f() for f in self.checklist]):
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/checks.py", line 38, in <listcomp>
    if all([f() for f in self.checklist]):
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/debug_log_wrapper.py", line 9, in log_call_and_result
    result = wrapped(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/conditions.py", line 96, in is_data_run
    result = sfc.main_page().system_status
  File "/opt/conda/lib/python3.6/site-packages/retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "/opt/conda/lib/python3.6/site-packages/retrying.py", line 212, in call
    raise attempt.get()
  File "/opt/conda/lib/python3.6/site-packages/retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "/opt/conda/lib/python3.6/site-packages/six.py", line 686, in reraise
    raise value
  File "/opt/conda/lib/python3.6/site-packages/retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "/opt/conda/lib/python3.6/site-packages/shifthelper/retry_smart_fact_crawler.py", line 77, in main_page
    return sfc.main_page(url=url, timeout=timeout, fallback=True)
  File "/opt/conda/lib/python3.6/site-packages/smart_fact_crawler/__init__.py", line 319, in main_page
    trigger_val, trigger_unit, _ = get(table, 5, 1, default='nan nan nan').split()
ValueError: not enough values to unpack (expected 3, got 2)
dneise commented 6 years ago

I was stupid, the fallback=True for the main_page is already done here:

https://github.com/fact-project/shifthelper/blob/new_sfc/shifthelper/retry_smart_fact_crawler.py#L77

dneise commented 6 years ago

So this PR is useless

dneise commented 6 years ago

moved this to an issue instead: #260

maxnoe commented 6 years ago

It seems that the value is present but not as expected splittable in three values. Did something change in smartfact?