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

Bit import on fresh install MacOS gives obscure error #222

Closed
ezbz opened this issue Aug 16, 2017 · 4 comments
Closed

Bit import on fresh install MacOS gives obscure error #222

ezbz opened this issue Aug 16, 2017 · 4 comments

Comments

@ezbz
Copy link

ezbz commented Aug 16, 2017

OS: MacOS 10.12.6
Shell: zsh 5.3.1 (x86_64-apple-darwin16.6.0)
Installed bit via sudo npm install bit-bin --global

Bit config, init and status pass ok but when I try to import I get the following:

~/d/bitsrc ❯❯❯ bit import bit.utils/validator/is-email
Error
    at unpackCmd (/usr/local/lib/node_modules/bit-bin/dist/utils/unpack-command.js:15:11)
    at /usr/local/lib/node_modules/bit-bin/dist/scope/network/ssh/ssh.js:247:75
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

When I go to unpackCmd (/usr/local/lib/node_modules/bit-bin/dist/utils/unpack-command.js:15:11) and change line 15 from:

throw new Error(str);
to
throw new Error(err);

And run again I get:

~/d/bitsrc ❯❯❯ bit import bit.utils/validator/is-email
Error: SyntaxError: Unexpected end of JSON input
    at unpackCmd (/usr/local/lib/node_modules/bit-bin/dist/utils/unpack-command.js:15:11)
    at /usr/local/lib/node_modules/bit-bin/dist/scope/network/ssh/ssh.js:247:75
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Proper validation error handling is needed here for configuration issues

@GiladShoham
Copy link
Member

Thanks, @ezbz for reporting this issue.

few comments about the issue:

  1. Can you please share your bit version? (run bit -V in terminal). if it's lower than 0.10.5 I suggest you upgrade to version 0.10.5 (released yesterday)
  2. bit.utils is an old scope which is not backward compatible, we will update this scope in a few days (and we will notify you right after)
  3. Regarding the unpack cmd error, we just took care of this in version 0.10.5, now you should get a better error in the terminal, and the real error should be written into bit logs which you can find in this path:
~/Library/Caches/Bit/logs/debug.log

@ezbz
Copy link
Author

ezbz commented Aug 17, 2017

Thanks @GiladShoham for replying so quickly,

Upped to version 0.10.5

~/d/bitsrc ❯❯❯ bit -V                                                                                                                                ⏎
0.10.5
~/d/bitsrc ❯❯❯ bit import bit.utils/validator/is-email
Error
    at unpackCmd (/usr/local/lib/node_modules/bit-bin/dist/utils/unpack-command.js:15:11)
    at /usr/local/lib/node_modules/bit-bin/dist/scope/network/ssh/ssh.js:252:75
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
~/d/bitsrc ❯❯❯ more ~/Library/Caches/Bit/logs/debug.log                                                                                              ⏎

2017-08-17T11:56:14.702Z - ESC[32minfoESC[39m: [*] started a new command: "import [ids...]" with the following data:
{ args: [ [ ESC[32m'bit.utils/validator/is-email'ESC[39m ] ],
  opts:
   { tester: ESC[90mundefinedESC[39m,
     verbose: ESC[90mundefinedESC[39m,
     compiler: ESC[90mundefinedESC[39m,
     prefix: ESC[90mundefinedESC[39m,
     display_dependencies: ESC[90mundefinedESC[39m } }
2017-08-17T11:56:15.205Z - ESC[34mdebugESC[39m: importSpecificComponents, Ids: bit.utils/validator/is-email
2017-08-17T11:56:15.208Z - ESC[34mdebugESC[39m: scope.getManyWithAllVersions, Ids: bit.utils/validator/is-email@latest
2017-08-17T11:56:15.208Z - ESC[34mdebugESC[39m: scope.importMany: bit.utils/validator/is-email@latest
2017-08-17T11:56:15.209Z - ESC[34mdebugESC[39m: sources.getMany, Ids:
2017-08-17T11:56:15.209Z - ESC[34mdebugESC[39m: scope.importMany: successfully fetched local components and their dependencies. Going to fetch externals
2017-08-17T11:56:15.210Z - ESC[34mdebugESC[39m: Planning to run a hook post_export_hook with a method post
2017-08-17T11:56:15.210Z - ESC[34mdebugESC[39m: Planning to run a hook post_import_hook with a method post
2017-08-17T11:56:15.215Z - ESC[33mwarnESC[39m: Failed running the post_import_hook hook as destUrl is not set in the config file
2017-08-17T11:56:15.217Z - ESC[34mdebugESC[39m: getExternalMany, planning on fetching from remote scope. Ids: bit.utils/validator/is-email@latest
2017-08-17T11:56:15.217Z - ESC[34mdebugESC[39m: sources.getMany, Ids: bit.utils/validator/is-email@latest
2017-08-17T11:56:15.218Z - ESC[34mdebugESC[39m: Failed reading a ref file /Users/erezmazor/dev/bitsrc/.bit/objects/9c/47b39a1e6d56ba1dfcb2bd81fbe9221d57010d
2017-08-17T11:56:15.219Z - ESC[34mdebugESC[39m: getExternalMany: 1 left. Fetching them from a remote
2017-08-17T11:56:15.220Z - ESC[34mdebugESC[39m: [-] Running fetch or fetchOnes on a remote
2017-08-17T11:56:17.557Z - ESC[34mdebugESC[39m: ssh: going to run a remote command _fetch , path: bit.utils
2017-08-17T11:56:18.765Z - ESC[34mdebugESC[39m: ssh: returned with code: undefined, signal: undefined.
2017-08-17T11:56:18.767Z - ESC[31merrorESC[39m:  Error
    at unpackCmd (/usr/local/lib/node_modules/bit-bin/dist/utils/unpack-command.js:15:11)
    at /usr/local/lib/node_modules/bit-bin/dist/scope/network/ssh/ssh.js:252:75
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
2017-08-17T11:56:18.789Z - ESC[31merrorESC[39m: [*] the command has been terminated with an error code 1

@GiladShoham
Copy link
Member

Thanks @ezbz

This component won't work for now since it's an old component.
I'll update this thread once we will update it.

Regarding the unpack cmd error, you should get a better error.
It's a bug, and I added it to our todo list.

@GiladShoham
Copy link
Member

@ezbz this should work now, with the latest version of bit (0.10.6) and the current utils scope on bitsrc.io
I'm closing this, if it's still happening to you i'll open it again.

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

No branches or pull requests

2 participants