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

Build Tools 3.x doesn't work with Terminus 3.0 #434

Closed
aaronbauman opened this issue Mar 4, 2022 · 2 comments
Closed

Build Tools 3.x doesn't work with Terminus 3.0 #434

aaronbauman opened this issue Mar 4, 2022 · 2 comments

Comments

@aaronbauman
Copy link
Contributor

aaronbauman commented Mar 4, 2022

Getting this error on build:env:install

Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /home/tester/.terminus/terminus-dependencies-617a5343ca/vendor/pantheon-systems/terminus-build-tools-plugin/src/Commands/BuildToolsBase.php on line 800

After terminus auth:login, I'm running this command within docker-build-tools-ci:8.x-php8.0

terminus build:env:install example.pr-123 --site-name="composer-base" --site-mail="test@example.com" --account-name=admin --account-mail="test@eample.com" --account-pass=password -v

Here's the full stacktrace

Call Stack:
    0.0069     459648   1. {main}() /usr/local/bin/terminus:0
    0.0393    1664600   2. require('phar:///usr/local/bin/terminus/bin/terminus') /usr/local/bin/terminus:12
    0.1258    7453528   3. Pantheon\Terminus\Terminus->run($input = ???, $output = ???) phar:///usr/local/bin/terminus/bin/terminus:78
    0.1258    7453560   4. Robo\Runner->run($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build:env:install', 1 => 'composer-base.pr-359', 2 => '--site-name=composer-base', 3 => '--site-mail=info@messageagency.com', 4 => '--account-name=admin', 5 => '--account-mail=info@messageagency.com', 6 => '--account-pass=password', 7 => '-v']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 2; private $lastArrayArgument = NULL; private $lastOptionalArgument = class Symfony\Component\Console\Input\InputArgument { ... }; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['site-name' => 'composer-base', 'site-mail' => 'info@messageagency.com', 'account-name' => 'admin', 'account-mail' => 'info@messageagency.com', 'account-pass' => 'password', 'verbose' => TRUE]; protected $arguments = ['command' => 'build:env:install', 'site_env_id' => 'composer-base.pr-359']; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(3) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 64; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 64; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }, $app = class Symfony\Component\Console\Application { private $commands = ['help' => class Symfony\Component\Console\Command\HelpCommand { ... }, 'list' => class Symfony\Component\Console\Command\ListCommand { ... }, '_complete' => class Symfony\Component\Console\Command\CompleteCommand { ... }, 'completion' => class Symfony\Component\Console\Command\DumpCompletionCommand { ... }, 'self:update' => class SelfUpdate\SelfUpdateCommand { ... }, 'update' => class SelfUpdate\SelfUpdateCommand { ... }, 'self-update' => class SelfUpdate\SelfUpdateCommand { ... }, 'aliases' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'drush:aliases' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'alpha:aliases' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'art' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'auth:login' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'login' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'auth:logout' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'logout' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'auth:whoami' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'whoami' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backup:automatic:disable' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backup:automatic:enable' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backup:automatic:info' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backup:create' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backup:get' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backup:info' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backup:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backups' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'backup:restore' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'branch:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'branches' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'connection:info' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'connection:set' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'dashboard:view' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'dashboard' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:add' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:dns' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domains' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:lookup' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:primary:add' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:primary:remove' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:primary:rm' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:remove' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'domain:rm' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:clear-cache' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:cc' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:clone-content' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:code-log' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:commit' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:deploy' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'deploy' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:diffstat' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:info' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'envs' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:metrics' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'metrics' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'alpha:env:metrics' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'alpha:metrics' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:view' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'site:view' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:wake' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:wipe' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'https:info' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'https:remove' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'https:disable' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'https:rm' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'https:set' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'https:add' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'https:enable' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'import:complete' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'site:import:complete' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'import:database' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'import:db' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'import:files' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'import:site' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'site:import' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'local:clone' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'lc' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'local:commitAndPush' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'local:getLiveDB' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'ldb' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'local:getLiveFiles' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'lf' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'lock:disable' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'lock:enable' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'lock:info' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'machine-token:delete-all' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'mt:delete-all' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'machine-token:delete' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'mt:delete' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'machine-token:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'machine-tokens' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'mt:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'mts' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'multidev:create' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:create' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'multidev:delete' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:delete' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'multidev:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'multidevs' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'multidev:merge-from-dev' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:merge-from-dev' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'multidev:merge-to-dev' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'env:merge-to-dev' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'new-relic:disable' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'new-relic:enable' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'new-relic:info' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'orgs' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:people:add' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:ppl:add' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:people:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:ppl:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:people:remove' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:people:rm' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:ppl:remove' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:ppl:rm' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:people:role' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:ppl:role' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:site:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:sites' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:site:remove' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:site:rm' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:upstream:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'org:upstreams' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'upstream:list' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'upstreams' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'owner:set' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, 'payment-method:add' => class Consolidation\AnnotatedCommand\AnnotatedCommand { ... }, ...]; private $wantHelps = FALSE; private $runningCommand = class Consolidation\AnnotatedCommand\AnnotatedCommand { protected $commandCallback = [...]; protected $commandProcessor = class Consolidation\AnnotatedCommand\CommandProcessor { ... }; protected $annotationData = class Consolidation\AnnotatedCommand\AnnotationData { ... }; protected $examples = [...]; protected $topics = [...]; protected $returnType = NULL; protected $injectedClasses = [...]; protected $parameterMap = [...]; private ${Symfony\Component\Console\Command\Command}application = ...; private ${Symfony\Component\Console\Command\Command}name = 'build:env:install'; private ${Symfony\Component\Console\Command\Command}processTitle = NULL; private ${Symfony\Component\Console\Command\Command}aliases = [...]; private ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { ... }; private ${Symfony\Component\Console\Command\Command}hidden = FALSE; private ${Symfony\Component\Console\Command\Command}help = ''; private ${Symfony\Component\Console\Command\Command}description = 'Install the apporpriate CMS on the newly-created Pantheon site.'; private ${Symfony\Component\Console\Command\Command}fullDefinition = class Symfony\Component\Console\Input\InputDefinition { ... }; private ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ${Symfony\Component\Console\Command\Command}code = NULL; private ${Symfony\Component\Console\Command\Command}synopsis = [...]; private ${Symfony\Component\Console\Command\Command}usages = [...]; private ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { ... } }; private $name = 'Terminus'; private $version = '3.0.6'; private $commandLoader = NULL; private $catchExceptions = TRUE; private $autoExit = FALSE; private $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; private $helperSet = class Symfony\Component\Console\Helper\HelperSet { private $helpers = [...]; private $command = NULL }; private $dispatcher = class Symfony\Component\EventDispatcher\EventDispatcher { private $listeners = [...]; private $sorted = [...]; private $optimized = [...] }; private $terminal = class Symfony\Component\Console\Terminal {  }; private $defaultCommand = 'list'; private $singleCommand = FALSE; private $initialized = TRUE; private $signalRegistry = NULL; private $signalsToDispatchEvent = [] }, $commandFiles = [0 => 'Consolidation\\Filter\\Hooks\\FilterHooks', 1 => 'Pantheon\\Terminus\\Hooks\\Authorizer', 2 => 'Pantheon\\Terminus\\Hooks\\RoleValidator', 3 => 'Pantheon\\Terminus\\Hooks\\SiteEnvLookup', 4 => 'Pantheon\\Terminus\\Commands\\AliasesCommand', 5 => 'Pantheon\\Terminus\\Commands\\ArtCommand', 6 => 'Pantheon\\Terminus\\Commands\\Auth\\LoginCommand', 7 => 'Pantheon\\Terminus\\Commands\\Auth\\LogoutCommand', 8 => 'Pantheon\\Terminus\\Commands\\Auth\\WhoamiCommand', 9 => 'Pantheon\\Terminus\\Commands\\Backup\\Automatic\\DisableCommand', 10 => 'Pantheon\\Terminus\\Commands\\Backup\\Automatic\\EnableCommand', 11 => 'Pantheon\\Terminus\\Commands\\Backup\\Automatic\\InfoCommand', 12 => 'Pantheon\\Terminus\\Commands\\Backup\\BackupCommand', 13 => 'Pantheon\\Terminus\\Commands\\Backup\\CreateCommand', 14 => 'Pantheon\\Terminus\\Commands\\Backup\\GetCommand', 15 => 'Pantheon\\Terminus\\Commands\\Backup\\InfoCommand', 16 => 'Pantheon\\Terminus\\Commands\\Backup\\ListCommand', 17 => 'Pantheon\\Terminus\\Commands\\Backup\\RestoreCommand', 18 => 'Pantheon\\Terminus\\Commands\\Backup\\SingleBackupCommand', 19 => 'Pantheon\\Terminus\\Commands\\Branch\\ListCommand', 20 => 'Pantheon\\Terminus\\Commands\\Connection\\InfoCommand', 21 => 'Pantheon\\Terminus\\Commands\\Connection\\SetCommand', 22 => 'Pantheon\\Terminus\\Commands\\Dashboard\\ViewCommand', 23 => 'Pantheon\\Terminus\\Commands\\Domain\\AddCommand', 24 => 'Pantheon\\Terminus\\Commands\\Domain\\DNSCommand', 25 => 'Pantheon\\Terminus\\Commands\\Domain\\ListCommand', 26 => 'Pantheon\\Terminus\\Commands\\Domain\\LookupCommand', 27 => 'Pantheon\\Terminus\\Commands\\Domain\\Primary\\AddCommand', 28 => 'Pantheon\\Terminus\\Commands\\Domain\\Primary\\RemoveCommand', 29 => 'Pantheon\\Terminus\\Commands\\Domain\\RemoveCommand', 30 => 'Pantheon\\Terminus\\Commands\\Env\\ClearCacheCommand', 31 => 'Pantheon\\Terminus\\Commands\\Env\\CloneContentCommand', 32 => 'Pantheon\\Terminus\\Commands\\Env\\CodeLogCommand', 33 => 'Pantheon\\Terminus\\Commands\\Env\\CommitCommand', 34 => 'Pantheon\\Terminus\\Commands\\Env\\DeployCommand', 35 => 'Pantheon\\Terminus\\Commands\\Env\\DiffStatCommand', 36 => 'Pantheon\\Terminus\\Commands\\Env\\InfoCommand', 37 => 'Pantheon\\Terminus\\Commands\\Env\\ListCommand', 38 => 'Pantheon\\Terminus\\Commands\\Env\\MetricsCommand', 39 => 'Pantheon\\Terminus\\Commands\\Env\\ViewCommand', 40 => 'Pantheon\\Terminus\\Commands\\Env\\WakeCommand', 41 => 'Pantheon\\Terminus\\Commands\\Env\\WipeCommand', 42 => 'Pantheon\\Terminus\\Commands\\HTTPS\\InfoCommand', 43 => 'Pantheon\\Terminus\\Commands\\HTTPS\\RemoveCommand', 44 => 'Pantheon\\Terminus\\Commands\\HTTPS\\SetCommand', 45 => 'Pantheon\\Terminus\\Commands\\Import\\CompleteCommand', 46 => 'Pantheon\\Terminus\\Commands\\Import\\DatabaseCommand', 47 => 'Pantheon\\Terminus\\Commands\\Import\\FilesCommand', 48 => 'Pantheon\\Terminus\\Commands\\Import\\SiteCommand', 49 => 'Pantheon\\Terminus\\Commands\\Local\\CloneCommand', 50 => 'Pantheon\\Terminus\\Commands\\Local\\CommitAndPushCommand', 51 => 'Pantheon\\Terminus\\Commands\\Local\\GetLiveDBCommand', 52 => 'Pantheon\\Terminus\\Commands\\Local\\GetLiveFilesCommand', 53 => 'Pantheon\\Terminus\\Commands\\Lock\\DisableCommand', 54 => 'Pantheon\\Terminus\\Commands\\Lock\\EnableCommand', 55 => 'Pantheon\\Terminus\\Commands\\Lock\\InfoCommand', 56 => 'Pantheon\\Terminus\\Commands\\MachineToken\\DeleteAllCommand', 57 => 'Pantheon\\Terminus\\Commands\\MachineToken\\DeleteCommand', 58 => 'Pantheon\\Terminus\\Commands\\MachineToken\\ListCommand', 59 => 'Pantheon\\Terminus\\Commands\\Multidev\\CreateCommand', 60 => 'Pantheon\\Terminus\\Commands\\Multidev\\DeleteCommand', 61 => 'Pantheon\\Terminus\\Commands\\Multidev\\ListCommand', 62 => 'Pantheon\\Terminus\\Commands\\Multidev\\MergeFromDevCommand', 63 => 'Pantheon\\Terminus\\Commands\\Multidev\\MergeToDevCommand', 64 => 'Pantheon\\Terminus\\Commands\\NewRelic\\DisableCommand', 65 => 'Pantheon\\Terminus\\Commands\\NewRelic\\EnableCommand', 66 => 'Pantheon\\Terminus\\Commands\\NewRelic\\InfoCommand', 67 => 'Pantheon\\Terminus\\Commands\\Org\\ListCommand', 68 => 'Pantheon\\Terminus\\Commands\\Org\\People\\AddCommand', 69 => 'Pantheon\\Terminus\\Commands\\Org\\People\\ListCommand', 70 => 'Pantheon\\Terminus\\Commands\\Org\\People\\RemoveCommand', 71 => 'Pantheon\\Terminus\\Commands\\Org\\People\\RoleCommand', 72 => 'Pantheon\\Terminus\\Commands\\Org\\Site\\ListCommand', 73 => 'Pantheon\\Terminus\\Commands\\Org\\Site\\RemoveCommand', 74 => 'Pantheon\\Terminus\\Commands\\Org\\Upstream\\ListCommand', 75 => 'Pantheon\\Terminus\\Commands\\Owner\\SetCommand', 76 => 'Pantheon\\Terminus\\Commands\\PaymentMethod\\AddCommand', 77 => 'Pantheon\\Terminus\\Commands\\PaymentMethod\\ListCommand', 78 => 'Pantheon\\Terminus\\Commands\\PaymentMethod\\RemoveCommand', 79 => 'Pantheon\\Terminus\\Commands\\Plan\\InfoCommand', 80 => 'Pantheon\\Terminus\\Commands\\Plan\\ListCommand', 81 => 'Pantheon\\Terminus\\Commands\\Plan\\SetCommand', 82 => 'Pantheon\\Terminus\\Commands\\Redis\\DisableCommand', 83 => 'Pantheon\\Terminus\\Commands\\Redis\\EnableCommand', 84 => 'Pantheon\\Terminus\\Commands\\Remote\\DrushCommand', 85 => 'Pantheon\\Terminus\\Commands\\Remote\\SSHBaseCommand', 86 => 'Pantheon\\Terminus\\Commands\\Remote\\WPCommand', 87 => 'Pantheon\\Terminus\\Commands\\SSHKey\\AddCommand', 88 => 'Pantheon\\Terminus\\Commands\\SSHKey\\ListCommand', 89 => 'Pantheon\\Terminus\\Commands\\SSHKey\\RemoveCommand', 90 => 'Pantheon\\Terminus\\Commands\\Self\\ClearCacheCommand', 91 => 'Pantheon\\Terminus\\Commands\\Self\\ConfigDumpCommand', 92 => 'Pantheon\\Terminus\\Commands\\Self\\ConsoleCommand', 93 => 'Pantheon\\Terminus\\Commands\\Self\\InfoCommand', 94 => 'Pantheon\\Terminus\\Commands\\Self\\Plugin\\CreateCommand', 95 => 'Pantheon\\Terminus\\Commands\\Self\\Plugin\\InstallCommand', 96 => 'Pantheon\\Terminus\\Commands\\Self\\Plugin\\ListCommand', 97 => 'Pantheon\\Terminus\\Commands\\Self\\Plugin\\ReloadCommand', 98 => 'Pantheon\\Terminus\\Commands\\Self\\Plugin\\SearchCommand', 99 => 'Pantheon\\Terminus\\Commands\\Self\\Plugin\\UninstallCommand', 100 => 'Pantheon\\Terminus\\Commands\\Self\\Plugin\\UpdateCommand', 101 => 'Pantheon\\Terminus\\Commands\\ServiceLevel\\SetCommand', 102 => 'Pantheon\\Terminus\\Commands\\Site\\CreateCommand', 103 => 'Pantheon\\Terminus\\Commands\\Site\\DeleteCommand', 104 => 'Pantheon\\Terminus\\Commands\\Site\\InfoCommand', 105 => 'Pantheon\\Terminus\\Commands\\Site\\ListCommand', 106 => 'Pantheon\\Terminus\\Commands\\Site\\LookupCommand', 107 => 'Pantheon\\Terminus\\Commands\\Site\\Org\\AddCommand', 108 => 'Pantheon\\Terminus\\Commands\\Site\\Org\\ListCommand', 109 => 'Pantheon\\Terminus\\Commands\\Site\\Org\\RemoveCommand', 110 => 'Pantheon\\Terminus\\Commands\\Site\\SiteCommand', 111 => 'Pantheon\\Terminus\\Commands\\Site\\Team\\AddCommand', 112 => 'Pantheon\\Terminus\\Commands\\Site\\Team\\ListCommand', 113 => 'Pantheon\\Terminus\\Commands\\Site\\Team\\RemoveCommand', 114 => 'Pantheon\\Terminus\\Commands\\Site\\Team\\RoleCommand', 115 => 'Pantheon\\Terminus\\Commands\\Site\\Upstream\\ClearCacheCommand', 116 => 'Pantheon\\Terminus\\Commands\\Site\\Upstream\\SetCommand', 117 => 'Pantheon\\Terminus\\Commands\\Solr\\DisableCommand', 118 => 'Pantheon\\Terminus\\Commands\\Solr\\EnableCommand', 119 => 'Pantheon\\Terminus\\Commands\\Tag\\AddCommand', 120 => 'Pantheon\\Terminus\\Commands\\Tag\\ListCommand', 121 => 'Pantheon\\Terminus\\Commands\\Tag\\RemoveCommand', 122 => 'Pantheon\\Terminus\\Commands\\Tag\\TagCommand', 123 => 'Pantheon\\Terminus\\Commands\\TerminusCommand', 124 => 'Pantheon\\Terminus\\Commands\\Upstream\\InfoCommand', 125 => 'Pantheon\\Terminus\\Commands\\Upstream\\ListCommand', 126 => 'Pantheon\\Terminus\\Commands\\Upstream\\Updates\\ApplyCommand', 127 => 'Pantheon\\Terminus\\Commands\\Upstream\\Updates\\ListCommand', ...], $classLoader = ???) phar:///usr/local/bin/terminus/src/Terminus.php:465
    0.8218   12644448   5. Symfony\Component\Console\Application->run($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build:env:install', 1 => 'composer-base.pr-359', 2 => '--site-name=composer-base', 3 => '--site-mail=info@messageagency.com', 4 => '--account-name=admin', 5 => '--account-mail=info@messageagency.com', 6 => '--account-pass=password', 7 => '-v']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 2; private $lastArrayArgument = NULL; private $lastOptionalArgument = class Symfony\Component\Console\Input\InputArgument { ... }; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['site-name' => 'composer-base', 'site-mail' => 'info@messageagency.com', 'account-name' => 'admin', 'account-mail' => 'info@messageagency.com', 'account-pass' => 'password', 'verbose' => TRUE]; protected $arguments = ['command' => 'build:env:install', 'site_env_id' => 'composer-base.pr-359']; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(3) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 64; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 64; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }) /home/tester/.terminus/terminus-dependencies-617a5343ca/vendor/consolidation/robo/src/Runner.php:282
    0.8278   12648736   6. Symfony\Component\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build:env:install', 1 => 'composer-base.pr-359', 2 => '--site-name=composer-base', 3 => '--site-mail=info@messageagency.com', 4 => '--account-name=admin', 5 => '--account-mail=info@messageagency.com', 6 => '--account-pass=password', 7 => '-v']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 2; private $lastArrayArgument = NULL; private $lastOptionalArgument = class Symfony\Component\Console\Input\InputArgument { ... }; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['site-name' => 'composer-base', 'site-mail' => 'info@messageagency.com', 'account-name' => 'admin', 'account-mail' => 'info@messageagency.com', 'account-pass' => 'password', 'verbose' => TRUE]; protected $arguments = ['command' => 'build:env:install', 'site_env_id' => 'composer-base.pr-359']; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(3) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 64; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 64; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }) /home/tester/.terminus/terminus-dependencies-617a5343ca/vendor/symfony/console/Application.php:171
    0.8293   12794400   7. Symfony\Component\Console\Application->doRunCommand($command = class Consolidation\AnnotatedCommand\AnnotatedCommand { protected $commandCallback = [0 => class Pantheon\TerminusBuildTools\Commands\EnvInstallCommand { ... }, 1 => 'installSite']; protected $commandProcessor = class Consolidation\AnnotatedCommand\CommandProcessor { protected $hookManager = class Consolidation\AnnotatedCommand\Hooks\HookManager { ... }; protected $formatterManager = class Consolidation\OutputFormatters\FormatterManager { ... }; protected $prepareOptionsList = [...]; protected $passExceptions = NULL; protected $resultWriter = class Consolidation\AnnotatedCommand\ResultWriter { ... }; protected $parameterInjection = class Consolidation\AnnotatedCommand\ParameterInjection { ... }; protected $logger = class Robo\Log\RoboLogger { ... } }; protected $annotationData = class Consolidation\AnnotatedCommand\AnnotationData { private ${ArrayObject}storage = [...] }; protected $examples = []; protected $topics = []; protected $returnType = NULL; protected $injectedClasses = []; protected $parameterMap = ['site_env_id' => FALSE, 'siteDir' => FALSE]; private ${Symfony\Component\Console\Command\Command}application = class Symfony\Component\Console\Application { private $commands = [...]; private $wantHelps = FALSE; private $runningCommand = ...; private $name = 'Terminus'; private $version = '3.0.6'; private $commandLoader = NULL; private $catchExceptions = TRUE; private $autoExit = FALSE; private $definition = class Symfony\Component\Console\Input\InputDefinition { ... }; private $helperSet = class Symfony\Component\Console\Helper\HelperSet { ... }; private $dispatcher = class Symfony\Component\EventDispatcher\EventDispatcher { ... }; private $terminal = class Symfony\Component\Console\Terminal { ... }; private $defaultCommand = 'list'; private $singleCommand = FALSE; private $initialized = TRUE; private $signalRegistry = NULL; private $signalsToDispatchEvent = [...] }; private ${Symfony\Component\Console\Command\Command}name = 'build:env:install'; private ${Symfony\Component\Console\Command\Command}processTitle = NULL; private ${Symfony\Component\Console\Command\Command}aliases = [0 => 'build-env:site-install']; private ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = class Symfony\Component\Console\Input\InputArgument { ... }; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; private ${Symfony\Component\Console\Command\Command}hidden = FALSE; private ${Symfony\Component\Console\Command\Command}help = ''; private ${Symfony\Component\Console\Command\Command}description = 'Install the apporpriate CMS on the newly-created Pantheon site.'; private ${Symfony\Component\Console\Command\Command}fullDefinition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 2; private $lastArrayArgument = NULL; private $lastOptionalArgument = class Symfony\Component\Console\Input\InputArgument { ... }; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; private ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ${Symfony\Component\Console\Command\Command}code = NULL; private ${Symfony\Component\Console\Command\Command}synopsis = []; private ${Symfony\Component\Console\Command\Command}usages = []; private ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { private $helpers = [...]; private $command = NULL } }, $input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build:env:install', 1 => 'composer-base.pr-359', 2 => '--site-name=composer-base', 3 => '--site-mail=info@messageagency.com', 4 => '--account-name=admin', 5 => '--account-mail=info@messageagency.com', 6 => '--account-pass=password', 7 => '-v']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 2; private $lastArrayArgument = NULL; private $lastOptionalArgument = class Symfony\Component\Console\Input\InputArgument { ... }; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['site-name' => 'composer-base', 'site-mail' => 'info@messageagency.com', 'account-name' => 'admin', 'account-mail' => 'info@messageagency.com', 'account-pass' => 'password', 'verbose' => TRUE]; protected $arguments = ['command' => 'build:env:install', 'site_env_id' => 'composer-base.pr-359']; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(3) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 64; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 64; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }) /home/tester/.terminus/terminus-dependencies-617a5343ca/vendor/symfony/console/Application.php:299
@aaronbauman
Copy link
Contributor Author

Doing some debugging, the problem is in runCommandTemplateOnRemoteEnv which doesn't do any input checking on its arguments to escapeArgument while iterating over $options:

    protected function runCommandTemplateOnRemoteEnv(
        $site_env_id,
        $command_templates,
        $operation_label,
        $options
    ) {
        list($site, $env) = $this->getSiteEnv($site_env_id);
        $this->log()->notice('{op} on {site}', ['op' => $operation_label, 'site' => $site_env_id]);

        // Set the target environment to sftp mode prior to running the command
        $this->connectionSet($env, 'sftp');

        foreach ((array)$command_templates as $command_template) {
            $metadata = array_map(function ($item) { return $this->escapeArgument($item); }, $options);
            $command_line = $this->interpolate($command_template, $metadata);
            $redacted_metadata = $this->redactMetadata($metadata, ['account-pass']);
            $redacted_command_line = $this->interpolate($command_template, $redacted_metadata);

I can see that this code hasn't changed in 5 years, so something upstream must have changed. Not sure exactly what, but I guess we should do type checking here before sending the arguments through.

@kporras07
Copy link
Collaborator

PR merged. Thanks!

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