terminus-plugin-project / terminus-pancakes-plugin

Terminus Plugin to open Pantheon Site Databases in your Favorite SQL Client
MIT License
26 stars 19 forks source link

Unable to locate app #16

Closed uberhacker closed 7 years ago

uberhacker commented 7 years ago
$ terminus pc basic-testing.dev --app=mysql-workbench
 [error]  mysql-workbench was not found. Valid Apps:  

It looks like there are 2 issues here. Although mysql-workbench is in my path, pancakes still cannot locate it. Also, the Valid Apps: list is blank. Maybe this is part of the problem?

$ which mysql-workbench
/usr/bin/mysql-workbench

Maybe the solution is to allow folks to enter the full path to the executable?

derimagia commented 7 years ago

Issue is from #15

derimagia commented 7 years ago

Reopen this if it's still an issue

uberhacker commented 7 years ago

Still getting the same error after I pulled from master.

uberhacker commented 7 years ago

I have confirmed that I am logged in and terminus can find my site.

$ terminus pc basic-testing.dev --app=mysql-workbench
[error]  mysql-workbench was not found. Valid Apps:  
$ terminus site:list --name basic-testing
 --------------- -------------------------------------- --------------- ----------- -------------------------------------- --------------------- ----------------------------------------------------------------------------------------------------- 
  Name            ID                                     Service Level   Framework   Owner                                  Created               Memberships                                                                                          
 --------------- -------------------------------------- --------------- ----------- -------------------------------------- --------------------- ----------------------------------------------------------------------------------------------------- 
  basic-testing   b2195639-151b-422e-b988-8a163de73167   free            drupal      5b0c566e-9a6b-48ca-b964-5021805d7fec   2015-12-10 03:03:38   5b0c566e-9a6b-48ca-b964-5021805d7fec: Team,b7164502-5f6e-4280-b8a6-c61eb245e417: Mobile Strategies, LLC
derimagia commented 7 years ago

What OS are you using? Can you check this function to see if it's not returning correctly, I didn't do this one and it doesn't use the path, sadly.

https://github.com/terminus-plugin-project/terminus-pancakes/blob/a4d74a57187b39ad8d32c9a9fd4e78a8bcaf6242/src/Apps/MySQLWorkbenchApp.php#L38

uberhacker commented 7 years ago

System specs:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:   xenial

$ terminus --version
Terminus 1.0.0-beta.1

$ php -v
PHP 7.0.14-2+deb.sury.org~xenial+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.14-2+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies

$ composer --version
Composer version 1.3.0 2016-12-24 00:47:03
derimagia commented 7 years ago

Can you confirm the location of workbench is ~/.mysql/workbench/mysql-workbench?

uberhacker commented 7 years ago

No, that directory doesn't exist. Must be different on Linux vs Mac.

~/.mysql/workbench$ ls
cache  connections.xml  libraries  log  modules  scripts  server_instances.xml  shell_bookmarks.txt  shell_history.txt  snippets  sql_history  sql_workspaces  starters_settings.xml  user_starters.xml  wb_options.xml  wb_state.xml
derimagia commented 7 years ago

If I had to guess php isn't getting the PATH that you had on bash, so $this->app_location = 'mysql-workbench'; isn't working. If this was changed to /usr/bin/mysql-workbench it should work, although in the long run we should look into a better solution

derimagia commented 7 years ago

Made a change that may fix it. Looks like somewhere along the port, execCommand wasn't returning the result which messed up the which check.

uberhacker commented 7 years ago

PR #18 should close this out.