发布日期: 2026-07-17
版本号: v1.17.11

Dapr 1.17.11版本修复了一个关键问题:当Actor提醒或作业的名称包含管道符|@等特定字符时,它们无法通过调度服务成功注册。此前,这些字符在调用Actor时是被接受的,导致了API边界与提醒注册之间的不一致。问题根源在于调度服务内部使用双管道符作为分隔符,却对名称的每个片段应用了过于严格的Kubernetes DNS-1123子域名验证规则。新版本已统一采用与Dapr API边缘相同的宽松策略,现仅排除少数非法字符(如反斜杠、井号、问号及控制字符),并修复了错误提示信息的准确性。

更新内容 (中文)

Dapr 1.17.11

本次更新包含以下错误修复:

当参与者提醒或作业的名称或参与者 ID 包含 |@ 等字符时,注册会失败

问题描述

通过调度器服务注册参与者提醒时,如果提醒名称或其所属的参与者 ID 包含某些字符(如竖线 |@ 符号),注册会失败。 调用参与者和保存参与者状态时,这些字符是被接受的。因此,在其他方面运行正常的参与者无法为其创建提醒。

此情况下返回的错误信息也具有误导性:

a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

错误信息声称只允许小写名称,而实际上大写名称是被接受的,并且它没有说明具体是哪些字符被拒绝。

影响范围

如果您使用了基于调度器的参与者提醒(自 1.15 版本以来为默认设置),并且您的提醒名称、参与者 ID 或计划作业名称包含了严格 DNS-1123 字符集以外的字符(例如 |@ 或大写字母),则会受到影响。

根本原因

调度器将每个提醒或作业组合成一个单一名称,格式为 actorreminder||<namespace>||<type>||<id>||<name>(对于作业则为 app||<namespace>||<appID>||<name>),并使用 || 作为内部分隔符。 随后,每个由 || 分隔的段都会根据 Kubernetes 的 DNS-1123 子域名规则进行验证,该规则只允许小写字母数字字符、-.。 这比 Dapr 在其 API 边界已接受的字符集要严格得多,从而导致了参与者调用与提醒注册之间的不一致。 由于验证器在检查前会将每个段转换为小写,因此大写名称在实践中能够通过,而表面显示的错误信息仍然引用只允许小写的 RFC 1123 子域名。

解决方案

调度器现在使用与 Dapr 在其 API 边界应用的相同策略来验证名称,因此任何用于参与者调用的名称也可以用于提醒或作业。 提醒名称、作业名称和参与者标识符现在可以包含除 /\\#?、控制字符(包括空字符 NUL 字节)以及精确路径序列 ... 之外的任何字符。 现在允许使用大写字母以及 |@ 等字符,并且参与者 ID 和名称内继续接受 ||。 现在,列出 ID 中包含 || 的参与者的提醒时,也会报告正确的参与者元数据。 验证错误现在会描述实际被禁止的字符。

更新内容 (原始)

Dapr 1.17.11

This update contains the following bug fix:

Actor reminders and jobs fail to register when their name or actor ID contains characters such as | or @

Problem

Registering an actor reminder through the Scheduler service failed when the reminder name, or the actor ID it belongs to, contained certain characters such as the pipe | or at sign @. The same characters are accepted when invoking actors and when saving actor state, so an actor that worked everywhere else could not have a reminder created for it.

The error returned in this case was also misleading:

a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

It claimed only lowercase names were allowed even though uppercase names are in fact accepted, and it did not describe which characters were actually rejected.

Impact

You were affected if you used Scheduler-backed actor reminders (the default since 1.15) and your reminder names, actor IDs, or scheduled job names contained characters outside the strict DNS-1123 set, for example |, @, or uppercase letters.

Root Cause

The Scheduler composes each reminder or job into a single name of the form actorreminder||<namespace>||<type>||<id>||<name> (or app||<namespace>||<appID>||<name> for jobs), using || as an internal delimiter. Each ||-delimited segment was then validated against Kubernetes’ DNS-1123 subdomain rules, which only permit lowercase alphanumeric characters, -, and .. This was far stricter than the character set Dapr already accepts at its API edge, producing the inconsistency between actor invocation and reminder registration. Because the validator lowercased each segment before checking it, uppercase names passed in practice while the surfaced error still referred to lowercase-only RFC 1123 subdomains.

Solution

The Scheduler now validates names using the same policy Dapr applies at its API edge, so anything accepted for actor invocation can also be used for a reminder or job. Reminder names, job names, and actor identifiers may now contain any character except /, \, #, ?, control characters (including the NUL byte), and the exact path sequences . and ... Uppercase letters and characters such as | and @ are allowed, and || continues to be accepted within actor IDs and names. Listing reminders for actors whose IDs contain || now also reports the correct actor metadata. Validation errors now describe the characters that are actually disallowed.

下载链接