Skip to content

"Could not find Actor" thousands of error report for a single account #1313

Description

@muratcorlu

On my ActivityPub server's Sentry logs, I have more than 10k error logs in last 1 week, like below. Maybe that account has a misconfigured server. But I think a legit user action (like following someone, one interacting with a post) should not cause that much error logs.

Error: Could not find Actor https://...

Issue ID: 6792579297
Project: activitypub-server
Date: 9/19/2025, 11:35:19 AM

Tags

  • environment: production
  • handled: yes
  • level: error
  • mechanism: generic
  • os: Alpine Linux 3.22.1
  • os.name: Alpine Linux
  • runtime: node v22.18.0
  • runtime.name: node
  • server_name: 3b5940ef8a98

Exception

Exception 1

Type: Error
Value: Could not find Actor https://fe.disroot.org/users/spainforpalestine

Stacktrace

 AccountService.getByApId in /opt/activitypub/dist/app.js [Line 1774] (In app)
    }
    const context2 = this.fedifyContextFactory.getFedifyContext();
    const documentLoader = await context2.getDocumentLoader({
      handle: "index"
    });
    const potentialActor = await lookupObject(id, { documentLoader });
    if (potentialActor === null) {
      throw new Error(`Could not find Actor ${id}`);  <-- SUSPECT LINE
    }
    if (!isActor(potentialActor)) {
      return null;
    }
    const data = await mapActorToExternalAccountData(potentialActor);
    await this.createExternalAccount(data);
    return this.accountRepository.getByApId(id);
 process.processTicksAndRejections in node:internal/process/task_queues [Line 105] (Not in app)
 PostService.getByApId in /opt/activitypub/dist/app.js [Line 11181] (In app)
 handleAnnounce in /opt/activitypub/dist/app.js [Line 3640] (In app)
    ctx.data.globaldb.set([announce.id.href], announceJson);
    const site = await siteService.getSiteByHost(ctx.host);
    if (!site) {
      throw new Error(`Site not found for host: ${ctx.host}`);
    }
    const senderAccount = await accountService.getByApId(sender.id);
    if (senderAccount !== null) {
      const postResult = await postService.getByApId(announce.objectId);  <-- SUSPECT LINE
      if (isError(postResult)) {
        const error2 = getError(postResult);
        switch (error2) {
          case "upstream-error":
            ctx.data.logger.info(
              "Upstream error fetching post for reposting",
              {
 Unknown function in /opt/activitypub/node_modules/@fedify/fedify/dist/middleware-CXZPCCsr.js [Line 2692] (Not in app)
				});
				span$1.end();
				return;
			}
			const { class: cls, listener } = dispatched;
			span$1.updateName(`activitypub.dispatch_inbox_listener ${cls.name}`);
			try {
				await listener(context$1.toInboxContext(message.identifier, message.activity, activity.id?.href, getTypeId(activity).href), activity);  <-- SUSPECT LINE
			} catch (error) {
				try {
					await this.inboxErrorHandler?.(context$1, error);
				} catch (error$1) {
					logger$1.error("An unexpected error occurred in inbox error handler:\n{error}", {
						error: error$1,
						trial: message.attempt,
 #listenInboxMessage in /opt/activitypub/node_modules/@fedify/fedify/dist/middleware-CXZPCCsr.js [Line 2673] (Not in app)
					activityId: activity.id?.href,
					activity: message.activity,
					recipient: message.identifier
				});
				return;
			}
		}
		await this._getTracer().startActiveSpan("activitypub.dispatch_inbox_listener", { kind: SpanKind.INTERNAL }, async (span$1) => {  <-- SUSPECT LINE
			const dispatched = this.inboxListeners?.dispatchWithClass(activity);
			if (dispatched == null) {
				logger$1.error("Unsupported activity type:\n{activity}", {
					activityId: activity.id?.href,
					activity: message.activity,
					recipient: message.identifier,
					trial: message.attempt
 Unknown function in /opt/activitypub/node_modules/@fedify/fedify/dist/middleware-CXZPCCsr.js [Line 2511] (Not in app)
				}
			});
			else if (message.type === "inbox") await tracer.startActiveSpan("activitypub.inbox", {
				kind: SpanKind.CONSUMER,
				attributes: { "activitypub.shared_inbox": message.identifier == null }
			}, extractedContext, async (span) => {
				try {
					await this.#listenInboxMessage(contextData, message, span);  <-- SUSPECT LINE
				} catch (e) {
					span.setStatus({
						code: SpanStatusCode.ERROR,
						message: String(e)
					});
					throw e;
				} finally {
 Unknown function in /opt/activitypub/node_modules/@fedify/fedify/dist/middleware-CXZPCCsr.js [Line 2506] (Not in app)
						message: String(e)
					});
					throw e;
				} finally {
					span.end();
				}
			});
			else if (message.type === "inbox") await tracer.startActiveSpan("activitypub.inbox", {  <-- SUSPECT LINE
				kind: SpanKind.CONSUMER,
				attributes: { "activitypub.shared_inbox": message.identifier == null }
			}, extractedContext, async (span) => {
				try {
					await this.#listenInboxMessage(contextData, message, span);
				} catch (e) {
					span.setStatus({
 GCloudPubSubPushMessageQueue.handleMessage in /opt/activitypub/dist/app.js [Line 9743] (In app)
    }
    const fedifyId = message.attributes.fedifyId ?? "unknown";
    this.logger.info(
      `Handling message [FedifyID: ${fedifyId}, PubSubID: ${message.id}]`,
      { fedifyId, pubSubId: message.id, mq_message: message.data }
    );
    try {
      await this.messageHandler(message.data);  <-- SUSPECT LINE
      await this.handleSuccess(message.data);
      this.logger.info(
        `Acknowledged message [FedifyID: ${fedifyId}, PubSubID: ${message.id}]`,
        { fedifyId, pubSubId: message.id }
      );
    } catch (error2) {
      const shouldRetryUsingTopic = this.useRetryTopic && this.retryTopic !== void 0;
 dispatch in /opt/activitypub/node_modules/hono/dist/compose.js [Line 22] (Not in app)
        handler = middleware[i][0][0];
        context.req.routeIndex = i;
      } else {
        handler = i === middleware.length && next || void 0;
      }
      if (handler) {
        try {
          res = await handler(context, () => dispatch(i + 1));  <-- SUSPECT LINE
        } catch (err) {
          if (err instanceof Error && onError) {
            context.error = err;
            res = await onError(err, context);
            isError = true;
          } else {
            throw err;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions