Variable not found in lock-renew

Hello,
I’m developing a Bash script running inside Nomad’s task that works with the var locks API. I work with curl, connecting to the UNIX socket on the nodes.

  curl -XPUT -d@- --fail -v -H "Authorization: Bearer $nomad_lock_token" \
       --unix-socket "$NOMAD_SECRETS_DIR/api.sock" \
       "$VLOCK_NOMAD_ADDR/v1/var/$var_path?$2" <<-EOF
{
  "Path": "$var_path",
  "Namespace": "$namespace",
  "Lock": {
    "ID": "$var_lock_id"
  }
}
EOF

Where $2 become “lock-release” or “lock-renew”.

I was able to implement lock-acquire and lock-release, but when I try to call lock-renew, I get an error code 404. Log message states
[ERROR] client.rpc: error performing RPC to server: error="RPC Error:: 404,variable doesn't exist" rpc=Variables.RenewLock

To call the lock-renew, I’m using the same code that I’ve written for lock-release. Just changing the parameter “lock-release” into “lock-renew”. With release it works fine, with renew no.

Does someone have an idea?

I’m using Nomad 1.7.5, but I got the the same behavior with 1.7.3.
Thank you.
Kind Regards.
Ivano.

Hello.
I found the solution by myself. I was accessing variables belonging to a specific namespace.
The lock release call worked even the namespace parameter was not specified.
The lock renew, instead, no: it required to specify the namespace of the variable.

This was not clear reading the documentation. But at the end, I solved specifying always the namespace in both calls.

Kind Regards.