canonical / ubuntu-pro-client

Ubuntu Pro Client for offerings from Canonical
https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/
GNU General Public License v3.0
51 stars 69 forks source link

Bug: `pro --help` reaches out to the contract server #3126

Closed panlinux closed 2 weeks ago

panlinux commented 1 month ago

Description of the bug

$ pro --help
Error connecting to /v1/resources: 503 <html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

Expected behavior

The help output should be shown without having to reach out to the internet.

Current behavior

pro --help fails to produce help output in an offline environment, or in an online one if the contract server is failing.

To Reproduce

Run pro --help in an offline environment:

root@n:~# ip l set dev eth0 down
root@n:~# ping 1.1.1.1
ping: connect: Network is unreachable
root@n:~# pro --help
Failed to connect to https://contracts.canonical.com/v1/resources?architecture=amd64&kernel=6.5.0-35-generic&series=noble&virt=lxc
[Errno -3] Temporary failure in name resolution

System information:

Additional context

renanrodrigo commented 1 month ago

Hello, @panlinux , thanks for reporting this.

There is work ongoing to fix it.

As of today, pro help and similar commands present information about the tool AND about the Pro services. In the UX rework we are doing, help will only contain information about the tool, and will not need to fetch anything from any server.