Hi all,
I encountered a problem few days ago trying to get console on a Proxmox cluster that have an very big uptime.
I didn't manage to get console with the following message :
unable to parse worker upid '......'
I note that the regexp in the Tools.pm perl module was wrong.
When I modify it, I got another message because hex command in upid_decode function cannot transform too big hex value (more that 8 digits).
So I modify Tools.pm like this :
--- /usr/share/perl5/PVE/Tools_20140618.pm 2014-06-18 14:20:40.000000000 +0200
+++ /usr/share/perl5/PVE/Tools.pm 2014-06-24 12:37:49.000000000 +0200
@@ -16,6 +16,7 @@
use Digest::SHA;
use Text:
arseWords;
use String::ShellQuote;
+use Math::BigInt; # Fortunately this module seems to be installed - let's use it !
our @EXPORT_OK = qw(
lock_file
@@ -758,11 +759,11 @@
my $filename;
# "UPID:$node:$pid:$pstart:$startime:$dtype:$id:$user"
- if ($upid =~ m/^UPID
[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?)
[0-9A-Fa-f]{8})
[0-9A-Fa-f]{8})
[0-9A-Fa-f]{8})
[^:\s]+)
[^:\s]*)
[^:\s]+):$/) {
+ if ($upid =~ m/^UPID
[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?)
[0-9A-Fa-f]{8,16})
[0-9A-Fa-f]{8,16})
[0-9A-Fa-f]{8,16})
[^:\s]+)
[^:\s]*)
[^:\s]+):$/) {
$res->{node} = $1;
- $res->{pid} = hex($3);
- $res->{pstart} = hex($4);
- $res->{starttime} = hex($5);
+ $res->{pid} = Math::BigInt->from_hex($3);
+ $res->{pstart} = Math::BigInt->from_hex($4);
+ $res->{starttime} = Math::BigInt->from_hex($5);
$res->{type} = $6;
$res->{id} = $7;
$res->{user} = $8;
Then I note that another script used that regexp :
--- /usr/share/pve-manager/ext4/pvemanagerlib_20140618.js 2014-06-18 14:24:26.000000000 +0200
+++ /usr/share/pve-manager/ext4/pvemanagerlib.js 2014-06-24 12:36:52.000000000 +0200
@@ -529,7 +529,7 @@
parse_task_upid: function(upid) {
var task = {};
- var res = upid.match(/^UPID
\S+)
[0-9A-Fa-f]{8})
[0-9A-Fa-f]{8})
[0-9A-Fa-f]{8})
[^:\s]+)
[^:\s]*)
[^:\s]+):$/);
+ var res = upid.match(/^UPID
\S+)
[0-9A-Fa-f]{8,16})
[0-9A-Fa-f]{8,16})
[0-9A-Fa-f]{8,16})
[^:\s]+)
[^:\s]*)
[^:\s]+):$/);
if (!res) {
throw "unable to parse upid '" + upid + "'";
}
It seems to work now.
Hope this can helps someone or inspire another.
Cheers.
I encountered a problem few days ago trying to get console on a Proxmox cluster that have an very big uptime.
I didn't manage to get console with the following message :
unable to parse worker upid '......'
I note that the regexp in the Tools.pm perl module was wrong.
When I modify it, I got another message because hex command in upid_decode function cannot transform too big hex value (more that 8 digits).
So I modify Tools.pm like this :
--- /usr/share/perl5/PVE/Tools_20140618.pm 2014-06-18 14:20:40.000000000 +0200
+++ /usr/share/perl5/PVE/Tools.pm 2014-06-24 12:37:49.000000000 +0200
@@ -16,6 +16,7 @@
use Digest::SHA;
use Text:
use String::ShellQuote;
+use Math::BigInt; # Fortunately this module seems to be installed - let's use it !
our @EXPORT_OK = qw(
lock_file
@@ -758,11 +759,11 @@
my $filename;
# "UPID:$node:$pid:$pstart:$startime:$dtype:$id:$user"
- if ($upid =~ m/^UPID
+ if ($upid =~ m/^UPID
$res->{node} = $1;
- $res->{pid} = hex($3);
- $res->{pstart} = hex($4);
- $res->{starttime} = hex($5);
+ $res->{pid} = Math::BigInt->from_hex($3);
+ $res->{pstart} = Math::BigInt->from_hex($4);
+ $res->{starttime} = Math::BigInt->from_hex($5);
$res->{type} = $6;
$res->{id} = $7;
$res->{user} = $8;
Then I note that another script used that regexp :
--- /usr/share/pve-manager/ext4/pvemanagerlib_20140618.js 2014-06-18 14:24:26.000000000 +0200
+++ /usr/share/pve-manager/ext4/pvemanagerlib.js 2014-06-24 12:36:52.000000000 +0200
@@ -529,7 +529,7 @@
parse_task_upid: function(upid) {
var task = {};
- var res = upid.match(/^UPID
+ var res = upid.match(/^UPID
if (!res) {
throw "unable to parse upid '" + upid + "'";
}
It seems to work now.
Hope this can helps someone or inspire another.
Cheers.