Skip to content

account.key and certificate files deleted from state_path with error #39

@dcava

Description

@dcava

Bug Overview

account.key and certificate files are deleted from state_path a few minutes after nginx restart.

Expected Behavior

account.key and certificate files persist as state_path is correctly specified.

Steps to Reproduce the Bug

I've defined this block in nginx.conf:

    ##
    # ACME settings
    ##
   resolver 127.0.0.53;

   acme_issuer letsencrypt {
        uri         https://acme-v02.api.letsencrypt.org/directory;
        contact     postmaster@example.com;
        state_path  /var/cache/nginx/acme-letsencrypt;
        accept_terms_of_service;
    }

On restart, an account.key is created in state_path and certificates subsequently created and work normally. No errors on start.
After about 2-3 minutes the files are removed from state_path and the following error appears in the log:

2025/08/22 09:41:58 [crit] 4126722#4126722: cache file "/var/cache/nginx/acme-letsencrypt/example.com-9a49b2628af2593f.key" is too small
2025/08/22 09:41:58 [crit] 4126722#4126722: cache file "/var/cache/nginx/acme-letsencrypt/account.key" is too small

The site continues to work presumably due to the certificate in shared memory, but restarting nginx requests a new cert (which is going to hit rate limits quickly see #32).

I'm guessing the files are meant to remain in state_path?

Environment Details

Ubuntu noble
Nginx mainline/nginx-acme 1.29.1+0.1.1-1~noble (via apt)

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions