nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
993 stars 57 forks source link

Error while adding CF Token #329

Closed rktmatt closed 1 month ago

rktmatt commented 1 month ago

Describe the bug When trying to add a CF token to a new team or my home team I have the following error :

Couldn't list Cloudflare accounts

Please check your API Token, make sure to have "Account Settings: Read" permission.

I do have those settings enabled for that token.

However, I have done several things that might be related : I previously added a token for another Cloudflare account successfully. It's only when trying to enable another Cloudflare account that I have this message.

atinux commented 1 month ago

Do you have enough access in this new Cloudflare account? Like admin permission?

rktmatt commented 1 month ago

Thank you so much for answering so quickly!

I do have admin permissions and used screensharing with the owner today to set up the tokens as I can't seem to create token as an admin of the domain.

I wanted to add more context :

I created initially my account with nuxthub for project A for CF account owner A. I did successfully deploy that project and I don't think (or remember) if back then we had Cloudflare Tokens set the same way. I think I remember that I had created tokens with my Cloudflare admin account and not with the owners.

Then I wanted to deploy project B for CF account owner B. I added the project to my nuxthub account and then went to CF with my admin rights to create a token, which did result in an error with CF dashboard. So I used owner B account to create the token. It worked as expected and the project B got deployed.

Few days later, I pushed some code to project A, which failed sync. In NuxtHub the CF account of project A was still there but with no deployment.

It is with this account that I try to now add a token and fail.

Can I have multiple CF accounts on 1 team ? Will adding one remove the other ? Do I need to create different teams for different CF accounts ? Or can I only have 1 CF account for a Hub account ?

I tried to add another team and paste the token over there and it also failed.

atinux commented 1 month ago

On NuxtHub, one team = one CF account, as soon as you link another CF account it erases the previous one linked in the NuxtHub team.

You should have two teams on NuxtHub. For the CF account A, could you try to create a new token by clicking the button when linking so I create with all the required permissions?

I am sorry about the confusion and will try to make it clear in the app.

rktmatt commented 1 month ago

I tried do again the token but with my CF account and including the owner A domain and it worked this time.

Issue was a misunderstanding on my part. Thank you !