Closed EdouardVanbelle closed 3 weeks ago
I bypassed this issue doing a fallback to the board
diff --git a/client/system/info_linux.go b/client/system/info_linux.go
index d85a6fae..564195a4 100644
--- a/client/system/info_linux.go
+++ b/client/system/info_linux.go
@@ -11,6 +11,7 @@ import (
"runtime"
"strings"
"time"
+ "regexp"
log "github.com/sirupsen/logrus"
"github.com/zcalusic/sysinfo"
@@ -89,9 +90,17 @@ func _getInfo() string {
func sysInfo() (serialNumber string, productName string, manufacturer string) {
var si sysinfo.SysInfo
si.GetSysInfo()
+ isascii, _ := regexp.Compile("^[[:ascii:]]+$")
serial := si.Chassis.Serial
if (serial == "Default string" || serial == "") && si.Product.Serial != "" {
serial = si.Product.Serial
}
- return serial, si.Product.Name, si.Product.Vendor
+ if (!isascii.MatchString(serial)) && si.Board.Serial != "" {
+ serial = si.Board.Serial
+ }
+ name := si.Product.Name
+ if (!isascii.MatchString(name)) && si.Board.Name != "" {
+ name = si.Board.Name
+ }
+ return serial, name, si.Product.Vendor
}
let me know if you want a merge request
Hello I am getting an error:
encryption/message.go:14: failed marshalling message string field contains invalid UTF-8
during anetbird up --key XXX --management-url YYY
NetBird version
0.28.4
More details on the reason
I have rebuilt netbird to have a better understanding of the isssue, here is the reason: my board do not have any serialnumber !
For better understanding:
which raises me:
My device has no serial number which generated a failure on marshalling phase
and I confirm it via a dmidecode:
do you have any suggestion to prevent this ? We could eventually use the UUID if serial number is not present ?
Kindest regards note: I love your project !