Bug 53005 - Ошибка при выполнении команды pvecm add: malformed UTF-8 character in JSON string
Summary: Ошибка при выполнении команды pvecm add: malformed UTF-8 character in JSON st...
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: pve-cluster (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Alexey Shabalin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-09 16:04 MSK by zvn_mail
Modified: 2025-03-01 19:13 MSK (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zvn_mail 2025-02-09 16:04:34 MSK
создаю тестовый кластер

pve1 (10.1.2.101):
systemctl start pve-cluster
pvecm create mycluster

pve2 (10.1.2.102):
systemctl start pve-cluster
pvecm add pve1

Please enter superuser (root) password for 'pve1': ********
Establishing API connection with host 'pve1'
The authenticity of host 'pve1' can't be established.
X509 SHA256 key fingerprint is A4:D2:8B:8B:C1:88:BE:F6:CF:15:A8:7C:7D:0F:AC:EF:4B:8E:C1:95:14:58:D2:28:31:6A:E0:D2:18:BC:B6:44.
Are you sure you want to continue connecting (yes/no)? Login succeeded.
check cluster join API version
No cluster network links passed explicitly, fallback to local node IP '10.1.2.102'
Request addition of this node

TASK ERROR: malformed UTF-8 character in JSON string, at character offset 30 (before "\x{fffd}t,\x{fffd}]J...") at /usr/share/perl5/JSON.pm line 193, <STDIN> line 1.


pve1:

/usr/share/perl5/PVE/Cluster/Setup.pm
sub join {
...
    my $res = eval { $conn->post("/cluster/config/nodes/$nodename", $args); };
...

/usr/share/perl5/PVE/APIClient/LWP.pm
sub call {
...
	} elsif ($method eq 'POST') {
	$response = $ua->request(HTTP::Request::Common::POST($uri, Content => $param));
...
	my $msg = $response->message;
	my $errors = eval {
	    return if $ct !~ m|application/json|;
print "decoded_content : " .  $response->decoded_content . "\n";
	    my $res = from_json($response->decoded_content, {utf8 => 1, allow_nonref => 1});
	    return $res->{errors};
	};

decoded_content выводит json с содержимым authfile (со стороны pve1), но часть симоволов закодирована как (\u....)


pve2:

/usr/share/perl5/PVE/API2/ClusterConfig.pm
__PACKAGE__->register_method ({
    name => 'addnode',
    path => 'nodes/{node}',
    method => 'POST',
...
	my $res = {
	    corosync_authkey => PVE::Tools::file_get_contents($authfile),
	    corosync_conf => PVE::Tools::file_get_contents($clusterconf),
	    warnings => $vc_warnings,
	};

	return $res;
Comment 1 Evgeny Shesteperov 2025-02-11 13:23:12 MSK
Версия: pve-cluster-8.0.10-alt1

Воспроизводится в P11.
Comment 2 zvn_mail 2025-02-24 18:44:43 MSK
(Ответ для Evgeny Shesteperov на комментарий #1)
> Версия: pve-cluster-8.0.10-alt1
> 
> Воспроизводится в P11.

уже не воспроизводится (м.б. причина была в pve-http-server)