Skip to content

Commit fc2b4f6

Browse files
authored
VAULT: 36221 start time counters api bug (#637)
This PR updates the docs around the known issues with the `start_time` parameter leading to infinite loops as a bug when not provided to the Counters API. After investigation, we found this affects only Vault version 1.18.x and 1.19.x and has been fixed in 1.20.0. This PR accordingly updates docs around Counters API, release notes and upgrade docs for the affected Vault versions. Jira: https://hashicorp.atlassian.net/browse/VAULT-36221 Manual test snapshots: <img width="659" height="634" alt="Screenshot 2025-07-25 at 1 57 14 PM" src="https://github.com/user-attachments/assets/29b93419-ca2c-4763-a276-c74ed95087d0" /> <img width="837" height="599" alt="Screenshot 2025-07-25 at 2 08 48 PM" src="https://github.com/user-attachments/assets/5b7469b6-74b3-4997-b121-4e1291159e7a" /> <img width="875" height="689" alt="Screenshot 2025-07-28 at 12 31 00 PM" src="https://github.com/user-attachments/assets/5301ec54-d50b-46d7-85e4-ca3d2960b0cb" /> <img width="764" height="547" alt="Screenshot 2025-07-28 at 12 30 21 PM" src="https://github.com/user-attachments/assets/829d2ca7-611a-4ba3-b00a-259355a8365b" /> <img width="667" height="402" alt="Screenshot 2025-07-28 at 12 15 46 PM" src="https://github.com/user-attachments/assets/1c4eb18a-7e67-4412-ad65-3962a8750651" /> <img width="762" height="496" alt="Screenshot 2025-07-28 at 12 15 33 PM" src="https://github.com/user-attachments/assets/87becb9f-1f7e-49d5-97a6-8ae411dd5058" />
2 parents a345b77 + 497dee0 commit fc2b4f6

File tree

7 files changed

+69
-20
lines changed

7 files changed

+69
-20
lines changed

content/vault/v1.18.x/content/api-docs/system/internal-counters.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,17 @@ is unknown.
366366

367367
### Parameters
368368

369-
- `start_time` `(string, optional)` - An RFC3339 timestamp or Unix epoch time. Specifies the start of the
370-
period for which client counts will be reported. If no start time is specified, the billing start date will be used.
371-
The [billing start date](/vault/docs/concepts/billing-start-date) automatically rolls over to the latest billing year at the end of the last cycle.
369+
- `start_time` `(string, optional)` - An RFC3339 timestamp or Unix epoch time.
370+
Specifies the start of the period for which client counts will be reported.
371+
Vault uses the [billing start date](/vault/docs/concepts/billing-start-date)
372+
by default, which automatically rolls over to the latest billing year at the
373+
end of the last cycle. Vault Community **requires** `start_time`, but Vault
374+
Enterprise uses the billing start date as defined by the cluster license by
375+
default. Vault Community does not have a billing start time, so ommitting
376+
`start_time` can lead to undefined behavior. We recommend setting an explicit
377+
start time to ensure reliable behavior in all Vault versions.
378+
379+
372380
- `end_time` `(string, optional)` - An RFC3339 timestamp or Unix epoch time. Specifies the end of the period
373381
for which client counts will be reported. If no end time is specified, the end of the current month will be used.
374382
- `limit_namespaces` `(int, optional)` - Controls the total number of by_namespace data returned. This can

content/vault/v1.18.x/content/docs/release-notes/1.18.0.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description: |-
1616
| Change | Description |
1717
|-----------------------------|----------------------------------------------------------------------------------------------------------------------|
1818
| New default (1.18.0) | [Default activity log querying period](/vault/docs/upgrading/upgrade-to-1.18.x#default-activity-log-querying-period) |
19+
| Known issue (1.18.0-1.19.6) | [Counters API requires start_time parameter in Vault Community](/vault/docs/upgrading/upgrade-to-1.18.x#counters-api-requires-start-time-in-vault-community) |
1920
| New default (1.18.0) | [Docker image no longer contains curl](/vault/docs/upgrading/upgrade-to-1.18.x#docker-image-no-longer-contains-curl) |
2021
| Beta feature removed (1.18) | [Request limiter removed](/vault/docs/upgrading/upgrade-to-1.18.x#request-limiter-configuration-removal) |
2122
| New default (1.18.2) | [Vault product usage metrics reporting](/vault/docs/upgrading/upgrade-to-1.18.x#product-usage-reporting) |

content/vault/v1.18.x/content/docs/upgrading/upgrade-to-1.18.x.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ WARNING! The following warnings were returned from Vault:
9292

9393
</CodeBlockConfig>
9494

95+
#### Counters API requires start time in Vault Community
96+
97+
Vault Community requires the `start_time` parameter for
98+
`/sys/internal/counters/activity`. Unlike Enterprise Vault, Vault Commuity does
99+
not define a billing start time, and ommitting `start_time` may lead to
100+
unexpected behavior in affected versions (1.18.x and 1.19.x).
101+
102+
You can safely omit `start_time` for Vault Enterprise as `start_time` defaults
103+
to the billing start date for the cluster. To avoid issues and unexpected
104+
behavior, always provide an explicit start time if you use Vault Community.
105+
95106
### Docker image no longer contains `curl`
96107

97108
The `curl` binary is no longer included in the published Docker container images for Vault and Vault

content/vault/v1.19.x/content/api-docs/system/internal-counters.mdx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -376,18 +376,27 @@ is unknown.
376376

377377
### Parameters
378378

379-
- `start_time` `(string, optional)` - An RFC3339 timestamp or Unix epoch time. Specifies the start of the
380-
period for which client counts will be reported. If no start time is specified, the billing start date will be used.
381-
The [billing start date](/vault/docs/concepts/billing-start-date) automatically rolls over to the latest billing year at the end of the last cycle.
382-
- `end_time` `(string, optional)` - An RFC3339 timestamp or Unix epoch time. Specifies the end of the period
383-
for which client counts will be reported. If no end time is specified, the end of the current month will be used.
384-
- `limit_namespaces` `(int, optional)` - Controls the total number of by_namespace data returned. This can
385-
be used to return the client counts for the specified number of namespaces having highest activity.
386-
If no `limit_namespaces` parameter is specified, client counts for all namespaces in specified usage period is returned.
387-
- `current_billing_period` `(bool, optional)` - **DEPRECATED** Uses the builtin billing start
388-
timestamp as `start_time` and the current time as the `end_time`, returning a
379+
- `start_time` `(string, optional)` - An RFC3339 timestamp or Unix epoch time.
380+
Specifies the start of the period for which client counts will be reported.
381+
Vault uses the [billing start date](/vault/docs/concepts/billing-start-date)
382+
by default, which automatically rolls over to the latest billing year at the
383+
end of the last cycle. Vault Community **requires** `start_time`, but Vault
384+
Enterprise uses the billing start date as defined by the cluster license by
385+
default. Vault Community does not have a billing start time, so ommitting
386+
`start_time` can lead to undefined behavior. We recommend setting an explicit
387+
start time to ensure reliable behavior in all Vault versions.
388+
- `end_time` `(string, optional)` - An RFC3339 timestamp or Unix epoch time.
389+
Specifies the end of the period for which client counts will be reported. If
390+
no end time is specified, the end of the current month will be used.
391+
- `limit_namespaces` `(int, optional)` - Controls the total number of by_namespace
392+
data returned. This can be used to return the client counts for the specified number
393+
of namespaces having highest activity. If no `limit_namespaces` parameter is
394+
specified, client counts for all namespaces in specified usage period is returned.
395+
- `current_billing_period` `(bool, optional)` - **DEPRECATED** Uses the builtin billing
396+
start timestamp as `start_time` and the current time as the `end_time`, returning a
389397
response with the current billing period information without having to
390-
explicitly provide a start and end time. This parameter is deprecated, as this option is now the default, so no parameter is needed to specify.
398+
explicitly provide a start and end time. This parameter is deprecated, as this option
399+
is now the default, so no parameter is needed to specify.
391400

392401

393402
### Sample request

content/vault/v1.19.x/content/docs/updates/important-changes.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,3 +383,22 @@ already rotated before the restart.
383383
Upgrade to 1.18.9+ or 1.19.3+. If you cannot upgrade, the only workaround is to
384384
avoid restarting the backend.
385385

386+
### Counters API requires start time in Vault Community ((#start-time-counters-api))
387+
388+
| Change | Status | Affected version | Fixed version
389+
| ----------- | ------ | ---------------- | --------------------
390+
| Known issue | Fixed | 1.18.x, 1.19.x | 1.20.0
391+
392+
Vault Community requires the `start_time` parameter for
393+
`/sys/internal/counters/activity`. Unlike Enterprise Vault, Vault Commuity does
394+
not define a billing start time, and ommitting `start_time` may lead to
395+
unexpected behavior in affected versions (1.18.x and 1.19.x).
396+
397+
You can safely omit `start_time` for Vault Enterprise as `start_time` defaults
398+
to the billing start date for the cluster.
399+
400+
#### Workaround
401+
402+
To avoid issues and unexpected behavior with Vault Community, always provide a
403+
valid `start_time` value when calling `/sys/internal/counters/activity` or
404+
upgrade to v1.20.x.

content/vault/v1.19.x/content/partials/release-notes/change-summary/1_19.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ Found | Fixed | Workaround | Edition | Issue
4242
1.19.0 | 1.19.3 | **Yes** | All | [Login/token renewal failures after group changes](/vault/docs/v1.19.x/updates/important-changes#group-writes)
4343
1.19.0 | 1.19.3 | Upgrade | All | [Unexpected DB static role rotations on upgrade](/vault/docs/v1.19.x/updates/important-changes#db-static-role-rotations)
4444
1.19.0 | 1.19.3 | Upgrade | All | [Unexpected LDAP static role rotations on upgrade](/vault/docs/v1.19.x/updates/important-changes#ldap-static-role-rotations)
45-
1.19.0 | 1.19.3 | **Yes** | All | [Unwanted secret rotation for DB and LDAP roles on restart](/vault/docs/v1.19.x/updates/important-changes#secret-rotate-on-restart)
45+
1.19.0 | 1.19.3 | **Yes** | All | [Unwanted secret rotation for DB and LDAP roles on restart](/vault/docs/v1.19.x/updates/important-changes#secret-rotate-on-restart)
46+
1.19.0 | No | **Yes** | All | [Counters API requires start time in Vault Community](/vault/docs/v1.19.x/updates/important-changes#start-time-counters-api)

content/vault/v1.20.x/content/api-docs/system/internal-counters.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,11 @@ When `end_time` falls in the current month or a future month, Vault adjusts the
315315
end time to the last day of the previous month and includes the following
316316
warning along with the associated counts:
317317

318-
```json
319-
{
320-
"warning": "end_time parameter can only be used to specify a date until the end of previous month. The value provided for this parameter was in the current month or in the future date and was therefore ignored. The response includes data until the end of the previous month."
321-
}
322-
```
318+
```json
319+
{
320+
"warning": "end_time parameter can only be used to specify a date until the end of previous month. The value provided for this parameter was in the current month or in the future date and was therefore ignored. The response includes data until the end of the previous month."
321+
}
322+
```
323323

324324
For example, assume the current date is September 25, 2025 and you call the
325325
Get Client Count endpoint with `end_time` set to `2025-10-01`:

0 commit comments

Comments
 (0)