question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autopilot: ZeroDivisionError

See original GitHub issue

Testing on jsarenik/plugins@34e1ad6 (the only difference to current master, 89c95e4, is an added requirements.txt file).

$ lightningd --version v0.7.0-382-g8ef6623

See #34 on how I run the daemon. This is my ~/.lightning/config:

network=testnet
log-level=debug

On the client side, same for both with and without dryrun, I get this:

$ lightning-cli autopilot-run-once dryrun
"Error while processing autopilot-run-once: ZeroDivisionError('float division by zero')"

On the daemon side:

...
2019-05-28T09:29:19.666Z plugin-autopilot.py I'd like to open 8 new channels with 942187 satoshis each
2019-05-28T09:29:19.667Z plugin-autopilot.py 2019-05-28 11:29:19,666 - lib-autopilot - INFO - running the autopilot on a graph with 2 nodes and 1 edges.
2019-05-28T09:29:19.667Z plugin-autopilot.py INFO:lib-autopilot:running the autopilot on a graph with 2 nodes and 1 edges.
2019-05-28T09:29:19.667Z plugin-autopilot.py 2019-05-28 11:29:19,667 - lib-autopilot - INFO - GENERATE CANDIDATES: Try to generate up to 8 nodes with 4 strategies: (random, central, network Improvement, liquidity)
2019-05-28T09:29:19.667Z plugin-autopilot.py INFO:lib-autopilot:GENERATE CANDIDATES: Try to generate up to 8 nodes with 4 strategies: (random, central, network Improvement, liquidity)
2019-05-28T09:29:19.668Z plugin-autopilot.py 2019-05-28 11:29:19,667 - lib-autopilot - INFO - DECREASE DIAMETER: Generating probability density function
2019-05-28T09:29:19.668Z plugin-autopilot.py INFO:lib-autopilot:DECREASE DIAMETER: Generating probability density function
2019-05-28T09:29:19.668Z plugin-autopilot.py 2019-05-28 11:29:19,668 - lib-autopilot - INFO - DECREASE DIAMETER: probability density function created
2019-05-28T09:29:19.668Z plugin-autopilot.py INFO:lib-autopilot:DECREASE DIAMETER: probability density function created
2019-05-28T09:29:19.669Z plugin-autopilot.py 2019-05-28 11:29:19,668 - lib-autopilot - INFO - manipulate_pdf: Skewing the probability density function
2019-05-28T09:29:19.669Z plugin-autopilot.py INFO:lib-autopilot:manipulate_pdf: Skewing the probability density function
2019-05-28T09:29:19.669Z plugin-autopilot.py 2019-05-28 11:29:19,669 - lib-autopilot - INFO - CENTRALITY_PDF: Try to generate a PDF proportional to centrality scores
2019-05-28T09:29:19.669Z plugin-autopilot.py INFO:lib-autopilot:CENTRALITY_PDF: Try to generate a PDF proportional to centrality scores
2019-05-28T09:29:19.671Z plugin-autopilot.py Traceback (most recent call last):
2019-05-28T09:29:19.672Z plugin-autopilot.py   File \"/home/n/src/plugins/autopilot/venv/lib/python3.7/site-packages/lightning/plugin.py\", line 352, in _dispatch_request
2019-05-28T09:29:19.672Z plugin-autopilot.py     result = self._exec_func(method.func, request)
2019-05-28T09:29:19.672Z plugin-autopilot.py   File \"/home/n/src/plugins/autopilot/venv/lib/python3.7/site-packages/lightning/plugin.py\", line 336, in _exec_func
2019-05-28T09:29:19.672Z plugin-autopilot.py     return func(*ba.args, **ba.kwargs)
2019-05-28T09:29:19.672Z plugin-autopilot.py   File \"./autopilot.py\", line 148, in run_once
2019-05-28T09:29:19.672Z plugin-autopilot.py     percentile=0.5
2019-05-28T09:29:19.672Z plugin-autopilot.py   File \"/home/n/src/plugins/autopilot/lib_autopilot.py\", line 382, in find_candidates
2019-05-28T09:29:19.672Z plugin-autopilot.py     res = self.__create_pdfs()
2019-05-28T09:29:19.672Z plugin-autopilot.py   File \"/home/n/src/plugins/autopilot/lib_autopilot.py\", line 291, in __create_pdfs
2019-05-28T09:29:19.672Z plugin-autopilot.py     res[\"centrality\"] = self.__get_centrality_pdf()
2019-05-28T09:29:19.672Z plugin-autopilot.py   File \"/home/n/src/plugins/autopilot/lib_autopilot.py\", line 165, in __get_centrality_pdf
2019-05-28T09:29:19.672Z plugin-autopilot.py     pdf = {k:v/cumsum for k, v in pdf.items()}
2019-05-28T09:29:19.672Z plugin-autopilot.py   File \"/home/n/src/plugins/autopilot/lib_autopilot.py\", line 165, in <dictcomp>
2019-05-28T09:29:19.672Z plugin-autopilot.py     pdf = {k:v/cumsum for k, v in pdf.items()}
2019-05-28T09:29:19.672Z plugin-autopilot.py ZeroDivisionError: float division by zero
2019-05-28T09:29:19.672Z plugin-autopilot.py

@renepickhardt Please have a look. Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
renepickhardtcommented, Nov 22, 2019

sorry I oversaw this. I could still update the code that the execution stops if the cumsum is 0 (which should never happen…)

1reaction
jsarenikcommented, Nov 19, 2019

Not sure now. It was some time ago. When I try again I will report with results. So far closing this. Thank you for feed-back.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ZeroDivisionError division by zero in Python error handling
If you are working in Python, and receive the following output, your code is attempting to divide a given number by zero. ZeroDivisionError....
Read more >
Error python : [ZeroDivisionError: division by zero]
I faced an error when I run my program using python: The error is like this: ZeroDivisionError: ...
Read more >
Troubleshoot Autopilot device import and enrollment
See the following sections for information about issues that can occur when importing and enrolling devices into Intune. Error code 0x80180014 ...
Read more >
scenario_runner/atomic_behaviors.py at master · carla ...
This class contains an atomic behavior to disable/enable the use of the autopilot. Important parameters: - actor: CARLA actor to execute the behavior....
Read more >
Ruby Exception Handling - Primer for Dealing with Errors in ...
ZeroDivisionError : used if attempting to divide an integer by 0. ... and set your error handling, logging, and alerting on auto-pilot.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found