Skip to content

Bug: ModuleNotFoundError: No module named 'cryptoadvance.specterext.liquidissuer' Due to Uninstalled Extension in EXTENSION_LIST #2496

Description

@atamti

In Specter Desktop v2.1.1, starting the server from a source install (pip install .) crashes with a ModuleNotFoundError because the EXTENSION_LIST in cryptoadvance.specter.config.ProductionConfig includes cryptoadvance.specterext.liquidissuer.service, an optional extension not installed by default. The ExtensionManager attempts to load this module, causing the crash. This issue does not occur with the PyPI install (pip install cryptoadvance-specter==2.1.1), suggesting PyPI may include optional extensions or different dependencies.

Error log:

No module named 'cryptoadvance.specter.devices.hwi.jadepy.jade_ble'
BLE scanning/connectivity will not be available
[2025-05-09 15:06:04,127] INFO in server: Configuration: cryptoadvance.specter.config.ProductionConfig
[2025-05-09 15:06:04,138] INFO in service_manager: ----> starting service discovery Static
[2025-05-09 15:06:04,143] INFO in reflection: Found class SwanService
Traceback (most recent call last):
File ".../cryptoadvance/specter/util/reflection.py", line 94, in get_classlist_of_type_clazz_from_modulelist
module = import_module(fq_module_name)
ModuleNotFoundError: No module named 'cryptoadvance.specterext.liquidissuer'
...
cryptoadvance.specter.specter_error.SpecterError: Module cryptoadvance.specterext.liquidissuer.service could not be found.

The EXTENSION_LIST in config.py (line ~190) includes:

EXTENSION_LIST = [
"cryptoadvance.specterext.swan.service",
"cryptoadvance.specterext.liquidissuer.service",
"cryptoadvance.specterext.devhelp.service",
"cryptoadvance.specterext.notifications.service",
"cryptoadvance.specterext.exfund.service",
"cryptoadvance.specterext.faucet.service",
"cryptoadvance.specterext.electrum.service",
"cryptoadvance.specterext.spectrum.service",
"cryptoadvance.specterext.stacktrack.service",
]

Extensions like liquidissuer and stacktrack are optional and not included in the default source install, causing the crash.

Steps to Reproduce

Clone Specter Desktop v2.1.1:

git clone https://github.com/cryptoadvance/specter-desktop
cd specter-desktop
git checkout v2.1.1

Set up a Python 3.10 virtual environment:

python3 -m venv .env
source .env/bin/activate

Install dependencies and Specter:

pip install sqlalchemy==1.4.50 flask-sqlalchemy==2.5.1
pip install .

Start Specter:

python -m cryptoadvance.specter server --host 127.0.0.1 --config ProductionConfig

Observe the crash with the error:

ModuleNotFoundError: No module named 'cryptoadvance.specterext.liquidissuer'

Expected Behavior

Specter should start without crashing in ProductionConfig when optional extensions are not installed.

ExtensionManager should skip uninstalled extensions in EXTENSION_LIST or only include extensions guaranteed to be present in the source install.

Actual Behavior

Specter crashes with ModuleNotFoundError for cryptoadvance.specterext.liquidissuer because the extension is listed in EXTENSION_LIST but not installed.

The error halts server startup, preventing access to the UI (http://:25441).

Environment

OS: Ubuntu (RaspiBolt on Raspberry Pi 4)

Python: 3.10

Specter Version: v2.1.1 (installed from source, git checkout v2.1.1)

Virtual Environment: /home/specter/.env

Dependencies: sqlalchemy==1.4.50, flask-sqlalchemy==2.5.1, others per requirements.txt

Related Services: Bitcoin Knots 28.1 (127.0.0.1:8336), Electrs 0.10.7 (127.0.0.1:50001)

Logs

specter.log (excerpt):

[2025-05-09 15:06:04,127] INFO in server: Configuration: cryptoadvance.specter.config.ProductionConfig
[2025-05-09 15:06:04,138] INFO in service_manager: ----> starting service discovery Static
[2025-05-09 15:06:04,143] INFO in reflection: Found class SwanService
Traceback (most recent call last):
File ".../cryptoadvance/specter/util/reflection.py", line 94, in get_classlist_of_type_clazz_from_modulelist
module = import_module(fq_module_name)
ModuleNotFoundError: No module named 'cryptoadvance.specterext.liquidissuer'

journalctl -u specter.service:

Confirms crash due to liquidissuer error.

Full logs available: specter.log, specter_journal.log.

Workaround

Modify EXTENSION_LIST in cryptoadvance/specter/config.py (line ~190) to exclude uninstalled extensions:

sudo nano /home/specter/.env/lib/python3.10/site-packages/cryptoadvance/specter/config.py

EXTENSION_LIST = [
"cryptoadvance.specterext.swan.service",
"cryptoadvance.specterext.electrum.service",
"cryptoadvance.specterext.spectrum.service"
]

Restart Specter:

sudo systemctl restart specter

Result: Specter starts successfully, loading only installed extensions (swan, electrum, spectrum).

Suggested Fix

Filter Uninstalled Extensions:

Update ExtensionManager (service_manager.py) to skip missing extensions gracefully:

def init(self, specter, devstatus_threshold):
logger.info("----> starting service discovery Static")
extension_list = app.config.get("EXTENSION_LIST", [])
class_list = []
for module_name in extension_list:
try:
class_list.extend(get_classlist_of_type_clazz_from_modulelist(Extension, [module_name]))
except ModuleNotFoundError as e:
logger.warning(f"Skipping extension {module_name}: {e}")

Refine EXTENSION_LIST:

In config.py, include only extensions guaranteed to be installed in the source build (e.g., electrum, swan, spectrum) or make optional extensions configurable via config.json.

Example:

EXTENSION_LIST = [
"cryptoadvance.specterext.electrum.service",
"cryptoadvance.specterext.swan.service",
"cryptoadvance.specterext.spectrum.service"
]

Document Dependencies:

Update README.md or requirements.txt to clarify optional extensions (e.g., cryptoadvance-specterext-liquidissuer) and their installation:

pip install cryptoadvance-specterext-liquidissuer

Additional Context

Encountered during RaspiBolt setup after switching from PyPI to source install.

The error suggests EXTENSION_LIST assumes optional extensions are installed, which is not the case for source builds.

PyPI install (pip install cryptoadvance-specter==2.1.1) may include additional extensions, avoiding the crash.

Attachments

specter.log: Server logs showing ModuleNotFoundError (available on request).

specter_journal.log: Systemd logs for Specter service (available on request).

Modified config.py snippet (available on request).

Related Issues

None found in cryptoadvance/specter-desktop issues matching this exact problem.

Thanks!

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