[SOLVED] Adding node via pvecm fails due to schema failure

SirMyztiq

New Member
May 15, 2020
2
0
1
36
Hello!

Running this command on one of my hosts throws an error:
Code:
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.

I can verify that the same command works without using the use_ssh flag. I looked through the source code to try and pin point it. My hunch is that it tries to parse the link option and it fails then.

Code:
foreach my $link (keys %$links) {
        push @$cmd, "--link$link", PVE::JSONSchema::print_property_string(
            $links->{$link}, get_standard_option('corosync-link'));
        }

I traced the code around to understand it. Without running it, it's hard to tell what it is that is causing the failure. But that is the call that triggers the check_prop method in JSONSchema.pm which generates that error. I'm a bit burned out right now but I will probably try to decipher the way the verification works. Unless it's something else entirely! These are just guesses :D
 
Last edited:
Hi,

A fix for this has already been send:
https://pve.proxmox.com/pipermail/pve-devel/2020-May/043522.html

Normally you really should not use the old ssh fallback to join, it's only there as a fallback and seen as depreacated in Proxmox VE 6.x (API join was added in Proxmox VE 5.2), and we intend to remove that in the next major release.
 
Thanks nonetheless for reporting and tracking down such issues, appreciated!

That's great! I looked through the bug tracker but missed it somehow! Oh well, it was a good learning experience. Thanks for posting the fix, it's a good feeling to know I was close!

I'm not too familiar with the API work, according to the docs for this command, not using the use_ssh flag means it'll use the API? Is that documented somewhere, the API? I looked through the docs but couldn't find it.
 
Last edited:
Hello and sorry for writing to solved thread, but I also run into this issue and have a question.

Normally you really should not use the old ssh fallback to join, it's only there as a fallback and seen as depreacated in Proxmox VE 6.x (API join was added in Proxmox VE 5.2), and we intend to remove that in the next major release.

I am using SSH-based fallback method because I can run it from my puppet module to automaticaly join new server to cluster. API-based joining requires entering root password directly into console which is not suitable for me.

If you are planning to remove SSH-based joining, it there some token-based or any other method to join node in non-interactive manner (and without need of root PW)? Maybe even in plans/roadmap?
 
If you are planning to remove SSH-based joining, it there some token-based or any other method to join node in non-interactive manner (and without need of root PW)? Maybe even in plans/roadmap?

We have API tokens since 6.1, IIRC, https://pve.proxmox.com/pve-docs/chapter-pveum.html#pveum_tokens
So yes, you will be able to use a token from root for joining, and drop that token afterwards.
Note also that the join API only uses HTTPS, so no password or token will be sent as plain text, only encrypted.
 
So yes, you will be able to use a token from root for joining, and drop that token afterwards.
Note also that the join API only uses HTTPS, so no password or token will be sent as plain text, only encrypted.

So are going to extend pvecm add command to accept also API token in future?

I know there is currently API method for joining, but it says "for internal use only" so I suppose there is more tasks pvecm add is doing.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!