Skip to content

Bug: Invalid Endpoint spectrum_endpoint.wallets_get in general_settings.jinja (v2.1.1) #2498

@atamti

Description

@atamti

In Specter Desktop v2.1.1, clicking the "Wallet Management" button on the settings page results in a werkzeug.routing.exceptions.BuildError due to an invalid endpoint reference (spectrum_endpoint.wallets_get) in the general_settings.jinja template. The endpoint does not exist in the codebase, and the error prevents access to wallet management functionality from the settings page. The dropdown menu's settings link (/settings/) works fine, indicating this issue is specific to the button on the settings page.
Environment

Specter Desktop Version: v2.1.1
Python Version: 3.10
Operating System: Linux (Raspibolt node)
Bitcoin Backend: Bitcoin Core
Installation Method: PyPI (pip install cryptoadvance.specter==2.1.1)

Steps to Reproduce

Install Specter Desktop v2.1.1 (pip install cryptoadvance.specter==2.1.1).
Start Specter (python -m cryptoadvance.specter server or via systemd).
Navigate to the settings page in the web UI.
Click the "Wallet Management" button under the "Support Tools" section.
Observe the server error in the browser.

Error Traceback
Traceback (most recent call last):
File "/home/specter/.env/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/home/specter/.env/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/specter/.env/lib/python3.10/site-packages/flask_login/utils.py", line 290, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
File "/home/specter/.env/lib/python3.10/site-packages/cryptoadvance/specter/server_endpoints/settings.py", line 206, in general
return render_template(
File "/home/specter/.env/lib/python3.10/site-packages/flask/templating.py", line 147, in render_template
return _render(app, template, context)
File "/home/specter/.env/lib/python3.10/site-packages/flask/templating.py", line 130, in _render
rv = template.render(context)
File "/home/specter/.env/lib/python3.10/site-packages/jinja2/environment.py", line 1295, in render
self.environment.handle_exception()
File "/home/specter/.env/lib/python3.10/site-packages/jinja2/environment.py", line 942, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/home/specter/.env/lib/python3.10/site-packages/cryptoadvance/specter/templates/settings/general_settings.jinja", line 1, in top-level template code
{% extends "base.jinja" %}
File "/home/specter/.env/lib/python3.10/site-packages/cryptoadvance/specter/templates/base.jinja", line 97, in top-level template code
{% block main %}
File "/home/specter/.env/lib/python3.10/site-packages/cryptoadvance/specter/templates/settings/general_settings.jinja", line 156, in block 'main'

File "/home/specter/.env/lib/python3.10/site-packages/flask/app.py", line 2034, in url_for
return self.handle_url_build_error(error, endpoint, values)
File "/home/specter/.env/lib/python3.10/site-packages/flask/app.py", line 2023, in url_for
rv = url_adapter.build( # type: ignore[union-attr]
File "/home/specter/.env/lib/python3.10/site-packages/werkzeug/routing/map.py", line 924, in build
raise BuildError(endpoint, values, method, self)
werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'spectrum_endpoint.wallets_get'. Did you mean 'wallets_endpoint.wallet' instead?

Root Cause
The general_settings.jinja template (line 156) references spectrum_endpoint.wallets_get in the url_for call for the "Wallet Management" button:
Wallet Management

A search of the v2.1.1 source code confirms that spectrum_endpoint.wallets_get does not exist, while wallets_endpoint.wallets_overview (route: /wallets_overview/) is a valid endpoint for displaying the wallets overview page. The reference to spectrum_endpoint may be a typo or a remnant from an older version or the Spectrum extension, but it’s present in the official v2.1.1 codebase.
Workaround
We resolved the issue by updating the template to use wallets_endpoint.wallets_overview, which links to the wallets overview page without requiring a wallet_alias parameter.

Edit the template:sudo nano /home/specter/.env/lib/python3.10/site-packages/cryptoadvance/specter/templates/settings/general_settings.jinja

Change the line:Wallet Management

to:Wallet Management

Fix permissions:sudo chown specter:specter /home/specter/.env/lib/python3.10/site-packages/cryptoadvance/specter/templates/settings/general_settings.jinja
sudo chmod 644 /home/specter/.env/lib/python3.10/site-packages/cryptoadvance/specter/templates/settings/general_settings.jinja

Restart Specter:sudo systemctl restart specter

This change allows the "Wallet Management" button to correctly redirect to the wallets overview page.
Additional Notes

A preliminary attempt to use wallets_endpoint.wallet failed because it requires a wallet_alias parameter, which isn’t provided in the settings page context:werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'wallets_endpoint.wallet'. Did you forget to specify values ['wallet_alias']?

The dropdown menu’s settings link (href="/settings/") uses a different endpoint (settings_endpoint.general) and is unaffected.
I checked the Specter Desktop GitHub repository and found no existing issues for this specific error in v2.1.1.
The Spectrum extension (alpha in v1.14.5, per release notes) uses spectrum_endpoint, but it’s unclear why this reference appears in the main codebase’s template for v2.1.1 without the extension enabled.

Suggested Fix
Update the general_settings.jinja template in the v2.1.1 codebase to use wallets_endpoint.wallets_overview as shown in the workaround. Alternatively, if the button is intended to link to a specific wallet’s dashboard, ensure a wallet_alias is passed in the template context and use wallets_endpoint.wallet with the appropriate parameter.
Request
Please confirm if this is a known issue or a regression. If the Spectrum extension is involved, clarify whether it should be active in v2.1.1 or if this is a template error. A patch release with the corrected endpoint would prevent this issue for other users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions