Etcd: Error: etcdserver: requested lease not found

Created on 16 May 2018  路  8Comments  路  Source: etcd-io/etcd

[root@iz2zeaf3cg1099kiidi06mz etcd]# export ETCDCTL_API=3
[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl put test hello
OK
[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl lease grant 10
lease 694d6368b4edc60e granted with TTL(10s)
[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl put --lease=694d6368b4edc60e test2 world
Error: etcdserver: requested lease not found
[root@iz2zeaf3cg1099kiidi06mz etcd]#

how to deal with it?

aredoc arequestion

All 8 comments

@pjmike try

etcdctl put --lease 694d6368b4edc60e test2 world

etcdctl lease list
found 1 leases
694d6368b4edc60e

it is interesting though as we do document your usage Grant Lease

@hexfusion

[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl put test hello
OK
[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl lease grant 10
lease 694d6368b4edc626 granted with TTL(10s)
[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl lease list
found 1 leases
694d6368b4edc626
[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl put --lease 694d6368b4edc626 test2 world
Error: etcdserver: requested lease not found
[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl lease list
found 0 leases

the lease soon disappeared.

[root@iz2zeaf3cg1099kiidi06mz etcd]# etcdctl lease list
found 0 leases

the lease soon disappeared.

@pjmike yes but this is because your TTL "time to live" is only 10 seconds right so to me this is expected.

Try this etcdctl lease grant 240

@hexfusion yes ,it did.Thank you.

@pjmike you are welcome remember TTL begins count as soon as it is granted.

etcdctl lease timetolive 694d6368dd6da003
lease 694d6368dd6da003 granted with TTL(240s), remaining(219s)

I will fix up the documentation unless you would like to issue PR @pjmike ?

No,I wouldn't like to issure PR.I just hope the documenation can be fixed up.Thank you once again. @hexfusion

Was this page helpful?
0 / 5 - 0 ratings