chenhg5/cc-connect · error

own device identity not found

Error message

own device identity not found

What it means

crossSignOwnDeviceErr fails with "own device identity not found" when the OlmMachine's OwnIdentity() returns nil, meaning the crypto machine has no stored identity (curve25519/ed25519 keys) for the bot's own device. Signing the device is impossible without its own identity. Called by setupCrossSigning after cross-signing bootstrap.

Source

Thrown at platform/matrix/verification.go:391

			userID = client.UserID.String()
		}
		return &mautrix.ReqUIAuthLogin{
			BaseAuthData: mautrix.BaseAuthData{
				Type:    mautrix.AuthTypePassword,
				Session: uiResp.Session,
			},
			User:     userID,
			Password: p.crossSigningPassword,
		}
	}
	slog.Warn("matrix: no supported UIA flow for cross-signing; consider setting cross_signing_password in config", "flows", uiResp.Flows)
	return nil
}

func (p *Platform) crossSignOwnDeviceErr(ctx context.Context, mach *crypto.OlmMachine) error {
	ownDevice := mach.OwnIdentity()
	if ownDevice == nil {
		return fmt.Errorf("own device identity not found")
	}
	return mach.SignOwnDevice(ctx, ownDevice)
}

func (p *Platform) crossSignOwnDevice(ctx context.Context, mach *crypto.OlmMachine) {
	ownDevice := mach.OwnIdentity()
	if ownDevice == nil {
		slog.Warn("matrix: own device identity not found, skipping self-sign")
		return
	}
	if err := mach.SignOwnDevice(ctx, ownDevice); err != nil {
		slog.Warn("matrix: failed to sign own device", "error", err)
	} else {
		slog.Info("matrix: cross-signed own device", "device", ownDevice.DeviceID)
	}
}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Ensure device keys were uploaded to the homeserver (/keys/upload) before signing — check earlier initE2EE logs
  2. Let one full sync complete after store creation before cross-signing; add a retry after the initial sync
  3. If the store is inconsistent, back it up and delete it so a fresh bootstrap re-creates identities (re-verify devices afterwards)
  4. Verify the crypto store belongs to the same user_id/device_id as the current client
Defensive patterns

Strategy: retry

Validate before calling

if mach.OwnIdentity() == nil {
    // wait for initial sync / key upload, then retry
}

Type guard

func ownIdentityReady(mach *crypto.OlmMachine) bool { return mach.OwnIdentity() != nil }

Try / catch

if err := p.crossSignOwnDeviceErr(ctx, mach); err != nil {
    if err.Error() == "own device identity not found" {
        // retry after keys upload + first sync
        return
    }
    slog.Error("cross-signing own device failed", "err", err)
}

Prevention

When it happens

Trigger: mach.OwnIdentity() returns nil during crossSignOwnDeviceErr — the local device's identity keys are not in the crypto store, typically because device key upload never completed or the store lacks the own-device record.

Common situations: Fresh crypto store before the first keys-upload sync completed; crypto store created under a different user/device and reused incorrectly; interrupted E2EE bootstrap left the store half-initialized; cross-signing seeds were restored but the own-device identity was never saved.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/b4ba42315689be70. Report an issue: GitHub.