Skip to content

yarpserver --read does not work as expected on Windows and Linux #2567

@traversaro

Description

@traversaro

Describe the bug
It seems that trying to read an existing yarpserver configuration saved with yarpserver --write via yarpserver --read does not work on Windows, and instead the same error given by launching yarpserver without --read is printed.

To Reproduce
To install YARP:

conda create -n yarpenv
conda activate yarpenv
conda install -c conda-forge -c robotology yarp

Then launch it with a custom socket number

yarpserver.exe --socket 20000 --write

The output is:

(yarpenv) C:\Users\STraversaro>yarpserver.exe --socket 20000 --write

     ==========================
    | __  __ ___  ____   ____  |
    | \ \/ //   ||  _ \ |  _ \ |
    |  \  // /| || |/ / | |/ / |
    |  / // ___ ||  _ \ |  _/  |
    | /_//_/  |_||_| \_\|_|    |
    |                          |
     ==========================

Call with --help for information on available options
Using port database: :memory:
Using subscription database: :memory:
IP address: default
Port number: 20000
[ERROR] Database needs to be reset, IP or port number set.
[INFO] |yarp.os.Port| Port /root active at tcp://10.240.9.106:20000/
Registering name server with itself
 * register "/root" tcp "10.240.9.106" 20000
   + set "/root" offers http name_ser local tcp fast_tcp mcast udp text text_ack bayer human mjpeg portmonitor priority rossrv shmem tcpros xmlrpc
   + set "/root" accepts http name_ser local tcp fast_tcp mcast udp text text_ack bayer human mjpeg portmonitor priority rossrv shmem tcpros xmlrpc
   + set "/root" ips "10.240.9.106" "127.0.0.1" "172.18.144.1" "172.17.224.1"
   + set "/root" process 17796
 * register fallback mcast "224.2.1.1" 10000
   + set fallback offers http name_ser local tcp fast_tcp mcast udp text text_ack bayer human mjpeg portmonitor priority rossrv shmem tcpros xmlrpc
   + set fallback accepts http name_ser local tcp fast_tcp mcast udp text text_ack bayer human mjpeg portmonitor priority rossrv shmem tcpros xmlrpc
   + set fallback ips "10.240.9.106" "127.0.0.1" "172.18.144.1" "172.17.224.1"
   + set fallback process 17796
 * set "/root" nameserver "true"
Name server can be browsed at http://10.240.9.106:20000/
Ok. Ready!

Then if I closed and launch again with --read:

(yarpenv) C:\Users\STraversaro>yarpserver.exe --read

     ==========================
    | __  __ ___  ____   ____  |
    | \ \/ //   ||  _ \ |  _ \ |
    |  \  // /| || |/ / | |/ / |
    |  / // ___ ||  _ \ |  _/  |
    | /_//_/  |_||_| \_\|_|    |
    |                          |
     ==========================

Call with --help for information on available options
Using port database: :memory:
Using subscription database: :memory:
IP address: default
Port number: 10000
PROBLEM: need to change settings in C:\Users\STraversaro\AppData\Roaming\yarp\config\yarp.conf
  Current settings: host 10.240.9.106 port 20000 family yarp
  Desired settings:  host 10.240.9.106 port 10000 family yarp
Please specify '--write' if it is ok to overwrite current settings, or
Please specify '--read' to use the current settings, or
delete C:\Users\STraversaro\AppData\Roaming\yarp\config\yarp.conf
[ERROR] Aborting.

Expected behavior
I would expect (based on the yarpserver output) that yarpserver --read would just read the configuration from C:\Users\STraversaro\AppData\Roaming\yarp\config\yarp.conf and do not complain that is different from the default.

Screenshots
N.a.

Configuration (please complete the following information):

  • OS: Windows
  • yarp version: 3.4.3 (conda binary build h2634132_7)
  • compiler: Visual Studio 2019

Additional context
Complete environment for reproducibility:

(yarpenv) C:\Users\STraversaro>conda list
# packages in environment at C:\Users\STraversaro\Miniforge3\envs\yarpenv:
#
# Name                    Version                   Build  Channel
ace                       7.0.1                h0e60522_0    conda-forge
ca-certificates           2020.12.5            h5b45459_0    conda-forge
icu                       68.1                 h0e60522_0    conda-forge
jpeg                      9d                   he774522_0    conda-forge
libclang                  11.1.0          default_h5c34c98_1    conda-forge
libjpeg-turbo             2.1.0                h8ffe710_0    conda-forge
libpng                    1.6.37               ha81a0f5_2    conda-forge
openssl                   1.1.1k               h8ffe710_0    conda-forge
qt                        5.12.9               h5909a2a_4    conda-forge
robot-testing-framework   2.0.1                h0e60522_7    robotology
sdl                       1.2.15               h21ff451_1    conda-forge
sqlite                    3.35.5               h8ffe710_0    conda-forge
tinyxml                   2.6.2                h2d74725_2    conda-forge
vc                        14.2                 hb210afc_4    conda-forge
vs2015_runtime            14.28.29325          h5e1d092_4    conda-forge
yarp                      3.4.3                h2634132_7    robotology
ycm-cmake-modules         0.12.1               h0e60522_7    robotology
zlib                      1.2.11            h62dcd97_1010    conda-forge

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions