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

etcd-snapshot loading config fails with "flag provided but not defined: -profile" #2103

Closed
mitchellmaler opened this issue Nov 10, 2021 · 13 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@mitchellmaler
Copy link

Environmental Info:
RKE2 Version:
rke2 version v1.21.6+rke2r1 (b915fc9)
go version go1.16.6b7

Node(s) CPU architecture, OS, and Version:
N/A

Cluster Configuration:
N/A

Describe the bug:
Running the etcd-snapshot commands throw an error flag provided but not defined: -profile.

Steps To Reproduce:
Have the profile set in the config file and run the etcd-snapshot which loads the default config.

Expected behavior:
Runs snapshot.

Actual behavior:
Throw error saying flag profile is not defined.

@brandond
Copy link
Member

brandond commented Nov 10, 2021

cc @dereknola

etcd-snapshot now loads the config file, but if there are other flags in the config file that aren't valid for the etcd-snapshot command it will barf on them. This same problem prevents people from using the same config file for both server and agent, as the agent will complain about unknown server parameters. I wonder if we should just ignore unknown flags?

@Oats87
Copy link
Contributor

Oats87 commented Nov 10, 2021

Ignoring unknown flags can be dangerous, as our current behavior of barfing on unknown flags allows for a user to get more immediate feedback that they have a misconfiguration. If we just ignore unknown flags a user can be misled especially as that is a departure from existing behavior.

@pitshou
Copy link

pitshou commented Nov 10, 2021

I have a customer who is hitting this. So, I am checking to see what they have inside of their config file

Incorrect Usage. flag provided but not defined: -node-label

@dnoland1
Copy link

dnoland1 commented Nov 10, 2021

Assume you can pass the --config flag and choose an alternative config.yaml to workaround this, right?

@mitchellmaler
Copy link
Author

yes there are ways around this. Different config or just passing the args/flags directly to the command.

@mitchellmaler
Copy link
Author

The expected result though is the server config with all the server flags can be used with the etcd-snapshot command.

@brandond
Copy link
Member

I agree that ignoring flags could cause other issues @Oats87 but the current behavior makes the config file non-portable between commands. If you add flags specific to rke2 server those will cause rke2 agent or rke2 etcd-snapshot (and planned future subcommands) to fail. This probably needs a proper design discussion to hash out since there's no easy fix that will satisfy all concerns.

@dereknola
Copy link
Member

dereknola commented Nov 16, 2021

/backport v1.21.7+rke2r1

1 similar comment
@dereknola
Copy link
Member

/backport v1.21.7+rke2r1

@dereknola
Copy link
Member

Backport bot broken?

@chreniuc
Copy link

I've encountered the same problem when trying to generate an on-demand snapshot. I'm using: rke2 version v1.21.6+rke2r1 (b915fc986e84582458af7131fe7f4e686f2af493).

The error shows up even when I run help:

rke2 etcd-snapshot help
FATA[0000] flag provided but not defined: -cluster-cidr 

The config file for the server contains:

cluster-cidr: 10.42.0.0/16

@brandond
Copy link
Member

brandond commented Nov 18, 2021

yes @chreniuc that's the same issue that will be resolved.

@VestigeJ
Copy link
Contributor

VestigeJ commented Dec 1, 2021

Validated a fix across all RKE2 Release Candidates

#2130 [rke2 version v1.20.13-rc1+rke2r1]
#2129 [rke2 version v1.21.7-rc2+rke2r1]
#2191 [rke2 version v1.22.4-rc1+rke2r1]

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

No branches or pull requests

9 participants