Cannot get wrangler preview to work with free account

I have a free account and want to experiment with workers by following the following tutorial:

I don’t have a domain or zone. I just use following steps:

  • wrangler generate test-app
  • I add account ID in wrangler.toml
  • I use wrangler login to authorize. I get confirmation that it succeeded (’ Successfully configured.’)
    However, if I now do ‘wrangler preview’, I get following error message:
    Error: Something went wrong! Status: 400 Bad Request, Details {"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}

I use git bash inside WebStorm on Windows.

Does anybody have an idea what could be the problem?

I’m a bit concerned about using this technology if we’re not even able to get the tutorial running by following it step by step…

Which version are you using? Can you run wrangler -V, what is the output of it?

Have you checked your account ID inside the file of your project?

Cloudflare’s API actually supports two types of authentication: one using email + global api key, and another one using an api token.

Maybe you are actually trying to use an api token in place of the global api key?

In case to re-check, you can find your global API key on this page under the “API tokens” section.

I’m using wrangler 1.15.0. The wrangle.toml file contains the correct account ID. I’ve left the other parameters at their default value.

I’ve tried both authentication methods: the one with ‘wrangler login’ where I have to press ‘Authorize’ on a web page and the one with ‘wrangler config --api-key’ where I have to enter email address and global key.

In both cases, the authorization itself succeeds, but everything else I try afterwards fails (even wrangler whoami).

I don’t understand how wrangler can say it validated the credentials, only to fail completely in any other command.

This topic was automatically closed after 31 days. New replies are no longer allowed.