Blockstream / satellite

Blockstream Satellite
https://blockstream.github.io/satellite/
GNU General Public License v3.0
973 stars 153 forks source link

blocksat-cli crashes on Fedora 39 #102

Open bg002h opened 7 months ago

bg002h commented 7 months ago

bcg@localhost-live:~$ blocksat-cli instructions Traceback (most recent call last): File "/usr/local/bin/blocksat-cli", line 5, in from blocksatcli.main import main File "/usr/local/lib/python3.12/site-packages/blocksatcli/main.py", line 11, in from . import config, util, instructions, gqrx, bitcoin, sdr, rp, \ File "/usr/local/lib/python3.12/site-packages/blocksatcli/standalone.py", line 9, in from pysnmp.hlapi import SnmpEngine, ObjectType, ObjectIdentity, \ File "/usr/local/lib/python3.12/site-packages/pysnmp/hlapi/init.py", line 10, in from pysnmp.hlapi import auth File "/usr/local/lib/python3.12/site-packages/pysnmp/hlapi/auth.py", line 7, in from pysnmp.entity import config File "/usr/local/lib/python3.12/site-packages/pysnmp/entity/config.py", line 8, in from pysnmp.carrier.asyncore.dgram import udp, udp6, unix File "/usr/local/lib/python3.12/site-packages/pysnmp/carrier/asyncore/dgram/udp.py", line 9, in from pysnmp.carrier.asyncore.dgram.base import DgramSocketTransport File "/usr/local/lib/python3.12/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 10, in from pysnmp.carrier.asyncore.base import AbstractSocketTransport File "/usr/local/lib/python3.12/site-packages/pysnmp/carrier/asyncore/base.py", line 9, in import asyncore ModuleNotFoundError: No module named 'asyncore'

As best I can tell, asyncore has been deprecated since python3.3 or maybe 3.6....I can't seem to install an older version of python on my fedora vm...

bg002h commented 7 months ago

for a work around on fedora:

sudo dnf install python3.7 python3.7 -m venv env source env/bin/activate pip3 install blocksat-cli

This environment at least lets the instructions command to blocksat-cli load

bg002h commented 7 months ago

this only gets one so far...it looks like fedora 39 isn't supported yet...blocksat-cli deps install can't find a repository because fedora-39-x86-64 does not exist in project blockstream/satellite

blockstreamsatellite commented 7 months ago

@bg002h , thanks for reporting the problem.

You are right about asyncore. The issue applies only to the S400 receiver, given that it is the only receiver type for which the CLI uses SNMP for communication. We expect to have a fix for that soon.

As for the RPM package repository, please try now. We already have the packages for Fedora 39.

For now, the Python virtualenv workaround should suffice for running PySNMP (which calls asyncore). Also, you can use any Python version up to 3.11, not necessarily Python 3.7. The asyncore module has been removed on Python 3.12, the Python version that Fedora 39 runs by default.

blockstreamsatellite commented 7 months ago

@bg002h FYI, we have pushed a fix for the asyncore issue you experienced, which was related to the PySNMP package. The changes are already merged into the master branch. Please feel free to try them and let us know if you still have any issues.

Note that, to try this, you need to install the CLI from the source. You can do so on a virtualenv too, as you mentioned earlier. For example:

python3 -m venv .venv
source .venv/bin/activate
make install

Then, you can access blocksat-cli from the virtualenv path:

# Add to path
export PATH=$PATH:$(pwd)/.venv/bin
# Confirm path
which blocksat-cli
bg002h commented 6 months ago

things work until trying to configure the s400...

(.env) bcg@fedora:~/.env/bin1$ blocksat-cli standalone cfg 2024-01-17 21:56:05 INFO Checking current configuration. 2024-01-17 21:56:05 INFO Reverse path (RP) filters not configured. 2024-01-17 21:56:06 INFO Firewall rules not configured. Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pysmi/searcher/pyfile.py", line 15, in SOURCE_SUFFIXES = importlib.machinery.SOURCE_SUFFIXES ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'importlib' has no attribute 'machinery'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pysmi/searcher/pyfile.py", line 19, in raise ImportError() ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/mibdump.py", line 14, in from pysmi.searcher import AnyFileSearcher, PyFileSearcher, PyPackageSearcher, StubSearcher File "/usr/local/lib/python3.12/site-packages/pysmi/searcher/init.py", line 7, in from pysmi.searcher.pyfile import PyFileSearcher File "/usr/local/lib/python3.12/site-packages/pysmi/searcher/pyfile.py", line 22, in import imp ModuleNotFoundError: No module named 'imp' Traceback (most recent call last): File "/home/bcg/.env/bin/blocksat-cli", line 8, in sys.exit(main()) ^^^^^^ File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/main.py", line 87, in main args.func(args) File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 712, in configure verify_res = verify(args) ^^^^^^^^^^^^ File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 693, in verify s400 = S400Client(args.demod, rx_ip_addr, args.port, dry=args.dry_run) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 259, in init super().init(address, port, mib='NOVRA-s400-MIB', dry=dry) File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 84, in init self._dump_mib() File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 98, in _dump_mib runner.run(cmd) File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/util.py", line 291, in run res = subprocess.run(cmd, ^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['mibdump.py', '--mib-source=/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/mib', 'NOVRA-s400-MIB']' returned non-zero exit status 1.

bg002h commented 6 months ago

when i use my prior configuration file for blocksat-cli from my prior arch install (long story).... (.env) bcg@fedora:~/.env/bin$ blocksat-cli standalone monitor Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pysmi/searcher/pyfile.py", line 15, in SOURCE_SUFFIXES = importlib.machinery.SOURCE_SUFFIXES ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'importlib' has no attribute 'machinery'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pysmi/searcher/pyfile.py", line 19, in raise ImportError() ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/mibdump.py", line 14, in from pysmi.searcher import AnyFileSearcher, PyFileSearcher, PyPackageSearcher, StubSearcher File "/usr/local/lib/python3.12/site-packages/pysmi/searcher/init.py", line 7, in from pysmi.searcher.pyfile import PyFileSearcher File "/usr/local/lib/python3.12/site-packages/pysmi/searcher/pyfile.py", line 22, in import imp ModuleNotFoundError: No module named 'imp' Traceback (most recent call last): File "/home/bcg/.env/bin/blocksat-cli", line 8, in sys.exit(main()) ^^^^^^ File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/main.py", line 87, in main args.func(args) File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 778, in monitor s400 = S400Client(args.demod, rx_ip_addr, args.port) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 259, in init super().init(address, port, mib='NOVRA-s400-MIB', dry=dry) File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 84, in init self._dump_mib() File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/standalone.py", line 98, in _dump_mib runner.run(cmd) File "/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/util.py", line 291, in run res = subprocess.run(cmd, ^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['mibdump.py', '--mib-source=/home/bcg/.env/lib64/python3.11/site-packages/blocksatcli/mib', 'NOVRA-s400-MIB']' returned non-zero exit status 1.

note pyton --version yields Python 3.11.7