influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

2.4: Changing bucket expiration to "never" in the UI has no effect

Open andig opened this issue 3 years ago • 8 comments

Steps to reproduce: List the minimal actions needed to reproduce the behavior.

  1. Chose bucket with expiration (say 30d) in the UI
  2. Change expiration to "never"
  3. Save

Expected behavior:

List of buckets shows expiration "never"

Actual behavior:

Bucket still shows "30d". After reloading the GUI it remains at 30d.

Environment info:

InfluxDB 2.0.9 Server: d1233b7 Frontend: 9c89e22

Details

This is the UI's XHR request:

{"id":"107d309886153948","orgID":"5d4718f7355f8f75","type":"user","name":"api","retentionRules":[],"createdAt":"2022-09-20T18:56:23.322209526Z","updatedAt":"2022-09-28T06:06:52.371527624Z","links":{"labels":"/api/v2/buckets/107d309886153948/labels","members":"/api/v2/buckets/107d309886153948/members","org":"/api/v2/orgs/5d4718f7355f8f75","owners":"/api/v2/buckets/107d309886153948/owners","self":"/api/v2/buckets/107d309886153948","write":"/api/v2/write?org=5d4718f7355f8f75&bucket=107d309886153948"},"labels":[]}

This is the server response:

{
	"id": "107d309886153948",
	"orgID": "5d4718f7355f8f75",
	"type": "user",
	"name": "api",
	"retentionRules": [
		{
			"type": "expire",
			"everySeconds": 2592000,
			"shardGroupDurationSeconds": 86400
		}
	],
	"createdAt": "2022-09-20T18:56:23.322209526Z",
	"updatedAt": "2022-09-28T06:12:37.49901153Z",
	"links": {
		"labels": "/api/v2/buckets/107d309886153948/labels",
		"members": "/api/v2/buckets/107d309886153948/members",
		"org": "/api/v2/orgs/5d4718f7355f8f75",
		"owners": "/api/v2/buckets/107d309886153948/owners",
		"self": "/api/v2/buckets/107d309886153948",
		"write": "/api/v2/write?org=5d4718f7355f8f75\u0026bucket=107d309886153948"
	},
	"labels": []
}

Seems as if the API is ignoring the empty retention rules in the PATCH?

andig avatar Sep 28 '22 06:09 andig

This is still a problem in 2.4 OSS

andig avatar Sep 28 '22 06:09 andig

Docs at https://docs.influxdata.com/influxdb/v2.4/organizations/buckets/update-bucket/ don't explain how retention period can be removed.

andig avatar Sep 28 '22 06:09 andig

Any feedback? Seems to be an obvious bug?

andig avatar Oct 05 '22 08:10 andig

Confirmed issue with the UI. Retention policies can be set to never expire by using the influx bucket update command and setting --retention 0.

jeffreyssmith2nd avatar Oct 13 '22 20:10 jeffreyssmith2nd

@jeffreyssmith2nd for sake of completeness: could you add docs how to do this via api?

andig avatar Oct 14 '22 07:10 andig

The equivalent API call is documented here: https://docs.influxdata.com/influxdb/v2.4/api/#operation/PatchBucketsID

jeffreyssmith2nd avatar Oct 20 '22 17:10 jeffreyssmith2nd

It would be nice if https://docs.influxdata.com/influxdb/v2.4/organizations/buckets/update-bucket/ could cover how to remove expiry, too.

andig avatar Oct 20 '22 17:10 andig

Year and a half later and still have the same bug?

BetaAthe avatar May 12 '24 23:05 BetaAthe