nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
9.96k stars 1.29k forks source link

F´ GDS Error in Error "TypeError: sequence item 0: expected str instance, PosixPath found" #2669

Closed LeStarch closed 2 months ago

LeStarch commented 3 months ago
F´ Version
Affected Component

Problem Description

When an error arises within the application running code, it triggers another error TypeError: sequence item 0: expected str instance, PosixPath found that is reported.

This is caused by not converting PosixPath to str in our error reporting code.

secureshadow commented 1 month ago

Hello @LeStarch !

I am getting this error when running the fprime-gds for a custom board (SAMV71Q21), application and dictionary. Any idea how to solve it?

[/workspaces/fprime/Ref:devel:fprime-venv"][st3llar-dev🛰️ ] fprime-gds -d /workspaces/fprime/Ref/build-artifacts/samv --app /workspaces/fprime/Ref/build-artifacts/samv/bin/Ref -/Ref --dictionary /workspaces/fprime/Ref/build-artifacts/samv/dict/dictionary.xml

[INFO] Ensuring TCP Server is stable for at least 5 seconds [INFO] Running Application: /tmp/fprime-venv/bin/python3 [INFO] Log File: /workspaces/fprime/Ref/logs/2024_06_10-10_54_44/ThreadedTCP.log [INFO] Ensuring comm[ip] Application is stable for at least 1 seconds [INFO] Running Application: /tmp/fprime-venv/bin/python3 [INFO] Ensuring Ref Application is stable for at least 1 seconds [INFO] Running Application: /workspaces/fprime/Ref/build-artifacts/samv/bin/Ref [INFO] Log File: /workspaces/fprime/Ref/logs/2024_06_10-10_54_44/Ref.log [INFO] Shutting down F prime due to error. sequence item 0: expected str instance, PosixPath found

LeStarch commented 1 month ago

This error originates from error handling code. Fixing it in this issue revealed the true error.

You could install the latest GDS.

  1. Clone F´ GDS: git clone https://github.com/nasa/fprime-gds
  2. Install it: cd fprime-gds; pip install .

This will run the development version where this error is fixed. It will allow reporting of w/e error is tripping this.

secureshadow commented 1 month ago

@LeStarch Thank you! That fixes the error. I did not know if I had to install the latest version of F prime to solve the bug, but now it is clear.

I am still getting now some errors when trying to run fprime-gds with a custom app with the command I put above:

[INFO] Ensuring comm[ip] Application is stable for at least 1 seconds
[INFO] Running Application: /tmp/fprime-venv/bin/python3
[INFO] Ensuring Ref Application is stable for at least 1 seconds
[INFO] Running Application: /workspaces/fprime/Ref/build-artifacts/FreeRTOS-samv/bin/Ref
[INFO] Log File: /workspaces/fprime/Ref/logs/2024_06_10-17_55_34/Ref.log
[ERROR] Failed to run application: /workspaces/fprime/Ref/build-artifacts/FreeRTOS-samv/bin/Ref -p 50000 -a 0.0.0.0. Error: /workspaces/fprime/Ref/build-artifacts/FreeRTOS-samv/bin/Ref stopped with code -4 sooner than 1 seconds.
[INFO] Shutting down F prime due to error. Failed to run Ref Application

Note that I am running a devcontainer.json file for VSCode along with a Dockerfile. Do I have to forward ports in the devcontainer.json file as this: // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [5000, 50000, 50050],

and expose the ports in the Dockerfile or neither?

There is not much info on how to use fprime-gds and port forwarding with the fprime-gds tool :/

LeStarch commented 1 month ago

To be clear, you are installing the development version of the GDS tool, not all of F´.

This particular crash is happening in the Ref application. The next thing to do is look in the GDS logs (same directory where you ran GDS there will be a logs sub directory with time/date folders for each run). Look through Ref.log and see why it is stopping early.

It depends on where you are running the GDS. If the GDS is inside the container, then the only port forward you need is 5000 for the browser to connect into the container.

If you are running GDS outside the container, and flight software inside, then it becomes more complicated. It will depend on, which side is the server in the connection.

We should probably move this discussion to a "Discussion" such that it does not get lost within a closed ticket.

secureshadow commented 1 month ago

Done! I started a discussion in #2770. Thanks!