oxidecomputer / oxidecomputer/propolis

propolis-cli -s is very confused with a port number

Open
#1,062 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

development
Dominant language
Rust
Stars
270
Forks
42
Avg merge
4d 5h
Merged PRs (30d)
6

Description

in propolis-server we accept a SocketAddr as a binary argument outright, meaning you can run ./propolis-server run path/to/ovmf.fd 0.0.0.0:12345 and you're off.

however, in propolis-cli we have -s for the server address, and -p for the port. this makes for some confusing UI: if you ./propolis-cli -s 127.0.0.1:12345 to talk to that server you just started, this actually just gets you

failed to lookup address information: node name or service name not known

... because, i think, resolve_host is taking the string from the server parameter and forcing Rust to treat it as literally either IP address or hostname, with an explicit port 0 for the socket. :3000 makes it clearly not an IP address so Rust's ToSocketAddrs falls back to trying to look up the host which it also won't do, and whoops name or service not known.

i think we should probably drop the -p flag and expect ip:port in all cases.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in bin/propolis-cli/src/main.rs, especially the argument handling and resolve_host at lines 466-473; compare it with the SocketAddr handling in bin/propolis-server/src/main.rs at lines 81-82. The change is complete when propolis-cli accepts a server address in ip:port form without the separate port confusion and no longer produces the lookup error for addresses such as 127.0.0.1:12345.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.