#4155 new defect

parse_duration() doesn't understand seconds

Reported by: meejah Owned by:
Priority: normal Milestone: undecided
Component: unknown Version: n/a
Keywords: Cc:
Launchpad Bug:

Description

User https://github.com/sgerodes on GitHub? reports:

configuring seconds in override_lease_duration previously resulted in errors due to missing elif statement in the parse_duration function

This configuration

[storage]
expire.enabled = True
expire.mode = age
expire.override_lease_duration = 100000s

Results in this error

Unknown error, here's the traceback:
2025-01-08T15:45:43.031716337Z Traceback (most recent call last):
2025-01-08T15:45:43.031717379Z   File "/usr/local/lib/python3.10/dist-packages/twisted/internet/defer.py", line 2017, in _inlineCallbacks
2025-01-08T15:45:43.031938379Z     result = context.run(gen.send, result)
2025-01-08T15:45:43.031945545Z   File "/usr/local/lib/python3.10/dist-packages/allmydata/client.py", line 306, in create_client_from_config
2025-01-08T15:45:43.032061629Z     client.init_storage(storage_plugins.announceable_storage_servers)
2025-01-08T15:45:43.032064420Z   File "/usr/local/lib/python3.10/dist-packages/allmydata/client.py", line 843, in init_storage
2025-01-08T15:45:43.032065504Z     ss = self.get_anonymous_storage_server()
2025-01-08T15:45:43.032066462Z   File "/usr/local/lib/python3.10/dist-packages/allmydata/client.py", line 806, in get_anonymous_storage_server
2025-01-08T15:45:43.032067462Z     o_l_d = parse_duration(o_l_d)
2025-01-08T15:45:43.032068212Z   File "/usr/local/lib/python3.10/dist-packages/allmydata/util/time_format.py", line 74, in parse_duration
2025-01-08T15:45:43.032069170Z     raise ValueError("no unit (like day, month, or year) in '%s'" % orig)
2025-01-08T15:45:43.032070045Z builtins.ValueError: no unit (like day, month, or year) in '100000s'

Change History (0)

Note: See TracTickets for help on using tickets.