wrangler d1 command debugging

tried with and without a wrangler.toml
8 Replies
Hard@Work
Hard@Work•3w ago
@switz do you have any of these environment variables set, in an env file or as actual environment variables? https://developers.cloudflare.com/workers/wrangler/system-environment-variables/#supported-environment-variables
Cloudflare Docs
System environment variables
Local environment variables that can change Wrangler's behavior.
switz
switzOP•3w ago
yeah I have CLOUDFLARE_ACCOUNT_ID
Hard@Work
Hard@Work•3w ago
Can you post the ACCOUNT_ID from the variable here? It is safe to share publicly
switz
switzOP•3w ago
76935225f2967a3ddadf806d1bd9ba46 I'm stumped this is frustrating tbh
Hard@Work
Hard@Work•3w ago
The team is looking at it
switz
switzOP•3w ago
thanks any updates here? this is blocking my deployment of software running on d1 I think i found the issue its trying to use the wrong cloudflare account - i cleared the ~/.wrangler directory and its still breaking I figured it out my fish shell export CLOUDFLARE_ACCOUNT_ID was overwriting the local .env if wrangler sees two different account ids it should warn you and suggest a possible fix (check bash_profile/env vars) yeah that fixed it
afonsocrg
afonsocrg•2w ago
@switz thanks for the ping here šŸ™‚ appreciate it! I don't have the CLOUDFLARE_ACCOUNT_ID exported in the env, and I have it defined in the wrangler.toml. What is weird is that I receive an authentication error, but it says that I have superuser access:
šŸ‘‹ You are logged in with an OAuth Token, associated with the email <my email/>.

šŸ”“ Token Permissions:
- ... # (other permissions)
- d1 (write)

šŸŽ¢ Membership roles in "<email/>'s Account": Contact account super admin to change your permissions.
- Super Administrator - All Privileges
šŸ‘‹ You are logged in with an OAuth Token, associated with the email <my email/>.

šŸ”“ Token Permissions:
- ... # (other permissions)
- d1 (write)

šŸŽ¢ Membership roles in "<email/>'s Account": Contact account super admin to change your permissions.
- Super Administrator - All Privileges
Dan šŸ‘
Dan šŸ‘ā€¢2w ago
same issue and setup here - wrangler d1 execute is working but not list

Did you find this page helpful?