typ = type_map[typ or "keyval"];
local store_dir = format("%s/%s/%s", data_path, encode(host), store);
local mode, err = lfs.attributes(store_dir, "mode");
if not mode then
typ = type_map[typ or "keyval"];
local store_dir = format("%s/%s/%s", data_path, encode(host), store);
local mode, err = lfs.attributes(store_dir, "mode");
if not mode then