canonn-science / EDMC-Canonn

Project Athens: EDMC plugin to automatically collect accurate science data from the galaxy and coordinate missions
GNU General Public License v3.0
80 stars 12 forks source link

[BUG] string index out of range error in codex.py & fleet_carrier.py #90

Open Tenzian opened 3 years ago

Tenzian commented 3 years ago

What is your commander name Tiath

What version are you running 5.23.0 "Farewell Aricebo the End of an Era"

Describe the bug It looks like one of the fleet carriers in system has an unexpected name so https://github.com/canonn-science/EDMC-Canonn/blob/4118a9c8a31bb8377d1d68a825faefd7f8985741/canonn/codex.py#L1277-L1278 and https://github.com/canonn-science/EDMC-Canonn/blob/4118a9c8a31bb8377d1d68a825faefd7f8985741/canonn/fleet_carrier.py#L49-L50 are not able to parse it as it's a shorter string than expected.

To Reproduce I was in Outotz LS-K d8-3, but of course carriers can move 😁. I've included the journaled FSSSignalDiscovered events from the time of the error (I'm assuming KNY-75Q is the culprit here)

Expected behavior fleet carrier names are parsed without error messages 😏

Log Files

2021-02-04 03:14:59.371 - ERROR - plug.notify_journal_entry:322: Plugin "Canonn" failed
Traceback (most recent call last):
  File "~/Repositories/EDMarketConnector/plug.py", line 319, in notify_journal_entry
    newerror = journal_entry(cmdr, is_beta, system, station, dict(entry), dict(state))
  File "~/Library/Application Support/EDMarketConnector/plugins/EDMC-Canonn/load.py", line 190, in journal_entry
    return journal_entry_wrapper(cmdr, is_beta, system, this.SysFactionState, this.SysFactionAllegiance,
  File "~/Library/Application Support/EDMarketConnector/plugins/EDMC-Canonn/load.py", line 215, in journal_entry_wrapper
    this.codexcontrol.journal_entry(
  File "~/Library/Application Support/EDMarketConnector/plugins/EDMC-Canonn/canonn/codex.py", line 1164, in journal_entry
    self.journal_entry_wrap(
  File "~/Library/Application Support/EDMarketConnector/plugins/EDMC-Canonn/canonn/codex.py", line 1278, in journal_entry_wrap
    "SignalName")[-4] == '-' and entry.get("SignalName")[-8] == ' ')
IndexError: string index out of range
Exception in thread Thread-101:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "~/Library/Application Support/EDMarketConnector/plugins/EDMC-Canonn/canonn/fleet_carrier.py", line 28, in run
    Fleet.process()
  File "~/Library/Application Support/EDMarketConnector/plugins/EDMC-Canonn/canonn/fleet_carrier.py", line 50, in process
    "SignalName")[-4] == '-' and entry.get("SignalName")[-8] == ' ' and isStation)
IndexError: string index out of range

From the journal:

{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"NEBZDYASHIY KNV-B8Q", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"[ALL TH£ MOD CONS]5% JZB-N5L", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"ACE SPACEWAYS JNQ-6TG", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"KAAMELOTT VFK-B8G", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"CHANNELED SCABLANDS X3Q-6VY", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"FINANCIAL PROBLEMS V8B-N9N", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"RUSSIAN HOUSE ATX XNG-4XX", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"TEXAS G7X-GTZ", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"[EIC]LONGMAN LOGISTICS B1T-05Z", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"KNY-75Q", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"THOLIAN WEB K3N-N1Y", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"JUST 1 MORE EYESORE V4V-39L", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"PRIVATE-TAVERN-2.71828 V1G-73M", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"RATSYLVANIA K7B-N3G", "IsStation":true }
{ "timestamp":"2021-02-04T03:14:54Z", "event":"FSSSignalDiscovered", "SystemAddress":113674078411, "SignalName":"XALK XHK-NHB", "IsStation":true }
NoFoolLikeOne commented 3 years ago

Thanks. I'll check to see if this is still an issue. Some of the code has been pushed server side