AIT-Core icon indicating copy to clipboard operation
AIT-Core copied to clipboard

| ERROR | <class 'TypeError'> creating plugin 1: string indices must be integers

Open ThePope55 opened this issue 5 years ago • 1 comments

Hello, While trying to implement this repo, I ran into this error trying to setup the influxdb database to connect with the AIT GUI for telemetry playback. From following the steps listed here: https://github.com/NASA-AMMOS/AIT-Core/issues/243 I was able to get through the page by diligently following the steps, until trying to execute test step 4 for db.connect(). I ran into this error: " Traceback (most recent call last): File "", line 1, in File "<UserPath>/.virtualenvs/ait/lib/python3.7/site-packages/ait/core/db.py", line 262, in connect if dbname not in [v['name'] for v in self._conn.get_list_database()]: File "<UserPath>/.virtualenvs/ait/lib/python3.7/site-packages/ait/core/db.py", line 262, in if dbname not in [v['name'] for v in self._conn.get_list_database()]: TypeError: string indices must be integers "

From running the ait-server in a separate terminal, I noticed these similar errors appear as well: " | ERROR | Unable to connect to ait.core.db.InfluxDBBackend backend. Disabling data archive. | ERROR | <class 'TypeError'> creating plugin 1: string indices must be integers "

Here is the contents of the config file, copied identical to the Issue243 post: " database: dbname: ait

server:
    plugins:
       - plugin:
           name: ait.gui.AITGUIPlugin
           inputs:
               - log_stream
               - telem_stream
           outputs:
               - command_stream

       - plugin:
           name: ait.core.server.plugins.data_archive.DataArchive
           inputs:
               - telem_stream
               - 8086
          datastore: ait.core.db.InfluxDBBackend

"

My docker influxdb instance seems to be working properly as I can create and use databases from the command line, as well as ping the port to see a response. Any ideas as to what this error could mean?

David

ThePope55 avatar Nov 25 '20 20:11 ThePope55

Hey @ThePope55,

You need to specify Plugin inputs / outputs as the names of Inbound or Outbound Streams.

You probably have the default stream definitions like the below. You'd need to specify a new inbound-stream with input port 8086 if you wanted to forward data from there to the DataArchive plugin. This would effectively be the same as the log_stream and telem_stream definitions but with the port value changed.

server:
        inbound-streams:
            - stream:
                name: log_stream
                input:
                    - 2514

            - stream:
                name: telem_stream
                input:
                    - 3076
                handlers:
                    - name: ait.core.server.handlers.PacketHandler
                      packet: 1553_HS_Packet

        outbound-streams:
            - stream:
                name: command_stream
                output: 3075
                command_subscriber: True

That being said, are you trying to forward something coming in on port 8086 to the data archive plugin or are you trying to pass that port for something else?

MJJoyce avatar Nov 30 '20 17:11 MJJoyce