LooseLab / Icarust

A fully featured MinKNOW simulator for testing read until experiments.
Mozilla Public License 2.0
15 stars 5 forks source link

ValueError: Could not find device 'Bantersaurus' #15

Open seahkahyen opened 1 month ago

seahkahyen commented 1 month ago

Hello! I am trying to run readfish with Icarust and I cant seem to fix this error: 2024-05-30 17:49:24,430 readfish /home/user/miniforge3/bin/readfish targets --port 10000 --toml test.toml --device Bantersaurus --log-file test.log --experiment-name select_one_bac 2024-05-30 17:49:24,430 readfish chemistry=<Chemistry.SIMPLEX: 'simplex'> 2024-05-30 17:49:24,430 readfish command='targets' 2024-05-30 17:49:24,430 readfish debug_log=True 2024-05-30 17:49:24,430 readfish device='Bantersaurus' 2024-05-30 17:49:24,431 readfish dry_run=False 2024-05-30 17:49:24,431 readfish experiment_name='select_one_bac' 2024-05-30 17:49:24,431 readfish host='127.0.0.1' 2024-05-30 17:49:24,431 readfish log_file='test.log' 2024-05-30 17:49:24,431 readfish log_format='%(asctime)s %(name)s %(message)s' 2024-05-30 17:49:24,431 readfish log_level='info' 2024-05-30 17:49:24,431 readfish max_unblock_read_length_seconds=5 2024-05-30 17:49:24,432 readfish padding=0 2024-05-30 17:49:24,432 readfish port='10000' 2024-05-30 17:49:24,432 readfish throttle=0.4 2024-05-30 17:49:24,432 readfish toml='test.toml' 2024-05-30 17:49:24,432 readfish unblock_duration=0.1 2024-05-30 17:49:24,432 readfish wait_for_ready=120 2024-05-30 17:49:24,432 readfish Version=2024.2.0 Traceback (most recent call last): File "/home/user/miniforge3/bin/readfish", line 8, in sys.exit(main()) File "/home/user/miniforge3/lib/python3.10/site-packages/readfish/_cli_base.py", line 61, in main raise SystemExit(args.func(parser, args, extras)) File "/home/user/miniforge3/lib/python3.10/site-packages/readfish/entry_points/targets.py", line 604, in run position = get_device(args.device, host=args.host, port=args.port) File "/home/user/miniforge3/lib/python3.10/site-packages/readfish/_utils.py", line 451, in get_device raise ValueError(f"Could not find device {device!r}") ValueError: Could not find device 'Bantersaurus'

I have already run this in the command: cargo run --release -- --help export MINKNOW_TRUSTED_CA="static/tls_certs/ca.crt" readfish targets --port 10000 --toml test.toml --device 'Bantersaurus' --log-file test.log --experiment-name select_one_bac

How do I fix this error? Thank you so much for any help in advance!

Adoni5 commented 1 month ago

Hi @seahkahyen, thanks for giving Icarust a go!

It looks like you are very close, readfish connected to Icarust, and is looking for a position on the "sequencer", but can't find it.

Can I ask what Icarust command you ran, and what is in the profile simulation TOML file which you used?

Cheers, Rory

seahkahyen commented 3 weeks ago

Hi Rory,

Very sorry for the late reply! I managed to fix this issue and Icarust is running fine, but I am still unable to run readfish. Right now, it throws me this error:

2024-06-18 10:30:56,428 readfish /home/user/miniforge3/bin/readfish targets --port 13000 --toml readfish.toml --device Bantersaurus --log-file test.log --experiment-name test
2024-06-18 10:30:56,428 readfish chemistry=<Chemistry.SIMPLEX: 'simplex'>
2024-06-18 10:30:56,428 readfish command='targets'
2024-06-18 10:30:56,428 readfish debug_log=True
2024-06-18 10:30:56,428 readfish device='Bantersaurus'
2024-06-18 10:30:56,428 readfish dry_run=False
2024-06-18 10:30:56,428 readfish experiment_name='test'
2024-06-18 10:30:56,428 readfish host='127.0.0.1'
2024-06-18 10:30:56,428 readfish log_file='test.log'
2024-06-18 10:30:56,428 readfish log_format='%(asctime)s %(name)s %(message)s'
2024-06-18 10:30:56,428 readfish log_level='info'
2024-06-18 10:30:56,428 readfish max_unblock_read_length_seconds=5
2024-06-18 10:30:56,428 readfish padding=0
2024-06-18 10:30:56,428 readfish port='13000'
2024-06-18 10:30:56,428 readfish throttle=0.4
2024-06-18 10:30:56,428 readfish toml='readfish.toml'
2024-06-18 10:30:56,428 readfish unblock_duration=0.1
2024-06-18 10:30:56,428 readfish wait_for_ready=120
2024-06-18 10:30:56,428 readfish Version=2024.2.0
2024-06-18 10:30:56,484 readfish._read_until_client Protocol phase changed to PHASE_SEQUENCING
2024-06-18 10:30:56,484 readfish._read_until_client Protocol state changed to PROTOCOL_RUNNING
2024-06-18 10:30:56,486 readfish.targets eJxtkLtuwzAMRXd+RaAPMOy2GTu0a7euhkAoMq0KkUlFjyD5+0gB+kK7kfdeHpCcrQmBEmYqxbPLAwtK1ADzZmL8afT+iilrWBn9ckHPu+edMguxnH2qLbF5BQsdqsMgrptWuCQJ6K1pgYLv0zhEs6qGnxM5L5y1BjYb9fRLRynYPKP9qHzMTZxgM5fv9gmKSY5Kr2f1+jaO+4fH/TApDbltGQhlXTur8iGIPTZaDcX/UT/D9xNykYiJLPlzk79G/vXaezKduhOTWKLlLrXf/MID3AAK63T6
2024-06-18 10:30:56,515 readfish.targets Configuration description:
Region test (control=False).
Region applies to section of flow cell (# = applied, . = not applied):

    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################
    ########################################################################################################################

Traceback (most recent call last):
  File "/home/user/miniforge3/bin/readfish", line 8, in <module>
    sys.exit(main())
  File "/home/user/miniforge3/lib/python3.10/site-packages/readfish/_cli_base.py", line 61, in main
    raise SystemExit(args.func(parser, args, extras))
  File "/home/user/miniforge3/lib/python3.10/site-packages/readfish/entry_points/targets.py", line 626, in run
    send_message(
  File "/home/user/miniforge3/lib/python3.10/site-packages/readfish/_utils.py", line 182, in send_message
    rpc_connection.log.send_user_message(severity=severity, user_message=message)
  File "/home/user/miniforge3/lib/python3.10/site-packages/minknow_api/log_service.py", line 173, in send_user_message
    return run_with_retry(self._stub.send_user_message,
  File "/home/user/miniforge3/lib/python3.10/site-packages/minknow_api/log_service.py", line 40, in run_with_retry
    result = MessageWrapper(method(message, timeout=timeout), unwraps=unwraps)
  File "/home/user/miniforge3/lib/python3.10/site-packages/grpc/_channel.py", line 1181, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/home/user/miniforge3/lib/python3.10/site-packages/grpc/_channel.py", line 1006, in _end_unary_response_blocking
    raise _InactiveRpcError(state)  # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.CANCELLED
        details = "Received RST_STREAM with error code 8"
        debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"Received RST_STREAM with error code 8", grpc_status:1, created_time:"2024-06-18T10:30:56.516348328+08:00"}" 

This is the config.toml file:

output_path = "/tmp/"
target_yield = 100000000000
pore_type = "R10"
working_pore_percent = 85
nucleotide_type = "DNA"

[parameters]
sample_name = "test"
experiment_name = "test"
flowcell_name = "FAQ1234"
experiment_duration_set = 48000
device_id = "Bantersaurus"
position = "FenceSitter"
sample_rate = 400

[[sample]]
name = "test"
input_genome = "genomic.fa"
mean_read_length = 1000
weight = 1

and this is my readfish.toml file:

[caller_settings.no_op]

[mapper_settings.mappy_rs]
fn_idx_in = "genome.mmi"
debug_log = "control_icarust.paf"

[[regions]]
name = "test"
min_chunks = 1
max_chunks = 4
targets = []
single_off = "unblock"
multi_off = "unblock"
single_on = "stop_receiving"
multi_on = "stop_receiving"
no_seq = "proceed"
no_map = "unblock"

This is the Icarust and readfish command I ran: cargo run --release -- -s config.toml -v readfish targets --port 13000 --toml readfish.toml --device Bantersaurus --log-file test.log --experiment-name test

Thank you so much for ur help!

Adoni5 commented 4 days ago

Hey @seahkahyen - any joy?

Can you show me the contents of the config.ini file? I've not seen error code 8 before!

Rory

seahkahyen commented 3 days ago

Hi Rory!

Thank you so much for the follow up! I still could not get it to work. This is my config.ini file: `[TLS] cert-dir = ./static/tls_certs ; cert-dir = /opt/ont/minknow/conf/rpc-certs [PORTS] manager = 13000 position = 13001

[SEQUENCER] channels = 96`

I changed the port since it was in used as per #14 !

Kah Yen

Adoni5 commented 1 day ago

Okay there's a couple of things to try - can you first change

[SEQUENCER]
channels = 96
[SEQUENCER]
channels = 512

And try running readfish unblock-all --port 13000 --device Bantersaurus --log-file test.log --experiment-name test.

This should be a good test for connecting that will avoid having to base-call and align. As a side note, if the caller settings in you readfish TOML are noop, your aligner will not align anything as there won't be any base-called data!

Cheers, Rory

seahkahyen commented 13 hours ago

Hi Rory!

I did the changes as above, changing the number of channels and running readfish unblock-all --port 13000 --device Bantersaurus --log-file test.log --experiment-name test, but it still gave the same error code 8

Adoni5 commented 10 hours ago

This is strange! Can I ask what Icarust is logging to the screen at the time that readfish is connecting/throwing this error?

I'm going to prepare a minimal working example script outside of readfish which should be easier to debug.