OpenC3 / cosmos

OpenC3 COSMOS
https://openc3.com
Other
102 stars 29 forks source link

xtce: No such file or directory ? #903

Closed haisamido closed 10 months ago

haisamido commented 10 months ago

What am I doing wrong? I get No such file or directory @ rb_sysopen - .... when attempting to import an xtce file.

I am following these steps: https://docs.openc3.com/docs/meta/xtce#converting-a-xtce-file-into-a-cosmos-configuration and issuing the below command:

./openc3.sh cli xtce_converter \
  --import /Users/hido/Downloads/ACE/ace_v2.xtce \
  --output /Users/hido/Downloads/ACE/cosmos
Processing /Users/hido/Downloads/ACE/ace_v2.xtce...
/usr/lib/ruby/gems/3.2.0/gems/openc3-5.11.4.pre.beta0/lib/openc3/packets/parsers/xtce_parser.rb:76:in `initialize': No such file or directory @ rb_sysopen - /Users/hido/Downloads/ACE/ace_v2.xtce (Errno::ENOENT)
    from /usr/lib/ruby/gems/3.2.0/gems/openc3-5.11.4.pre.beta0/lib/openc3/packets/parsers/xtce_parser.rb:76:in `open'
    from /usr/lib/ruby/gems/3.2.0/gems/openc3-5.11.4.pre.beta0/lib/openc3/packets/parsers/xtce_parser.rb:76:in `parse'
    from /usr/lib/ruby/gems/3.2.0/gems/openc3-5.11.4.pre.beta0/lib/openc3/packets/parsers/xtce_parser.rb:69:in `initialize'
    from /usr/lib/ruby/gems/3.2.0/gems/openc3-5.11.4.pre.beta0/lib/openc3/packets/parsers/xtce_parser.rb:41:in `new'
    from /usr/lib/ruby/gems/3.2.0/gems/openc3-5.11.4.pre.beta0/lib/openc3/packets/parsers/xtce_parser.rb:41:in `process'
    from /usr/lib/ruby/gems/3.2.0/gems/openc3-5.11.4.pre.beta0/lib/openc3/packets/packet_config.rb:123:in `process_file'
    from /openc3/bin/openc3cli:251:in `xtce_converter'
    from /openc3/bin/openc3cli:673:in `<main>'

while the xtce filed does exist:

ls -altr /Users/hido/Downloads/ACE/ace_v2.xtce
-rw-r--r--@ 1 hido  staff    21M Oct 27 11:09 /Users/hido/Downloads/ACE/ace_v2.xtce

docker containers are running, and I am able to view telemetry on http://localhost:2900/tools/tlmviewer :

docker ps
CONTAINER ID   IMAGE          COMMAND                  CREATED      STATUS          PORTS                                             NAMES
b49090400e54   9e7859a5da58   "/sbin/tini -- rails…"   2 days ago   Up 18 minutes   2902/tcp                                          cosmos-openc3-cosmos-script-runner-api-1
e96c2884d28d   16cde73d1115   "/sbin/tini -- rails…"   2 days ago   Up 18 minutes   2901/tcp                                          cosmos-openc3-cosmos-cmd-tlm-api-1
2f3ebff9524d   3b8ac4646edd   "/sbin/tini -- ruby …"   2 days ago   Up 18 minutes                                                     cosmos-openc3-operator-1
1e1e3ade5398   bb7b244eff2b   "/entrypoint.sh trae…"   2 days ago   Up 18 minutes   127.0.0.1:2900->80/tcp, 127.0.0.1:2943->443/tcp   cosmos-openc3-traefik-1
0ccc2c97b7a8   e62ef4aea494   "docker-entrypoint.s…"   2 days ago   Up 18 minutes   3680/tcp, 6379/tcp                                cosmos-openc3-redis-ephemeral-1
496e8e7fb70f   441fed8d1ce7   "/usr/bin/docker-ent…"   2 days ago   Up 18 minutes   9000/tcp                                          cosmos-openc3-minio-1
a05ce9b77e53   e62ef4aea494   "docker-entrypoint.s…"   2 days ago   Up 18 minutes   3680/tcp, 6379/tcp                                cosmos-openc3-redis-1
ryanmelt commented 10 months ago

./openc3.sh cli runs inside a container and does a volume mount of your current path (pwd) to /openc3/local

Your host paths like: /Users/hido/Downloads/ACE/ace_v2.xtce won't be available there.

You can either move the files into a folder that will be visible and reference as /openc3/local/.... or you can install the openc3 gem on the host, "gem install openc3" and then run your command like:

openc3cli xtce_converter \
  --import /Users/hido/Downloads/ACE/ace_v2.xtce \
  --output /Users/hido/Downloads/ACE/cosmos

Note using the local executable openc3cli rather than ./openc3.sh cli

haisamido commented 10 months ago

Thank you for your quick reply @ryanmelt . I suspected that, but didn't see that explicitly stated in the instructions, so I assumed that my method would work. I may have missed it. I'll try what you suggest.

Which container should that command be run in?

ryanmelt commented 10 months ago

gem install openc3 would be done on your host computer, not a container, and would also require a host ruby installation.

You can also look into the openc3.sh script to see the full docker run line that is used by ./openc3.sh cli, if you want to volume mount in your /Users folder for example.