Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth error using Vercel Remote Cache #7359

Open
gsoltis opened this issue Feb 12, 2024 · 7 comments
Open

Auth error using Vercel Remote Cache #7359

gsoltis opened this issue Feb 12, 2024 · 7 comments

Comments

@gsoltis
Copy link
Contributor

gsoltis commented Feb 12, 2024

          We are running into the same issue, on version `1.12.3` but using Vercel for our remote cache.
...Finishing writing to cache... 
WARNING  failed to contact remote cache: unknown status forbidden: You don't have permission to create the cache artifact.

We've configured Vercel with turbo login and turbo link steps, and can see the expected teamId in .turbo/config.json

What steps can we follow to debug this?

Originally posted by @dhoulker in #6765 (comment)

@gsoltis
Copy link
Contributor Author

gsoltis commented Feb 12, 2024

@dhoulker Can you confirm the steps to repro using a new repository (npx -y create-turbo@latest my-monorepo) ? Specifics on which commands run, such as turbo login and turbo link, and whether or not your team uses SSO?

Can you also describe how you're providing the auth token?

  • config file (this is the default after turbo login)
  • env var
  • cli flag (--token)

@dhoulker
Copy link

Hi @gsoltis, many thanks for coming back to me so quickly.

I've followed the steps above, combined with the steps in the docs.

So, in full i've done:

  • npx -y create-turbo@latest my-monorepo (selecting pnpm workspaces)
  • turbo login - which says >>> Success! Turborepo CLI authorized for dave@...
  • turbo link - which says >>> Success! Turborepo CLI authorized for ...

I then run turbo lint

Which gives this output

• Packages in scope: @repo/eslint-config, @repo/typescript-config, @repo/ui, docs, web
• Running lint in 5 packages
• Remote caching enabled
@repo/ui:lint: cache miss, executing 18d9240d87ecf4d3
@repo/ui:lint:
@repo/ui:lint:
@repo/ui:lint: > @repo/ui@0.0.0 lint /Users/test/Code/my-monorepo/packages/ui
@repo/ui:lint: > eslint . --max-warnings 0
@repo/ui:lint:
web:lint: cache miss, executing ce9c87752d1d3914
web:lint:
 WARNING  failed to contact remote cache: unknown status forbidden: You don't have permission to create the cache artifact.
docs:lint: cache miss, executing a49fc7ce11f62f49
docs:lint:
web:lint:
web:lint: > web@1.0.0 lint /Users/test/Code/my-monorepo/apps/web
web:lint: > eslint . --max-warnings 0
web:lint:
docs:lint:
docs:lint: > docs@1.0.0 lint /Users/test/Code/my-monorepo/apps/docs
docs:lint: > eslint . --max-warnings 0
docs:lint:

 Tasks:    3 successful, 3 total
Cached:    0 cached, 3 total
  Time:    4.478s

>   ...Finishing writing to cache...                                                                                                                                                                                                                          WARNING  failed to contact remote cache: unknown status forbidden: You don't have permission to create the cache artifact.
    ...Finishing writing to cache...                                                                                                                                                                                                                          WARNING  failed to contact remote cache: unknown status forbidden: You don't have permission to create the cache artifact.

We the default config file after turbo login and we don't have SSO set up on our team.

I'm sure this will be a case of me missing something obvious, if i can provide any more info to help figure out what then let me know!

@Zertsov
Copy link
Contributor

Zertsov commented Feb 13, 2024

@dhoulker Interesting. I just tried to repro with the my-monorepo example and wasn't able to get this to happen.

mitch in ~/oncall
→ cd my-monorepo

mitch in ~/oncall/my-monorepo branch: main [  ]
→ turbo link
>>> Remote Caching

      Remote Caching shares your cached Turborepo task outputs and logs across
  all your team’s Vercel projects. It also can share outputs
  with other services that enable Remote Caching, like CI/CD systems.
  This results in faster build times and deployments for your team.
      For more info, see https://turbo.build/repo/docs/core-concepts/remote-caching

? Would you like to enable Remote Caching for ~/oncall/my-monorepo yes
✔ Which Vercel scope (and Remote Cache) do you want associated with this Turborepo?
  [Use arrows to move, type to filter] · Voz

    >>> Success!  Turborepo CLI authorized for Voz

    To disable Remote Caching, run `npx turbo unlink`


mitch in ~/oncall/my-monorepo branch: main [  ]
→ turbo lint
• Packages in scope: @repo/eslint-config, @repo/typescript-config, @repo/ui, docs, web
• Running lint in 5 packages
• Remote caching enabled
@repo/ui:lint: cache miss, executing 18d9240d87ecf4d3
@repo/ui:lint:
@repo/ui:lint:
@repo/ui:lint: > @repo/ui@0.0.0 lint /Users/mitch/oncall/my-monorepo/packages/ui
@repo/ui:lint: > eslint . --max-warnings 0
@repo/ui:lint:
web:lint: cache miss, executing ce9c87752d1d3914
web:lint:
docs:lint: cache miss, executing a49fc7ce11f62f49
docs:lint:
web:lint:
web:lint: > web@1.0.0 lint /Users/mitch/oncall/my-monorepo/apps/web
web:lint: > eslint . --max-warnings 0
web:lint:
docs:lint:
docs:lint: > docs@1.0.0 lint /Users/mitch/oncall/my-monorepo/apps/docs
docs:lint: > eslint . --max-warnings 0
docs:lint:

 Tasks:    3 successful, 3 total
Cached:    0 cached, 3 total
  Time:    3.782s


mitch in ~/oncall/my-monorepo branch: main [  ]
→ turbo --version
1.12.3

When you link, it asks for the scope to associate with. Are you sure that the scope you selected has permission to write?

@dhoulker
Copy link

@Zertsov thanks for coming back to me. When i select scope, i chose the account that i am part of, and get a success message.

In that Vercel account i don't have access to manage permissions, but i can see in a different Vercel account when i look at permissions there doesn't seem to be any granular permissions, its just member / billing / owner.

I can see remote caching is enabled in the Vercel account.

Is there something else i need to check?

@dhoulker
Copy link

@Zertsov - an update from us on this one, a colleague on my team followed the exact steps above and it all works fine.

So it's a my machine problem! I don't see anything weird with -vvv (not that i know what i'm looking for!)

I am part of mutliple Vercel teams, could that be connected?

@Zertsov
Copy link
Contributor

Zertsov commented Mar 7, 2024

Really sorry, this got lost in my notifications!

Is this still an issue?

@dhoulker
Copy link

No problem - i've been on leave so just got to this!

Unfortunately this is still happening for me, but not for anyone else on my team.

So its definitely a my laptop problem, but i'm not sure how to debug it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants