question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting error when creating a new cluster

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
FuzzOli87commented, May 15, 2020

@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.

1reaction
Moritz0708commented, May 15, 2020

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": [] }

Read more comments on GitHub >

github_iconTop Results From Across the Web

An error occurred while creating the cluster and the nodes will ...
Hi, If you restart node in a cluster, cluster resources will failover to another node. While it is happening, you may get IP...
Read more >
How to Troubleshoot Create Cluster Failures - Argon Systems
How to Troubleshoot Create Cluster Failures ; 1 Step 1: Run the Cluster Validation Tool ; 2 Step 2: Analyze the CreateCluster Log...
Read more >
How do I resolve cluster creation errors in Amazon EKS?
I get service errors when I provision an Amazon Elastic Kubernetes Service (Amazon EKS) cluster using AWS CloudFormation or eksctl.
Read more >
Troubleshoot issues creating a user cluster in the Google ...
One solution to fix the issue: Delete the cluster. Create the cluster again with a another name that doesn't conflict with an existing...
Read more >
error occurred while creating the cluster - Server Fault
I my case with similar error while trying to create a cluster on HP servers the problem was solved by installing latest NIC...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found