diff --git a/api/http/handler/endpoints/endpoint_create.go b/api/http/handler/endpoints/endpoint_create.go index c80369489..7a2a08827 100644 --- a/api/http/handler/endpoints/endpoint_create.go +++ b/api/http/handler/endpoints/endpoint_create.go @@ -470,7 +470,7 @@ func (handler *Handler) createTLSSecuredEndpoint(payload *endpointCreatePayload, func (handler *Handler) snapshotAndPersistEndpoint(endpoint *portainer.Endpoint) *httperror.HandlerError { err := handler.SnapshotService.SnapshotEndpoint(endpoint) if err != nil { - if strings.Contains(err.Error(), "Invalid request signature") { + if strings.Contains(err.Error(), "Invalid request signature") || strings.Contains(err.Error(), "unknown") { err = errors.New("agent already paired with another Portainer instance") } return &httperror.HandlerError{http.StatusInternalServerError, "Unable to initiate communications with environment", err}