Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: GET /health and GET /server/health disagree on the robot's name #10413

Closed
SyntaxColoring opened this issue May 23, 2022 · 1 comment · Fixed by #11175
Closed

bug: GET /health and GET /server/health disagree on the robot's name #10413

SyntaxColoring opened this issue May 23, 2022 · 1 comment · Fixed by #11175
Labels
bug robot server Affects the `robot-server` project robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). software-investigate Our Software team needs to look into this so we can understand more about it. update server

Comments

@SyntaxColoring
Copy link
Contributor

SyntaxColoring commented May 23, 2022

Overview

From @mcous:

I’ve noticed at least that after a rename, GET /health and GET /server/update/health don’t seem to agree on the name... [Discovery Client] defers to the update-server in this case, which is correct, but seems dicey

Steps to reproduce

  1. Change a robot's name via POST /server/name {"name": "new name"}.
  2. Quickly compare the POST response, the response to GET /health, and the response to GET /server/update/health.

Current behavior

I think POST /server/name and GET /server/update/health are correct, but GET /health lags behind and shows the old name.

Output from cd discovery-client && yarn run discovery after changing the name from OLDNAME to NEWNAME:

{
  name: 'NEWNAME',
  health: {
    name: 'OLDNAME',
    robot_model: 'OT-2 Standard',
    api_version: '6.0.0',
    fw_version: 'v1.1.0-25e5cea',
    board_revision: '2.1',
    logs: [
      '/logs/serial.log',
      '/logs/api.log',
      '/logs/server.log',
      [length]: 3
    ],
    system_version: 'v1.10.0',
    maximum_protocol_api_version: [ 2, 12, [length]: 2 ],
    minimum_protocol_api_version: [ 2, 0, [length]: 2 ],
    links: {
      apiLog: '/logs/api.log',
      serialLog: '/logs/serial.log',
      serverLog: '/logs/server.log',
      apiSpec: '/openapi.json',
      systemTime: '/system/time'
    }
  },
  serverHealth: {
    updateServerVersion: '6.0.0',
    apiServerVersion: '6.0.0',
    smoothieVersion: 'unimplemented',
    systemVersion: 'v1.10.0',
    capabilities: {
      buildrootUpdate: '/server/update/begin',
      restart: '/server/restart'
    },
    name: 'NEWNAME',
    serialNumber: 'bitter-wood',
    bootId: 'f723c623-b8dc-41c2-936a-43cca75c0c31'
  },
  addresses: [
    {
      ip: '192.168.86.233',
      port: 31950,
      seen: true,
      healthStatus: 'ok',
      serverHealthStatus: 'ok',
      healthError: null,
      serverHealthError: null
    },
    [length]: 1
  ]
}

Expected behavior

GET /health and GET /server/health should probably always agree on the name.

All of the name fields printed by yarn run discovery should eventually agree.

@SyntaxColoring SyntaxColoring added bug software-investigate Our Software team needs to look into this so we can understand more about it. update server robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). robot server Affects the `robot-server` project labels May 23, 2022
@SyntaxColoring
Copy link
Contributor Author

Possibly relevant:

https://www.freedesktop.org/wiki/Software/systemd/hostnamed/

Note that hostnamed starts only on request and terminates after a short idle period. This effectively means that PropertyChanged messages are not sent out for changes made directly on the files (as in: administrator edits the files with vi). This is actually intended behavior: manual configuration changes should require manual reloading of them.

And update-server does make changes directly on the files, currently.

We could either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug robot server Affects the `robot-server` project robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). software-investigate Our Software team needs to look into this so we can understand more about it. update server
Projects
None yet
1 participant