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

nmcli fails to configure static addresses with leading zero #1754

Open
crschardt opened this issue Jan 30, 2025 · 1 comment
Open

nmcli fails to configure static addresses with leading zero #1754

crschardt opened this issue Jan 30, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@crschardt
Copy link
Contributor

When a team sets the static IP, they may include a leading zero in the third octet of the IP address. For example team 3206 might enter the IP address as 10.32.06.11. Apparently nmcli doesn't like the leading 0 in 06 and fails to update the configuration correctly. The result is that the configuration call will fail and the coprocessor isn't using the IP address the team thinks it assigned. If entered without the leading zeros, e.g., 10.32.6.11 instead, it works.

Here's an example of the failure from the logs:

Jan 30 05:04:41 photonvision java[665]: [2025-01-30 05:04:41] [General - ShellExec] [DEBUG] Executing "nmcli connection modify static-end1 autoconnect yes ipv4.method manual ipv6.method disabled ipv4.addresses 10.32.06.11/8 ipv4.gateway 10.32.06.1 "
Jan 30 05:04:41 photonvision java[665]: [2025-01-30 05:04:41] [General - ShellExec] [DEBUG] Got exit code 2

Exit code 2 is Invalid user input, wrong nmcli invocation. according to the nmcli documentation.

Here's the logs for success:

Jan 30 05:11:12 photonvision java[665]: [2025-01-30 05:11:12] [General - ShellExec] [DEBUG] Executing "nmcli connection modify static-end1 autoconnect yes ipv4.method manual ipv6.method disabled ipv4.addresses 10.32.6.11/8 ipv4.gateway 10.32.6.1 "
Jan 30 05:11:13 photonvision java[665]: [2025-01-30 05:11:13] [General - ShellExec] [DEBUG] Got exit code 0
@crschardt crschardt added the bug Something isn't working label Jan 30, 2025
@crschardt crschardt self-assigned this Jan 30, 2025
@mcm001
Copy link
Contributor

mcm001 commented Jan 30, 2025

Looks like it’s not to bad to do with the InetAddress class. Also go to bed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants