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

New fava version breaks fava_dashboards #8

Closed
francocalvo opened this issue Jul 21, 2023 · 6 comments
Closed

New fava version breaks fava_dashboards #8

francocalvo opened this issue Jul 21, 2023 · 6 comments

Comments

@francocalvo
Copy link

Hi! Apparently, v1.2.5 breaks fava_dashboards. For example, I've seen that FavaAPIException is not FavaAPIError in helpers.py. After fixing that, I got this error:

Traceback (most recent call last):
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/fava/application.py", line 327, in extension_report
    content = Markup(render_template_string(template, extension=ext))
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/templating.py", line 163, in render_template_string
    return _render(app, template, context)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/templating.py", line 132, in _render
    rv = template.render(context)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 26, in top-level template code
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/fava/application.py", line 136, in url_for
    return _cached_url_for(endpoint, **values)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/helpers.py", line 225, in url_for
    return current_app.url_for(
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/app.py", line 1697, in url_for
    return self.handle_url_build_error(error, endpoint, values)
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/flask/app.py", line 1686, in url_for
    rv = url_adapter.build(  # type: ignore[union-attr]
  File "/home/calvo/Nextcloud/Finanzas/Beans/.venv/lib/python3.10/site-packages/werkzeug/routing/map.py", line 950, in build
    raise BuildError(endpoint, values, method, self)
werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'extension_report' with values ['bfile', 'dashboard', 'report_name']. Did you forget to specify values ['extension_name']?

I'd like to help fix it. I'm going to work right now, but I'll take another crack at it tomorrow if you want.

@andreasgerstmayr
Copy link
Owner

Resolved by #9 (already merged).

@addisonklinke
Copy link

I'm using fava==1.25.1 and seeing this error when trying to launch fava_dashboards

Importing module "fava_dashboards" failed. 
Error: "cannot import name 'FavaAPIError' from 'fava.helpers'
(/home/addison/venv/beancount/lib/python3.9/site-packages/fava/helpers.py)"

Oddly enough the class exists in the mentioned file

$ grep FavaAPIError /home/addison/venv/beancount/lib/python3.9/site-packages/fava/helpers.py
class FavaAPIError(Exception):

Any thoughts?

@andreasgerstmayr
Copy link
Owner

@addisonklinke I cannot reproduce this error with fava 1.25.1. Can you try deleting the venv and re-installing everything?

@addisonklinke
Copy link

Restarted my Fava server and that fixed the issue (in comparison re-loading did not)

@addisonklinke
Copy link

Follow-up question - are changes to dashboards.yaml expected to be picked up by Fava's re-load detection? I see the yellow icon if I alter my .beancount file(s), but no prompt for changing dashboards. Manually refreshing the page works though

@andreasgerstmayr
Copy link
Owner

Follow-up question - are changes to dashboards.yaml expected to be picked up by Fava's re-load detection?

No, afaics that only works for beancount files.

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

No branches or pull requests

3 participants