hendricha / syfi

Find and open file belonging selected service id, class or resource in a Symfony project
MIT License
3 stars 0 forks source link

Uncaught Error: syfi exec error: Command failed: /bin/sh -c /Users/echansen/.atom/packages/syfi/l... #2

Closed eric-hansen closed 8 years ago

eric-hansen commented 8 years ago
  1. Install package
  2. Restart Atom
  3. Open Symfony project root
  4. Hit default key binding of ctrl+alt+o
  5. See error

Atom Version: 1.0.15 System: Mac OS X 10.10.3 Thrown From: syfi package, v0.4.0

Stack Trace

Uncaught Error: syfi exec error: Command failed: /bin/sh -c /Users/echansen/.atom/packages/syfi/lib/../syfi-cli ''

At /Users/echansen/.atom/packages/syfi/lib/symfonyFinder.coffee:25

Error: syfi exec error: Command failed: /bin/sh -c /Users/echansen/.atom/packages/syfi/lib/../syfi-cli ''

  at SymfonyFinder.module.exports.SymfonyFinder.openResult (/Users/echansen/.atom/packages/syfi/lib/symfonyFinder.coffee:25:17)
  at /Users/echansen/.atom/packages/syfi/lib/symfonyFinder.coffee:1:1
  at ChildProcess.exithandler (child_process.js:215:5)
  at emitTwo (events.js:87:13)
  at ChildProcess.emit (events.js:172:7)
  at maybeClose (internal/child_process.js:764:16)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

Commands

     -0:01.3.0 syfi:find (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "projectHome": "/Users/echansen/Projects",
    "themes": [
      "one-dark-ui",
      "base16-tomorrow-dark-theme"
    ]
  },
  "syfi": {}
}

Installed Packages

# User
aligner-php, v1.0.0
autocomplete-php, v0.3.7
file-icons, v1.6.9
highlight-line, v0.11.0
linter, v1.6.0
linter-csslint, v1.0.5
linter-htmlhint, v0.1.1
linter-js-yaml, v1.1.2
linter-jshint, v1.2.0
linter-php, v1.0.3
linter-phpcs, v1.1.0
linter-phpmd, v1.2.0
linter-scss-lint, v2.0.0
linter-tidy, v1.0.1
php-debug, v0.1.3
project-manager, v2.5.2
save-session, v0.15.7
syfi, v0.4.0
terminal-plus, v0.4.3

# Dev
No dev packages
eric-hansen commented 8 years ago

As a side note I also just tried it by highlighting a service in one of my projects and running the keyboard shortcut and I get the same error, except the '' is populated with the name of the service.

hendricha commented 8 years ago
  1. The package only works when there is something selected. So yeah, I put up an issue, to throw a more helpful message to the user when there is nothing selected. #3
  2. Now, when you actually did select something it also produced an exception. Could you show me a terminal output of the following:
cd [your symfony project root]
/bin/sh -c /Users/echansen/.atom/packages/syfi/lib/../syfi-cli '[some service name you know that exists]'

Also note, that I'm not really at home at OS X, so there might be some quite obvious reason that the above command does not run. (I have this suspicion that you will not have /bin/sh executable. If that is indeed the case could you run

php /Users/echansen/.atom/packages/syfi/lib/../syfi-cli '[some service name you know that exists]'

instead?)

eric-hansen commented 8 years ago

/bin/sh:

/Erics-MacBook-Pro-2:~ echansen$ /bin/sh
sh-3.2$

Here's the output of the first command you gave me (same output when running it w/ php):

PHP Fatal error:  Cannot redeclare endsWith() (previously declared in /Users/echansen/.atom/packages/syfi/syfi-cli:51) in /Users/echansen/Projects/xxx/PHP/zzz/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php on line 594
PHP Stack trace:
PHP   1. {main}() /Users/echansen/.atom/packages/syfi/syfi-cli:0
PHP   2. require_once() /Users/echansen/.atom/packages/syfi/syfi-cli:9
PHP   3. require_once() /Users/echansen/Projects/xxx/PHP/zzz/app/bootstrap.php.cache:5
PHP   4. require() /Users/echansen/Projects/xxx/PHP/zzz/app/autoload.php:9
PHP   5. ComposerAutoloaderInit2e313ca40c2ac5851f90e89fe2814deb::getLoader() /Users/echansen/Projects/xxx/PHP/zzz/vendor/autoload.php:7a
PHP   6. composerRequire2e313ca40c2ac5851f90e89fe2814deb() /Users/echansen/Projects/xxx/PHP/zzz/vendor/composer/autoload_real.php:45
PHP   7. require() /Users/echansen/Projects/xxx/PHP/zzz/vendor/composer/autoload_real.php:54

Fatal error: Cannot redeclare endsWith() (previously declared in /Users/echansen/.atom/packages/syfi/syfi-cli:51) in /Users/echansen/Projects/xxx/PHP/zzz/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php on line 594

Call Stack:
    0.0016     258152   1. {main}() /Users/echansen/.atom/packages/syfi/syfi-cli:0
    0.0109    1369112   2. require_once('/Users/echansen/Projects/xxx/PHP/zzz/app/bootstrap.php.cache') /Users/echansen/.atom/packages/syfi/syfi-cli:9
    0.0114    1371280   3. require_once('/Users/echansen/Projects/xxx/PHP/zzz/app/autoload.php') /Users/echansen/Projects/xxx/PHP/zzz/app/bootstrap.php.cache:5
    0.0116    1373000   4. require('/Users/echansen/Projects/xxx/PHP/zzz/vendor/autoload.php') /Users/echansen/Projects/xxx/PHP/zzz/app/autoload.php:9
    0.0127    1384680   5. ComposerAutoloaderInit2e313ca40c2ac5851f90e89fe2814deb::getLoader() /Users/echansen/Projects/xxx/PHP/zzz/vendor/autoload.php:7
    0.0199    1526400   6. composerRequire2e313ca40c2ac5851f90e89fe2814deb() /Users/echansen/Projects/xxx/PHP/zzz/vendor/composer/autoload_real.php:45
    0.0218    1621832   7. require('/Users/echansen/Projects/xxx/PHP/zzz/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php') /Users/echansen/Projects/xxx/PHP/zzz/vendor/composer/autoload_real.php:54
hendricha commented 8 years ago

@eric-hansen : I've added a supposed workaround for it, and published it as version 0.5.0. Could you check it out, and see if it works?

eric-hansen commented 8 years ago

Yup, that works, thanks!

hendricha commented 8 years ago

:+1: