Problems with authentication with cloudflare #76
-
I can't seem to authenticate against Cloudflare, and I'm getting interesting routing errors using e.g. d1 list: denoflare d1 list --account-id (cfg store cloudflare/account_id) --api-token (cfg store cloudflare/token)
error: Uncaught (in promise) Error: listD1Databases failed: status=404, errors=7003 Could not route to /client/v4/accounts/Unknown%20subcommand/d1/database, perhaps your object identifier is invalid?
at execute (https://raw.githubusercontent.com/skymethod/denoflare/master/common/cloudflare_api.ts:1888:15)
at eventLoopTick (ext:core/01_core.js:168:7)
at async listD1Databases (https://raw.githubusercontent.com/skymethod/denoflare/master/common/cloudflare_api.ts:1327:13)
at async Object.list [as handler] (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_d1.ts:98:17)
at async CliCommand.routeSubcommand (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_command.ts:104:13)
at async Object.d1 [as handler] (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_d1.ts:86:5)
at async CliCommand.routeSubcommand (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_command.ts:104:13)
at async https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli.ts:41:5 also in the r2 api: denoflare r2 list-buckets --account-id (cfg store cloudflare/account_id) --api-token (cfg store cloudflare/token)
error: Uncaught (in promise) Error: verifyToken failed: status=400, errors=6003 Invalid request headers
at execute (https://raw.githubusercontent.com/skymethod/denoflare/master/common/cloudflare_api.ts:1888:15)
at eventLoopTick (ext:core/01_core.js:168:7)
at async verifyToken (https://raw.githubusercontent.com/skymethod/denoflare/master/common/cloudflare_api.ts:957:13)
at async loadR2Options (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_r2.ts:88:25)
at async Object.listBuckets [as handler] (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_r2_list_buckets.ts:19:41)
at async CliCommand.routeSubcommand (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_command.ts:104:13)
at async Object.r2 [as handler] (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_r2.ts:70:5)
at async CliCommand.routeSubcommand (https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli_command.ts:104:13)
at async https://raw.githubusercontent.com/skymethod/denoflare/master/cli/cli.ts:41:5 I've tried with several scoped tokens and the global api token. |
Beta Was this translation helpful? Give feedback.
Answered by
johnspurlock-skymethod
Aug 10, 2024
Replies: 1 comment 4 replies
-
that looks like maybe your try with a static value or env var to narrow it down can also add |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmm, I'm using the same denoflare version as you (master) and I'm able to list just fine using your exact command line (
--account-id
and--api-token
)Since you seen to be getting the general "no access" cf error message, double-check your Cloudflare api token has access to D1
Here's mine for example: