Skip to content

Serial console shows "Connected" when instance is not running #2169

Closed

Description

@iliana

I have an instance that is stopped. When I navigate to its serial console in the console, it shows a blank terminal (as one would expect), but also "Connected" in the lower right. No errors display.

When I try to do the same thing in the CLI, I get:

$ oxide instance serial console --project iliana --instance axiomatic

Connection closed: Error
Server error: Invalid Request: instance is stopped and has no active serial console server

Activity

  1. david-crespo commented on Apr 19, 2024

    @david-crespo
    Collaborator

    We're displaying the status we think it is, so there must be something wrong with our error handling:

    useEffect(() => {
    const setOpen = () => setConnectionStatus('open')
    const setClosed = () => setConnectionStatus('closed')
    const setError = () => setConnectionStatus('error')
    ws.current?.addEventListener('open', setOpen)
    ws.current?.addEventListener('closed', setClosed)
    ws.current?.addEventListener('error', setError)
    return () => {
    ws.current?.removeEventListener('open', setOpen)
    ws.current?.removeEventListener('closed', setClosed)
    ws.current?.removeEventListener('error', setError)
    }
    }, [])

    <Badge color={statusColor[connectionStatus]}>
    {statusMessage[connectionStatus]}
    </Badge>

  2. iliana commented on Apr 19, 2024

    @iliana
    ContributorAuthor

    I don't know that Firefox is seeing the error; it's not showing up in the network console at all where you can usually observe the websocket traffic. Here's one from the serial console of a running instance:

    image

    But when connecting to a stopped instance I see no messages whatsoever.

  3. david-crespo commented on Apr 19, 2024

    @david-crespo
    Collaborator

    The CLI isn't doing anything too exciting.

    https://github.com/oxidecomputer/oxide.rs/blob/bc90ca23109b9e699472bdda4867e4f93d18da1a/cli/src/cmd_instance.rs#L109-L129

    The error message you see in the CLI comes from an error response from the API — maybe we're ignoring errors on the initial attempt to upgrade the connection? Or maybe something stranger is happening and API is handling the request from the browser differently.

    https://github.com/oxidecomputer/omicron/blob/77fffe5e3492c471f9fd176d54e9cdce51c6e0ff/nexus/src/app/instance.rs#L1828-L1833

  4. david-crespo commented on Apr 19, 2024

    @david-crespo
    Collaborator

    When I connect to a stopped instance I get a 101, which I guess we take as a kind of success, and then nothing else. Will need to look closer at what the CLI is doing to get that error.

    image
  5. added this to the 9 milestone on May 6, 2024
  6. lifning commented on May 15, 2024

    @lifning
    Contributor

    our websocket endpoints unconditionally upgrade (101) -- the thing to look for is a websocket Close message, with the relevant error message appearing as a Close Code.

  7. david-crespo commented on May 15, 2024

    @david-crespo
    Collaborator

    Thanks @lifning, that was exactly what I needed to hear. Notice anything just very slightly off here?

    ws.current?.addEventListener('closed', setClosed)

    https://developer.mozilla.org/en-US/docs/Web/API/WebSocket#events

  8. self-assigned this
    on May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions