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/nikola/.atom/packages/syfi/lib... #4

Open dinamic opened 8 years ago

dinamic commented 8 years ago

[Enter steps to reproduce below:]

  1. Open folder containing a folder with symfony 2.7 project
  2. Open app/config/routing.yml
  3. Select the path to the bundle routing.yml file and click 'Find in Symfony project'

Atom Version: 1.0.19 System: Mac OS X 10.11 Thrown From: syfi package, v0.5.0

Stack Trace

Uncaught Error: syfi exec error: Command failed: /bin/sh -c /Users/nikola/.atom/packages/syfi/lib/../syfi-cli '@KapinkaShippingContainerPresentationBundle/Resources/config/routing.yml'

At /Users/nikola/.atom/packages/syfi/lib/symfonyFinder.coffee:30

Error: syfi exec error: Command failed: /bin/sh -c /Users/nikola/.atom/packages/syfi/lib/../syfi-cli '@KapinkaShippingContainerPresentationBundle/Resources/config/routing.yml'

  at SymfonyFinder.module.exports.SymfonyFinder.openResult (/Users/nikola/.atom/packages/syfi/lib/symfonyFinder.coffee:30:17)
  at /Users/nikola/.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

     -9:48.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -7:16.1.0 application:open (atom-text-editor.editor.is-focused)
     -2:30.9.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -2:28.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:00.8.0 syfi:find (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "one-light-ui",
      "solarized-light-syntax"
    ]
  }
}

Installed Packages

# User
color-picker, v2.0.12
linter, v1.7.2
linter-php, v1.0.5
php-analyser, v0.2.0
php-twig, v4.0.0
syfi, v0.5.0
symfony-snippets, v0.3.0

# Dev
No dev packages
dinamic commented 8 years ago

Upon manual execution of the syfi-cli is becomes apparent it should be invoked from the root of the Symfony project. Maybe the plugin fails to determine which is the root folder, because I have opened my projects folder, not only the Symfony project.

hendricha commented 8 years ago

Supposedly if you run it from a folder that is not determined to be a symfony project root, the package should show a friendly message to configure the location of the "app" folder of the symfony project manually, in the package's settings.

However since you got an error it is a bit more intriguing than that. So...

  1. Could you post the full cli output if you run the command from the folder that you use as your atom project root? (Which you described as your "projects folder".)
  2. Could you run it for me again from the same folder, but with the SYMFONY_APP_FOLDER environment variable set as the folder where your symfony project's AppKernel.php and bootstrap.php.cache is? (The "app" folder normally.)
dinamic commented 8 years ago

If the SYMFONY_APP_FOLDER is not set, the output is as follows:

#/bin/sh -c /Users/nikola/.atom/packages/syfi/lib/../syfi-cli '@KapinkaShippingContainerPresentationBundle/Resources/config/routing.yml'

Warning: require_once(/Users/nikola/Projects/app/bootstrap.php.cache): failed to open stream: No such file or directory in /Users/nikola/.atom/packages/syfi/syfi-cli on line 10

Call Stack:
    0.0003     263648   1. {main}() /Users/nikola/.atom/packages/syfi/syfi-cli:0

Fatal error: require_once(): Failed opening required '/Users/nikola/Projects/app/bootstrap.php.cache' (include_path='.:') in /Users/nikola/.atom/packages/syfi/syfi-cli on line 10

Call Stack:
    0.0003     263648   1. {main}() /Users/nikola/.atom/packages/syfi/syfi-cli:0
dinamic commented 8 years ago

If the SYMFONY_APP_FOLDER is set it seems to work, however, the project it finds is not even a Symfony one. Let alone the fact the file is PHP.

#/bin/sh -c /Users/nikola/.atom/packages/syfi/lib/../syfi-cli '@KapinkaShippingContainerPresentationBundle/Resources/config/routing.yml'
/Users/nikola/Projects/Personal/behat/features/bootstrap/FeatureContext.php