Pantheon https://kentrichards.net/ en Drush 9, PTY allocation request failed on channel 0 https://kentrichards.net/blog/drush-9-pty-allocation-request-failed-channel-0 <span>Drush 9, PTY allocation request failed on channel 0</span> <span><span lang="" about="/users/kentr" typeof="schema:Person" property="schema:name" datatype="">kentr</span></span> <span>01/07/2019, 13:27</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><h2>Problem</h2> <p>After updating my local Drush and converting an alias for a Pantheon site, I was getting no output except the error</p> <pre> <code class="language-no-highlight">PTY allocation request failed on channel 0</code></pre><h2>Solution</h2> <p>Using <code>--debug</code>, I found that <code>drush</code> is calling <code>ssh</code> with the <code>-t</code> option:</p> <pre> <code class="language-no-highlight language-shell">$ drush @example.dev status --debug [preflight] Config paths: /Users/********/.drush/drush.yml,/Users/********/.composer/vendor/drush/drush/drush.yml [preflight] Alias paths: /Users/********/.drush/sites,/etc/drush/sites,/Users/********/.composer/vendor/drush/drush/drush/sites [preflight] Commandfile search paths: /Users/********/.composer/vendor/drush/drush/src [debug] Redispatch hook status [0.11 sec, 7.11 MB] [command] Backend invoke: ssh -p 2222 -o "AddressFamily inet" -t *****************@appserver.*****************.drush.in 'drush --verbose --debug --uri=https://example.com status -vvv 2&gt;&amp;1' 2&gt;&amp;1 [0.11 sec, 7.12 MB] Calling proc_open(ssh -p 2222 -o "AddressFamily inet" -t *****************@appserver.*****************.drush.in 'drush --verbose --debug --uri=https://example.com status -vvv 2&gt;&amp;1' 2&gt;&amp;1); PTY allocation request failed on channel 0 [debug] Redispatch hook exit early [1.97 sec, 7.12 MB]</code></pre><p>A grep in the drush code found the <a href="https://github.com/drush-ops/drush/blob/master/examples/example.site.yml" rel="noreferrer"><code>tty</code> option for drush alias declarations</a>:</p> <pre> <code class="language-php"># - 'ssh': Contains settings used to control how ssh commands are generated # when running remote commands. # - 'options': Contains additional commandline options for the ssh command # itself, e.g. "-p 100" # - 'tty': Usually, Drush will decide whether or not to create a tty (via # the ssh '--t' option) based on whether the local Drush command is running # interactively or not. To force Drush to always or never create a tty, # set the 'ssh.tty' option to 'true' or 'false', respectively.</code></pre><p>Sure enough, adding <code>tty: False</code> to the <code>ssh</code> options in the alias declaration made the error go away, and drush worked as expected:</p> <pre> <code class="language-yaml"> ssh: options: '-p 2222 -o "AddressFamily inet"' tty: False</code></pre><p> </p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/tag/drush" hreflang="en">Drush</a></div> <div class="field--item"><a href="/tag/pantheon" hreflang="en">Pantheon</a></div> <div class="field--item"><a href="/tag/drupal" hreflang="en">Drupal</a></div> </div> </div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=70&amp;2=comment_no_subject&amp;3=comment_no_subject" token="1uYoYuAOERaxM8O3M6gh0L2X1Y_vJ2yceks3QcmI5Hk"></drupal-render-placeholder> </section> Mon, 07 Jan 2019 21:27:52 +0000 kentr 70 at https://kentrichards.net https://kentrichards.net/blog/drush-9-pty-allocation-request-failed-channel-0#comments