Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Theme serve command returns scope error #1309

Closed
andershagbard opened this issue Jun 30, 2021 · 52 comments
Closed

Theme serve command returns scope error #1309

andershagbard opened this issue Jun 30, 2021 · 52 comments

Comments

@andershagbard
Copy link

Whenever I run shopify theme serve, it returns this error:

✗ You are not authorized to edit themes on XXX.myshopify.com.
Make sure you are a user of that store, and allowed to edit themes.

shopify whoami returns the following:

Logged into store XXX.myshopify.com in partner organization XXX Org

I can login to this store and edit themes the "normal" way.

Specifications

  • Shopify CLI version: 2.0.1
@artyrcheek
Copy link

Im having the same issue 🙁

@richardgraft
Copy link

It appears to be when you create a new development theme via a partner account.

@blanklob
Copy link
Contributor

I got the same issue when you create new development store, however it works fine with old developments stores that don't support OS2 features yet.

@spinsch
Copy link

spinsch commented Jun 30, 2021

it's the same for me.

somehow the partner account is not correctly linked to a new dev store. i see all stores in my account except the created dev stores after the unite event.

@macournoyer
Copy link
Contributor

Hey everyone! Can you confirm you're all using a development store created from the Partner dashboard?

@iliquifysnacks
Copy link

Same issue for me, also with a development store created from the Partner dashboard.

@iliquifysnacks
Copy link

I think I know what's happening: Working with dawn you need to be logged in with a staff account, not your partner account. Logging out and then logging in with a staff account with full permissions fixes this specific error.

@richardgraft
Copy link

@iliquifysnacks I stumbled across that myself by creating a staff account using a different email address. It works fine but the problem i have now is that because im using a different email address to my Github account, i cant connect the theme to Github. so it still feels like its a bug to me?

@macournoyer
Copy link
Contributor

macournoyer commented Jun 30, 2021

Two possible workarounds: You need to have a staff account on the dev shop or, if you’re logging in as the owner, you need to log in directly to the dev shop first through https://SHOP_DOMAIN.com/admin (this will create the missing links in the backend).

We're updating the docs w/ this info, and looking at solutions 🙌

@iliquifysnacks
Copy link

I second that this is a bug. But probably not with the CLI but the dawn theme? I have not yet tried to connect the theme to my Github Account. But for development it is probably not going to be a problem that someone makes edits in the theme editor online that are not synced to git.

@tommypepsi
Copy link

You need to have a staff account on the dev shop or, if you’re logging in as the owner, you need to log in directly to the dev shop first through https://SHOP_DOMAIN.com/admin (this will create the missing links in the backend).

Is it planned to have it work with only partner account? Creating a staff account is definitely not a possibility for all of our clients so I won't be able to use the shopify CLI for themes until it works with partner account (or maybe an integration with private apps like themekit?)

@macournoyer
Copy link
Contributor

Is it planned to have it work with only partner account? Creating a staff account is definitely not a possibility for all of our clients so I won't be able to use the shopify CLI for themes until it works with partner account (or maybe an integration with private apps like themekit?)

It should work already for collaborator accounts, if that's what you mean. The only issue should be w/ owners of development stores. Let me know if there's something else that doesn't work for you.

@tommypepsi
Copy link

oh ok good to know, I tested it out on a new dev store to test the OS 2.0 so that's probably why! I'll have to test it out on a real store.

@richardgraft
Copy link

Two possible workarounds: You need to have a staff account on the dev shop or, if you’re logging in as the owner, you need to log in directly to the dev shop first through https://SHOP_DOMAIN.com/admin (this will create the missing links in the backend).

We're updating the docs w/ this info, and looking at solutions 🙌

Thanks for this. I did try the following:-

  • created a new development account via my partner dashboard
  • Logged out, then typed in the account url with /admin at the end in the browser
  • Logged back in
  • ended up with the same issue.

So for me, currently i have to create myself a staff account by using a different email address, it seems to be the only way. This then prevents me trying out the Github connect feature since my github account uses my other email address.

Thanks

@ekwoka
Copy link

ekwoka commented Jul 1, 2021

I'm having a similar issue where I login but it says I don't have an organization account even though its the login I use to access our organizations partner account to enter the store.

@seeReadCode
Copy link

seeReadCode commented Jul 1, 2021

I am using a partner dev store created after Unite and it has OS 2.0 enabled. When I use shopify cli either as the dev store owner OR as a staff member with full account creds, I'm still getting auth errors. So I for one still don't have a flow for developing with Dawn / OS 2.0.

@JayceDugan
Copy link

JayceDugan commented Jul 2, 2021

Two possible workarounds: You need to have a staff account on the dev shop or, if you’re logging in as the owner, you need to log in directly to the dev shop first through https://SHOP_DOMAIN.com/admin (this will create the missing links in the backend).

We're updating the docs w/ this info, and looking at solutions 🙌

Can confirm logging in directly to the dev shop first this resolved using shopify theme serve via expected issues with partner accounts and a new development store.

@seeReadCode
Copy link

Ok, here's the work around that worked for me.

  1. Create partner dev store.
  2. Log out of shopify accounts.
  3. Login to partner dev store at /admin as owner using store specific password and link accounts
  4. Login via shopify cli

@bekahmcdonald
Copy link

Thanks @seeReadCode! That was the only thing that worked for me.

@Nicolasramos411
Copy link

Step by step how you can solve it:

  1. Logout in the partner account that create the store (the store owner)
  2. Create a new partner account (for the process to be well understood, we will call it "account 2")
  3. Log in with the new account (account 2) in the browser.
  4. Go to "Store" and select "Add store". Select the option "managed store", insert the URL of the store you want to develop, and all the permissions.
  5. Logout with the account 2.
  6. Log in with the first account (the store owner) and go to store you want to develop.
  7. Inside the store you will see a pop-up to give colaborator access to the account 2. Give the access.
  8. Go to your terminal and use "shopify logout" if you are connected before. Finally use "shopify login --store = STORE" (where "STORE" is the URL of your store) and log in with the account 2.

NOW you can use "shopify theme serve" without problems!.


Paso a paso como resolver el problema:

  1. Cierra sesión en la cuenta partner con la que creaste la tienda (el dueño de la tienda)
  2. Crea una nueva cuenta partner (Para que el proceso sea entendible, lo llamaré "cuenta 2")
  3. Inicia sesión con la nueva cuenta (cuenta 2) en el navegador.
  4. Anda a la sección "Tiendas" y selecciona "Agregar tienda". Selecciona la opción "Tienda gestionada", ingresa el URL de la tienda que quieres desarrollar y todos los permisos.
  5. Cierra sesión con la cuenta 2.
    5)Anda a tu terminal y usa "shopify logout" si estabas conectado desde antes. Finalmente usa "shopify login --store = STORE" (donde "STORE es la URL de tu tienda) y inicia sesión con la cuenta 2.

AHORA puedes usar "shopify theme serve" sin problemas!

@kgeiger310
Copy link

kgeiger310 commented Jul 6, 2021

Similar to @Nicolasramos411, I used a shopify staff account to overcome the permission error on my new DEV store using DAWN.

Exact Steps:

PERMISSION ERROR WORKAROUND

  1. Opened DEV store (using Dawn theme) from Partner dashboard
  2. Navigated to Settings > Users and Permissions
  3. Added a staff account with full permission using different but accessible email address
  4. Authenticated with new staff account from email invite
  5. Logged out of Partner account & DEV store
  6. Logged out of Shopify CLI using > shopify logout
  7. Logged into DEV store in browser with new staff credentials
  8. Logged into Shopify CLI using > shopify login --store xyz.myshopify.com
  9. Page opened in browser indicating authentication was successful, closed page
  10. Populated products > shopify populate products
    YAY no error.

@Kcharle
Copy link

Kcharle commented Jul 6, 2021

  1. Created a brand new "Staff" level user with every permission checked off
  2. Authorized that user via email invite.
  3. Logged out of partner portal, and shop (I think?)
  4. Cleared all browser caches possible
  5. Ran shopify logout
  6. Logged in as new Staff user
  7. Still getting the "✗ You are not authorized to edit themes on ____ Make sure you are a user of that store, and allowed to edit themes." error.
  8. Tried logging in as store owner, same error.
  9. Tried multiple different browsers, same error.
  10. Tried creating a brand new store altogether then logging in with Shopify-CLI, same error.
  11. Tried an entirely different laptop, same error.

I did notice I cannot log in as the owner, or as the new staff user when I hit ____.myshopify.com/admin, it simply gives me "It looks like you don't have access to this store. Contact the store administrator for access."

Can anyone advise what is going on? I've tried every step above with no luck.

@kgeiger310
Copy link

Hi @Kcharle - Can you log into your DEV store from your partner dashboard?

If yes, log in as owner to new DEV store, and check to make sure the user you created is active - you should see "Congratulations on your growing team! You’ve added a second staff account to your store. Welcome, XYZ! ".

You can double check permissions, then make sure your new user has reset their password. You can email them/you instructions from the staff page.

Log out everywhere.

Go to new pw reset instructions and reset pw. Then log into your DEV store - but make sure you log in as new email address (sounds obvious but for me shopify always defaults me to my partner email)

Then go to CLI and try...with fingers crossed.

@Kcharle
Copy link

Kcharle commented Jul 7, 2021

Hi @kgeiger310 thanks! Realized I had a bit of confusion on my end, as well as a derp moment where an extension I have to show me a website's IP was covering the store "Settings" link haha.

I was able to login with the CLI, however I do have a clarification question though.

From what I understand, as a partner within the partner dashboard, you can add other users as owners or staff at a partner level, and that's what I had done. But it looks like I actually need to create a staff member within the specific store itself under Users & Permissions?

Some screenshots of what I'm seeing on my end.

  • Logged in as main partner account where the "Development" store was created.
    image

  • Clicked on the "development" store name in the list of all the stores I have access to within this account and can see both the "owner" and the "staff" user
    image

  • Tried logging in with shopify-cli using "kyle" user email address, received error.

  • Checked under "Users & Permissions" for the specific store in question and realized there is no "Staff" added, however I assumed adding a Staff on the partner dashboard would handle this?
    image

  • Verified the "kyle" staff account created under the partner dashboard has full permissions enabled for all stores existing and newly created.
    image

Am I correct in saying that a staff user has to be added directly to the store, and not on a partner dashboard level for the shopify-cli to work?

@sebszocinski
Copy link

I don't understand why a collaborator account can't just automatically become a staff user as well (at least for the meantime so we can start using the new features). This seems overly complicated for no reason?

@pm-zr
Copy link

pm-zr commented Apr 5, 2022

I don't understand, I've tried a number of solutions here and the only one that works is to create a staff account. This is not an acceptable solution, however, because the entire point of a development store is:

  • create a store
  • develop the store
  • hand off to client
  • continue to work on store without taking up staff seats

This issue makes the usual development workflow impossible? Deleting the staff account means I lose access again, so I have to keep a staff seat to use my collaborator access? What if we need >15 people to have access to the site during development?

@arunmecom
Copy link

I was facing the same issue
What I did
1: Log in to /admin and clear cookies
2: re-enter my login and password for the store
3: tried shopify login --store=[store] and shopify theme serve
4: and it worked

We have only one solution using /admin but still, people facing issues because of cookies, please try after removing cookies from the admin browser

@petercampanelli
Copy link

petercampanelli commented Apr 13, 2022

@arunmecom's method works, but it does not solve the issue which is logging in via Partner account. Also, other accounts logged into a partner dashboard do not have access by logging in through "/admin".

@pepicrft
Copy link
Contributor

👋🏼
For people running into this issue in the future, we are aware of this workflow not being ideal and we'll prioritize making the necessary changes server-side so that people don't run into this scenario.
Until we implement that, we are improving the errors to make them more actionable. A summary of can be found out in the caution box in this section of the documentation.

@azure-architect
Copy link

Amazing that the cli was released in this state.

@evankford
Copy link

Hey, is there any update on why this continues to be the policy: You can't use Shopify CLI with development stores if you only have Partner staff member access. If you want to use Shopify CLI to work on a development store, then you should be the store owner or create a staff account on the store.

I believe it's pretty common for Agencies to create partner accounts, and then freelance developers (like me), to be given staff access to that partner account. As it is now my staff partner account cannot use the CLI, even though it has full theme editing permissions outside the CLI. The workaround of creating a separate staff account works, but is unacceptable as it takes up staff seats. So I basically can't use the CLI on a large amount of my work.

Just want some clarification of if this is a bug that you intend to fix or an intentional limitation on staff partner accounts!

@github-actions
Copy link

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.

→ If there's no activity within a week, then a bot will automatically close this.

Thanks for helping to improve Shopify's dev tooling and experience.

@andershagbard
Copy link
Author

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.

→ If there's no activity within a week, then a bot will automatically close this.

Thanks for helping to improve Shopify's dev tooling and experience.

Stay alive

@hunterruth
Copy link

@andershagbard I'm pretty sure this is resolved. I was recently able to use shopify cli without creating a staff account on a development store. In fact, it wouldn't let me create a staff that matched the partner account. I'm on Version 2.28.0.

@Cam
Copy link
Contributor

Cam commented Nov 4, 2022

@hunterruth Unfortunately this issue still rears its ugly head from time to time. Just less often.

@shauns
Copy link

shauns commented Nov 16, 2022

@andershagbard thanks for the keep-alive on this!

Just want some clarification of if this is a bug that you intend to fix or an intentional limitation on staff partner accounts!

It's a bug. The fix is not something straightforward in just the CLI, or even the Partner dashboard, as it involves user identity. I can confirm its being actively worked on, and can only beg patience whilst its resolved. Once the underlying issue is sorted this problem should go away. In the meantime, the workaround in the error message is the right one.

@shauns shauns self-assigned this Nov 16, 2022
@fabianwohlfart
Copy link

fabianwohlfart commented Nov 25, 2022

I just transferred the ownership.
Now I cannot change the theme through the CLI anymore.
We even removed me from the collaborators and added me to a staff account.
Errors still shows up.
What do I have to do now?

@github-actions
Copy link

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.

→ If there's no activity within a week, then a bot will automatically close this.

Thanks for helping to improve Shopify's dev tooling and experience.

@ajpintos
Copy link

Is not inactive, still happen

@ajpintos
Copy link

in summary... in 2023... what is the right solution?

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

No branches or pull requests