Bit: Bit export fails due to auth issue

Created on 23 Dec 2019  ยท  22Comments  ยท  Source: teambit/bit

When tag multiple components and then running

bit export

I get an error if any of my components being exported include a bit package from the bit library itself.

error: permission to scope hub.bit.dev:react-bootstrap.react-bootstrap was denied see troubleshooting at https://docs.bit.dev/docs/setup-authentication#authentication-issues

A few of the components that are causing issues include a component or two from this library

https://bit.dev/react-bootstrap/react-bootstrap

When exporting and tagging components one by one I do not get the issue, only when doing multiple exports, which really slows things down.

Specifications

  • Bit version: 14.7.1
  • Node version: 13.3.0
  • npm / yarn version: 6.13.2
  • Platform: Mac
  • Bit compiler (include version): React
  • Bit tester (include version):

Additional context

Add any other context about the problem here.

areexport typbug

Most helpful comment

@AlexanderKaran add quotes:

bit export climateclever.ui-components "climateclever.ui-components/*"

This is because zsh is trying to interpret the asterisk.
Also - was updated in the docs: https://docs.bit.dev/docs/export#remote-scopes

All 22 comments

hello,
Did you run bit export without any args?
If yes, it will by default try to export the components to the scope they were imported from.
I guess you don't have permission to the react-bootstrap scope so when trying to export back to this scope you get the error.
You can either run
bit export user.collection which will export all the staged components to this collection.
or use the --set-current-scope when exporting components that imported from scope you don't own to change their current scope, so next time you will run bit export without any args it will export them to this scope.
read more about it here

If the description above doesn't describe your situation / solve your issue, please re-open.
At the moment it looks like it's the expected behavior.

@Tallyb I think it's worth writing a few words about what happens when running bit export without any arg.

Thanks for the info @GiladShoham

Question though, what happens when I have updated multiple components from different scopes, what argument do I need to add to export all to their collections?

Also, why is trying to export to the Bootstrap collection when I have not tagged changes in it because it is not my component.

Question though, what happens when I have updated multiple components from different scopes, what argument do I need to add to export all to their collections?

The implicit bit export (without any args) are designed for this exactly. so you can run bit export and everything goes back to where it belongs.
The issue start when you tag components that doesn't belongs to you and trying to export them back to their original collection when what you really want it to fork them into your own collection.
In such case I would recommend to first export them manually (can be grouped by bit export user.collection forkedComp1 forkedComp2)
then run the regular bit export without args from now on.

Also, why is trying to export to the Bootstrap collection when I have not tagged changes in it because it is not my component.

If you didn't tag them, it's really odd. it might be a bug.
What do you see in bit status before the export?

Yes, I did not tag them, it's a bug. I will run it again tomorrow and re-open this issue with all the details.

@AlexanderKaran
Thanks.

Hi @GiladShoham

So I had a who load of updates and I ran:

bit tag --all

I did not tag the third-party component from Bootstrap at all

I then run:

bit export

And I get the auth error even though I did not change the Bootstrap component:

error: permission to scope hub.bit.dev:react-bootstrap.react-bootstrap was denied
see troubleshooting at https://docs.bit.dev/docs/setup-authentication#authentication-issues

Here is my terminal print out:

alexanderkaran@AlexandersMBP2 cc_school_web % bit tag --all
  building components...
โข€โ € building component - climateclever.measure-page-components/[email protected](node:9023) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
โœ” building component - climateclever.measure-page-components/[email protected]
โœ” building component - climateclever.redux-components/[email protected]
โœ” building component - climateclever.redux-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-icons/[email protected]
โœ” building component - climateclever.web-networking/[email protected]
โœ” building component - climateclever.dashboard-page-components/[email protected]
โœ” building component - climateclever.dashboard-page-components/[email protected]
โœ” building component - climateclever.forgot-change-page-components/[email protected]
โœ” building component - climateclever.forgot-page-components/[email protected]
โœ” building component - climateclever.login-page-components/[email protected]
โœ” building component - climateclever.measure-page-components/[email protected]
โœ” building component - climateclever.measure-page-components/[email protected]
โœ” building component - climateclever.profile-page-components/[email protected]
โœ” building component - climateclever.profile-page-components/[email protected]
โœ” building component - climateclever.set-first-password-page-components/[email protected]
โœ” building component - climateclever.signup-page-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
โœ” building component - climateclever.ui-components/[email protected]
37 component(s) tagged
(use "bit export [collection]" to push these components to a remote")
(use "bit untag" to unstage versions)

changed components
(components that got a version bump)
     > climateclever.measure-page-components/[email protected]
       auto-tagged dependents: climateclever.measure-page-components/[email protected]
     > climateclever.redux-components/[email protected]
     > climateclever.redux-components/[email protected]
     > climateclever.ui-components/[email protected]
       auto-tagged dependents: climateclever.dashboard-page-components/[email protected], climateclever.dashboard-page-components/[email protected], climateclever.forgot-change-page-components/[email protected], climateclever.forgot-page-components/[email protected], climateclever.login-page-components/[email protected], climateclever.profile-page-components/[email protected], climateclever.profile-page-components/[email protected], climateclever.set-first-password-page-components/[email protected], climateclever.signup-page-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected]
     > climateclever.ui-components/[email protected]
       auto-tagged dependents: climateclever.profile-page-components/[email protected], climateclever.signup-page-components/[email protected]
     > climateclever.ui-components/[email protected]
     > climateclever.ui-components/[email protected]
       auto-tagged dependents: climateclever.forgot-change-page-components/[email protected], climateclever.forgot-page-components/[email protected], climateclever.login-page-components/[email protected], climateclever.profile-page-components/[email protected], climateclever.set-first-password-page-components/[email protected], climateclever.signup-page-components/[email protected]
     > climateclever.ui-components/[email protected]
     > climateclever.ui-components/[email protected]
       auto-tagged dependents: climateclever.forgot-change-page-components/[email protected], climateclever.forgot-page-components/[email protected], climateclever.login-page-components/[email protected], climateclever.profile-page-components/[email protected], climateclever.profile-page-components/[email protected], climateclever.set-first-password-page-components/[email protected], climateclever.signup-page-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected], climateclever.ui-components/[email protected]
     > climateclever.ui-icons/[email protected]
       auto-tagged dependents: climateclever.measure-page-components/[email protected], climateclever.measure-page-components/[email protected]
     > climateclever.web-networking/[email protected]

alexanderkaran@AlexandersMBP2 cc_school_web % bit export
error: permission to scope hub.bit.dev:react-bootstrap.react-bootstrap was denied
see troubleshooting at https://docs.bit.dev/docs/setup-authentication#authentication-issues
alexanderkaran@AlexandersMBP2 cc_school_web % 

Here is my bit status:

`alexanderkaran@AlexandersMBP2 cc_school_web % bit status
staged components
(use "bit export to push these components to a remote scope")

 > section. versions: 0.0.8 ... ok
 > section-cards. versions: 0.0.8 ... ok
 > forgot-change-form. versions: 0.0.10 ... ok
 > forgot-form. versions: 0.0.10 ... ok
 > login-form. versions: 0.0.12 ... ok
 > measure-stats. versions: 0.0.7 ... ok
 > progress. versions: 0.0.2 ... ok
 > account-page. versions: 0.0.10 ... ok
 > payment-info. versions: 0.0.7 ... ok
 > provider-actions. versions: 0.0.2 ... ok
 > providers-reducer. versions: 0.0.2 ... ok
 > set-first-password-form. versions: 0.0.9 ... ok
 > default-user-sign-up-form. versions: 0.0.15 ... ok
 > cc-alert. versions: 0.0.5 ... ok
 > cc-app-error. versions: 0.0.2 ... ok
 > cc-area-card. versions: 0.0.5 ... ok
 > cc-bottom-bar-alert. versions: 0.0.4 ... ok
 > cc-button. versions: 0.0.6 ... ok
 > cc-button-loader. versions: 0.0.7 ... ok
 > cc-drop-down-input. versions: 0.0.4 ... ok
 > cc-drop-down-input-formix. versions: 0.0.5 ... ok
 > cc-formix-input-group. versions: 0.0.4 ... ok
 > cc-full-page-alert. versions: 0.0.6 ... ok
 > cc-input-label-link. versions: 0.0.6 ... ok
 > cc-modal. versions: 0.0.6 ... ok
 > cc-panel. versions: 0.0.3 ... ok
 > cc-panel-actions. versions: 0.0.2 ... ok
 > cc-payment-details. versions: 0.0.9 ... ok
 > cc-search-bar. versions: 0.0.2 ... ok
 > cc-text-input. versions: 0.0.2 ... ok
 > cc-text-input-address. versions: 0.0.5 ... ok
 > cc-text-input-password. versions: 0.0.3 ... ok
 > cc-text-input-phone. versions: 0.0.2 ... ok
 > cc-text-input-year. versions: 0.0.2 ... ok
 > circle-arrow-icon. versions: 0.0.2 ... ok
 > products. versions: 0.0.2 ... ok

`

I have managed to export most by exporting each component one by one.

However, now I am left with a few that won't export because apparently the ID is wrong even though I am copying what comes from bit status. Also bit export still has the auth issue.

alexanderkaran@AlexandersMBP2 cc_school_web % bit status
staged components
(use "bit export <remote_scope> to push these components to a remote scope")

     > login-form. versions: 0.0.13 ... ok
     > measure-stats. versions: 0.0.7 ... ok
     > payment-info. versions: 0.0.7 ... ok
     > cc-modal. versions: 0.0.6 ... ok
alexanderkaran@AlexandersMBP2 cc_school_web % bit export climateclever.measure-page-components measure-stats
error: component ID is invalid, please use the following format: [scope]/<name>

@AleksandarSavic95 Thanks for reporting this.
The issue with the id is a bug, we will fix it.
you can try to export it with the full name:
bit export climateclever.measure-page-components climateclever.measure-page-components /measure-stats
It should do the trick.

Any update on this? It really slowing dev down having to export components one by one?

@AlexanderKaran , Can you think of a way for me to reproduce the issue?
If not, let's start with understanding where this react-bootstrap comes from.
Please run bit list --scope, find a component that starts with react-bootstrap, then, run bit show <id-you-found> --dependents --dependencies, let me know if you see any of your components there.
If there is only one react-bootstrap, please run bit cmp <id> and see if there is any 'local' or 'state' property.

Until this is fixed, you can use wildcards to avoid exporting them one by one.
e.g. bit export climateclever.ui-components climateclever.ui-components/*, this will export all components start with climateclever.ui-components to climateclever.ui-components remote.

@davidfirst Thanks for the wild card update, maybe we can update the docs so they are a little clearer with these things.

react-bootstrap comes from here:

https://bit.dev/react-bootstrap/react-bootstrap/container

We never update it, change it or anything else. It's installed via NPM and used in a few of our Bit components. Will run those commands when I get to the office.

Also, I ran:

bit export climateclever.ui-components climateclever.ui-components/*

And it states:

zsh: no matches found: ui-components/*

When there are this many components to export like this:

(use "bit export to push these components to a remote scope")

 > action-selection. versions: 0.0.3 ... ok
 > header-stats-and-actions. versions: 0.0.3 ... ok
 > section. versions: 0.0.9 ... ok
 > section-cards. versions: 0.0.9 ... ok
 > forgot-change-form. versions: 0.0.14 ... ok
 > forgot-form. versions: 0.0.14 ... ok
 > login-form. versions: 0.0.17 ... ok
 > measure-stats. versions: 0.0.10 ... ok
 > account-page. versions: 0.0.14 ... ok
 > payment-info. versions: 0.0.12 ... ok
 > profile-menu. versions: 0.0.3 ... ok
 > set-first-password-form. versions: 0.0.13 ... ok
 > default-user-sign-up-form. versions: 0.0.19 ... ok
 > payment-plans. versions: 0.0.3 ... ok
 > price-info. versions: 0.0.5 ... ok
 > terms. versions: 0.0.5 ... ok
 > cc-alert. versions: 0.0.6 ... ok
 > cc-app-error. versions: 0.0.3 ... ok
 > cc-area-card. versions: 0.0.6 ... ok
 > cc-bottom-bar-alert. versions: 0.0.7 ... ok
 > cc-button. versions: 0.0.7 ... ok
 > cc-button-loader. versions: 0.0.10 ... ok
 > cc-check-box. versions: 0.0.5 ... ok
 > cc-date-selector. versions: 0.0.2 ... ok
 > cc-date-selector-formik. versions: 0.0.3 ... ok
 > cc-drop-down-input. versions: 0.0.5 ... ok
 > cc-drop-down-input-formix. versions: 0.0.7 ... ok
 > cc-formix-input-group. versions: 0.0.7 ... ok
 > cc-full-page-alert. versions: 0.0.7 ... ok
 > cc-header. versions: 0.0.4 ... ok
 > cc-icon-bar. versions: 0.0.2 ... ok
 > cc-input-label-link. versions: 0.0.7 ... ok
 > cc-modal. versions: 0.0.7 ... ok
 > cc-panel. versions: 0.0.7 ... ok
 > cc-panel-actions. versions: 0.0.6 ... ok
 > cc-payment-details. versions: 0.0.13 ... ok
 > cc-search-bar. versions: 0.0.4 ... ok
 > cc-tab-menu. versions: 0.0.2 ... ok
 > cc-table. versions: 0.0.2 ... ok
 > cc-table-icons. versions: 0.0.2 ... ok
 > cc-text-input. versions: 0.0.4 ... ok
 > cc-text-input-address. versions: 0.0.8 ... ok
 > cc-text-input-password. versions: 0.0.5 ... ok
 > cc-text-input-phone. versions: 0.0.4 ... ok
 > cc-text-input-year. versions: 0.0.4 ... ok
 > cc-toggle-input. versions: 0.0.7 ... ok
 > cc-triangle. versions: 0.0.2 ... ok
 > billing-setup. versions: 0.0.2 ... ok
 > cru-bill. versions: 0.0.5 ... ok
 > cru-meter. versions: 0.0.4 ... ok
 > cru-provider. versions: 0.0.6 ... ok
 > cru-stream. versions: 0.0.4 ... ok
 > cru-volume. versions: 0.0.4 ... ok
 > cru-waste-bill. versions: 0.0.5 ... ok
 > cru-weight. versions: 0.0.4 ... ok
 > providers. versions: 0.0.6 ... ok
 > set-up. versions: 0.0.5 ... ok
 > type-selection-row. versions: 0.0.2 ... ok
 > utilities-components/bills. versions: 0.0.6 ... ok
 > utility-header-nav. versions: 0.0.2 ... ok

Everyone starting with cc- is ui-components/*

@AlexanderKaran add quotes:

bit export climateclever.ui-components "climateclever.ui-components/*"

This is because zsh is trying to interpret the asterisk.
Also - was updated in the docs: https://docs.bit.dev/docs/export#remote-scopes

Thank you @Tallyb

@AlexanderKaran Did what @Tallyb suggested worked as expected?

@GiladShoham Yes it did, export each collection one by one causes no errors, only on export all do I get the error

@AlexanderKaran , if you're still experiencing this issue, please run the following BIT_LOG=debug bit export, it'll print the log during the export command. Copy the output and send it to me by email to [email protected].

Sure, will do this today @davidfirst

Email sent, sorry for the slow reply some other priorities took over

Good news! I'm able to reproduce the issue. Working on a fix now.

The issue has been fixed by the PR above.

Was this page helpful?
0 / 5 - 0 ratings