跳转至主要内容

Starknet Error Code Reference

更新于
2026年4月15日
Quicknode 为您的 RPC 端点提供错误日志。您可直接在仪表盘中查看详细的错误信息,从而轻松识别并解决问题。

HTTP 错误代码

下面我们来看看您可能会遇到的常见HTTP错误、它们的含义以及如何预防这些错误。

400请求错误

HTTP 请求类型不正确(例如,使用 GET 而不是 POST)或包含无效字符

401未授权

当一项或多项安全要求未得到满足时,可能会发生这种情况,例如令牌认证错误、IP 地址不在白名单中、JWT 无效等。

403访问被禁止

终端已停用(原因之一可能是逾期未付款)

403访问被禁止 - 未找到自定义跟踪

自定义跟踪代码未被列入白名单(请提交工单以完成审批流程)

404未找到

URL 错误或方法错误

413内容过大

请求正文过大

413请求实体过大

eth_getLogs 和 eth_newFilter 仅支持 10,000 个区块的范围。在请求日志和事件时,我们强制执行 10,000 个区块范围的限制。

429请求过多

您的每秒请求数(RPS)超出了套餐允许的范围。请查阅我们的支持文档,了解有关 429 错误的更多信息。

500服务器内部错误

请提交工单,以便支持团队尽快检查这些错误

503服务不可用

请提交工单,以便支持团队尽快检查这些错误

HTTP 错误代码示例

下面的代码片段是一个错误代码429 的示例。

{
"jsonrpc": "2.0",
"error": {
"code": 429,
"message": "The requests per second (RPS) of your requests are higher than your plan allows."
},
"id": 1
}

Starknet RPC Error Codes

When working with Starknet, understanding its API error codes is essential for effective troubleshooting and smooth application operation.

1Failed to receive transaction

Sequencer rejected the transaction during validation. Verify transaction format and required fields

10No trace available

Trace data not available for the transaction. Verify the transaction hash is correct and exists on the network

20Contract not found

The specified contract address does not exist on the network

21Invalid message selector

Function selector does not exist in the contract ABI

22Invalid call data

Calldata is malformed or contains invalid parameters. Verify parameter types and encoding

24Block not found

The requested block does not exist. Check block number/hash or wait for sync

26Invalid block hash

Block hash format is invalid. Ensure it's a valid hexadecimal string with correct length

27Invalid transaction index

Transaction index is out of range for this block

28Class hash not found

The specified class hash has not been declared on the network

29Transaction hash not found

No transaction found with the provided hash

31Page size too big

Page size exceeds the maximum allowed limit.

32No blocks

No blocks available in the specified range

33Invalid continuation token

The continuation token is invalid or has expired

34Too many keys in filter

Filter contains more keys than the maximum allowed

40Contract error

An error occurred during contract execution

41Transaction execution error

Transaction failed to execute. Check contract logic and resource limits

51Class already declared

Class already exists on the network. Duplicate declarations are not allowed

52Invalid transaction nonce

Invalid nonce for the account. Use the correct sequential nonce value

53Insufficient max fee

Max fee too low. Increase the fee to cover transaction costs

54Insufficient account balance

Account balance too low. Ensure sufficient funds to cover the transaction fee

55Validation failure

Account validation failed. Check your signature and account contract logic

56Compilation failed

Contract compilation failed. Fix Cairo code syntax and compilation errors

57Contract class size is too large

Contract class too large. Reduce the contract size to fit within network limits

58Non account

Sender is not an account contract. Only account contracts can send transactions

59Duplicate transaction

Transaction already exists in mempool. Avoid submitting duplicate transactions

60Compiled class hash mismatch

The compiled class hash does not match the declared hash

61Unsupported transaction version

Transaction version not supported. Use a compatible transaction version

62Unsupported contract class version

Contract class version not supported. Use a compatible Cairo compiler version

63Unexpected error

Unexpected server error occurred. Submit a ticket if the issue persists

Starknet RPC Error Code Example

The code snippet below is an example of Error Code 20.

{
"error": {
"code": 20,
"message": "Contract not found"
},
"id": 1,
"jsonrpc": "2.0"
}

端点日志

Quicknode 会为您的 RPC 端点提供日志,以帮助您排查问题。您可以在Quicknode 控制台中直接查看日志,方法是导航至:


  1. 侧边栏中的端点
  2. 选择您的终端
  3. 打开“日志”选项卡

您可以按时间范围、响应类型、方法和网络对日志进行筛选。

记录的内容

端点请求
发送到您端点的请求,包括 HTTP 状态、请求方法、RPC 方法或路径以及时间戳。

错误详细信息
如有提供,失败的请求将包含错误详细信息,例如 RPC 错误代码、请求和响应正文,以及相关文档的链接。

日志记录限制

日志的可用性可能因方法、响应类型、网络和套餐而异。为保持端点性能最佳,日志记录采用“尽力而为”的原则。在流量高峰期间,为保持低延迟,部分日志可能会被丢弃。

保留与访问

“构建”和“扩展”套餐包含仪表盘访问权限,并提供标准日志保留服务。 “企业”套餐则提供更长的日志保留期限,以及用于检索日志的程序化 API 访问权限。

如果您遇到其他错误代码,请通过提交工单告知我们。我们非常乐意为您提供帮助。

分享此文档