Skip to content

Commit a47bc86

Browse files
Splice Teamcopybara-github
authored andcommitted
Enhance SpliceD logging for domain join failures
PiperOrigin-RevId: 881645770
1 parent 3c0cca3 commit a47bc86

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

shared/provisioning/provisioning_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func TextData(hostname, domain string, reuse, djoinCompat bool) ([]byte, error)
149149
uintptr(unsafe.Pointer(&buff)), //_Out_opt_ LPWSTR *pProvisionTextData
150150
)
151151
if r != 0 {
152-
return result, errnoErr(syscall.Errno(r))
152+
return result, fmt.Errorf("%v: Win32 error %d", errnoErr(syscall.Errno(r)), r)
153153
}
154154

155155
for i := range buff {
@@ -192,7 +192,7 @@ func BinData(hostname string, domain string, reuse bool) ([]byte, error) {
192192
0, //_Out_opt_ LPWSTR *pProvisionTextData
193193
)
194194
if r != 0 {
195-
return buff[:binSize], errnoErr(syscall.Errno(r))
195+
return buff[:binSize], fmt.Errorf("%v: Win32 error %d", errnoErr(syscall.Errno(r)), r)
196196
}
197197

198198
return buff[:binSize], nil

spliced/spliced.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func join(req *models.Request) ([]byte, error) {
198198
metrics.Get("join_attempt").Increment()
199199
blob, err := provisioner(wantName, conf.Domain, permitReuse(req))
200200
if err != nil {
201-
deck.WarningfA("Failed to join host with: %v", err).With(eventID(EvtJoinFailure)).Go()
201+
deck.WarningfA("Failed to join host %s to domain %s (reuse=%t) with: %v", wantName, conf.Domain, permitReuse(req), err).With(eventID(EvtJoinFailure)).Go()
202202
return nil, err
203203
}
204204

0 commit comments

Comments
 (0)