-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Issue Description
Connecting to a remote Deno Kv database deployed on Deno Deploy Classic works fine,
But connecting to one deployed on Deno Deploy EA doesn't!,
Instead, it responds with "The authorization token is not valid" error (though I just created the access token, copied and set it correctly)
Am i missing something 🤔?
The versions I used:
- Deno v2.5.1
@deno/[email protected]package
Reproduce the error
You need to provision a Deno Kv database in Deno Deploy EA and bring a personal access token
In Deno runtime
Deno.env.set("DENO_KV_ACCESS_TOKEN", "ddp_...")
const kv = await Deno.openKv("https://api.deno.com/databases/<DB_ID>/connect")
console.log(await kv.get(["any-random-key"]))In Node runtime + @deno/kv package
import { openKv } from "@deno/kv";
Deno.env.set("DENO_KV_ACCESS_TOKEN", "ddp_...")
const kv = await openKv("https://api.deno.com/databases/<DB_ID>/connect")
console.log(await kv.get(["any-random-key"]))Run
deno run -A --unstable-kv test.tsYou should now see something like this:
error: Uncaught (in promise) Error: Failed to fetch metadata: {
"code": "invalidToken",
"message": "The authorization token is not valid: The bearer token is invalid."
}
console.log(await kv.get(["any-random-key"]))
The error seems coming from kv.get method
Metadata
Metadata
Assignees
Labels
No labels