ansible-role-proxmox: Getting error when creating a new cluster

Hello!

Thanks for all your hard work on this. I’ve been setting up my cluster and it runs fine all the way until it has to add a new node to a cluster. I see that the cluster is created and the playbook passes all the tests and reports that things were changed. However, the cluster never gets any new nodes and it actually throws and error.

I get this error: TASK ERROR: format error at /usr/share/perl5/PVE/JSONSchema.pm line 1866 type: Invalid schema definition. optional: Invalid schema definition. description: Invalid schema definition. format: property is missing and it is not optional

Let me know what logs or whatever you need to debug.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@lae I did some digging through the source code as well as tried some different configurations for the command. It feels like this isn’t a bug in the playbook itself.

root@mymachine:~# pvecm add 192.168.0.xxx -use_ssh=yes -link0 192.168.0.xxx
format error at /usr/share/perl5/PVE/JSONSchema.pm line 1866 format: property is missing and it is not optional type: Invalid schema definition. description: Invalid schema definition. optional: Invalid schema definition.

Throws out an error, even running the command directly on the host.

If I run the same command with -use_ssh=no or without -use_ssh at all, it works.

In the code, there is an entire section dedicated to when the use_ssh flag is false.

	    if (!$param->{use_ssh}) {
		my $password = PVE::PTY::read_password("Please enter superuser (root) password for '$host': ");

		delete $param->{use_ssh};
		$param->{password} = $password;

		my $local_cluster_lock = "/var/lock/pvecm.lock";
		PVE::Tools::lock_file($local_cluster_lock, 10, \&PVE::Cluster::Setup::join, $param);

		if (my $err = $@) {
		    if (ref($err) eq 'PVE::APIClient::Exception' && defined($err->{code}) && $err->{code} == 501) {
			$err = "Remote side is not able to use API for Cluster join!\n" .
			       "Pass the 'use_ssh' switch or update the remote side.\n";
		    }
		    die $err;
		}
		return; # all OK, the API join endpoint successfully set us up
	    }

So the error has to happen when it’s set. I followed the code and my hunch is that it happens in this line: image

The link0 flag doesn’t get used at all when use_ssh is not set. I just traced the code as much as I could without running it.

Long story short, I think it might be a bug on the parser from the PVE code.

Thanks @Moritz0708 for letting me know how to use that. I’m just now picking up Ansible. That helped me getting the params for the command.

I have the same Error. The 2 Servers not Join the Proxmox Cluster.

Its on the Task: TASK [lae.proxmox : Add node to Proxmox cluster]

Error: changed: [Proxible-2] => { "changed": true, "cmd": [ "pvecm", "add", "123.456.789.012", "-use_ssh", "-link0", "123.456.789.013" ], "delta": "0:00:01.808788", "end": "2020-05-15 08:51:08.420647", "invocation": { "module_args": { "_raw_params": "pvecm add 123.456.789.012 -use_ssh -link0 123.456.789.013 ", "_uses_shell": false, "argv": null, "chdir": null, "creates": "/etc/pve/corosync.conf", "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": true } }, "rc": 0, "start": "2020-05-15 08:51:06.611859", "stderr": "format error at /usr/share/perl5/PVE/JSONSchema.pm line 1866 format: property is missing and it is not optional description: Invalid schema definition. optional: Invalid schema definition. type: Invalid schema definition.", "stderr_lines": [ "format error at /usr/share/perl5/PVE/JSONSchema.pm line 1866 format: property is missing and it is not optional description: Invalid schema definition. optional: Invalid schema definition. type: Invalid schema definition." ], "stdout": "", "stdout_lines": [] }

@lae Sure, it’s pretty plain, mostly defaults:

pve_group: pve_familia
pve_reboot_on_kernel_update: true
pve_run_system_upgrades: true
pve_cluster_enabled: yes
pve_cluster_clustername: familia

all.yaml

ntp_manage_config: true
ntp_servers:
  - time-a-g.nist.gov iburst
  - time-a-wwv.nist.gov iburst
  - time-a-b.nist.gov iburst
  - utcnist.colorado.edu iburst
  - time-b-wwv.nist.gov	iburst