Skip to content

[Bug]: Bug: acme_account_orders_index.nvalue set to NULL when order reaches ready state, breaking ACME operations(unable to fetch order list, or creating a new order) #2425

@UsmanHaider546

Description

@UsmanHaider546

Steps to Reproduce

Bug: step-ca corrupts acme_account_orders_index nvalue to NULL when order reaches ready state

Description

When I create an order in step-ca ACME, it gives an order number and challenge links with codes to pass the challenge. When I pass the challenges, the order becomes valid. After the order reaches the ready state (but not finalized at this time), step-ca corrupts the order table by setting nvalue to null. Once the value becomes null, I cannot create new orders or get details about existing orders.

The corrupted database table is: acme_account_orders_index

Environment

  • step-ca version: 0.28.4 (also tested Docker latest)
  • Tested on:
    • Docker with default Badger DB
    • Docker with MySQL container
    • Windows with default Badger DB
    • Windows with MySQL

All configurations show the same issue.

Problem

The acme_account_orders_index table's nvalue column is corrupted to NULL when the order transitions to ready state. After it converts to null, I cannot retrieve any order details or create new orders.

Error Log

time="2025-10-11T01:26:02+05:00" level=error duration=1.9211747s duration-ns=1921174700 
error="error creating order: error loading orderIDs for account PoeTs5uSGvJmyHp9rcjLMb8jmWdmqu9m: failed to get acme_account_orders_index/PoeTs5uSGvJmyHp9rcjLMb8jmWdmqu9m: sql: Scan error on column index 0, name \"nvalue\": converting NULL to string is unsupported" 
fields.time="2025-10-11T01:26:00+05:00" 
method=POST 
name=ca 
nonce=WHdvNGptWUI2Y2JuYll0dWx1WjIzM0V1dXozdU5QTmY 
path=/acme/acme/new-order 
protocol=HTTP/1.1 
referer= 
remote-address="::1" 
request-id=9eb9be38-b236-425b-8776-d4eec2edb17e 
response="{\"type\":\"urn:ietf:params:acme:error:serverInternal\",\"detail\":\"The server experienced an internal error\"}" 
size=105 
status=500 
user-agent=node-fetch 
user-id=

Request

Please help find a solution to this issue. If a solution is not available, please acknowledge this bug and provide guidance or a fix in an upcoming release.

Thank you!

Your Environment

  • OS -
  • step-ca Version -

Expected Behavior

i want to fetch all orders when i make acme post request on /accountnumber/orders even if orders are ready and valid state. and i can make a new orders. at this time. when one order become in ready state, it converts nvalue to null and i cannot make new orders

Actual Behavior

mentioned about

Additional Context

mentioned

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageWaiting for discussion / prioritization by team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions