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

/etc/ssh/ssh_config is not correctly populated #1288

Closed
hkirsman opened this issue Nov 9, 2018 · 1 comment
Closed

/etc/ssh/ssh_config is not correctly populated #1288

hkirsman opened this issue Nov 9, 2018 · 1 comment
Assignees

Comments

@hkirsman
Copy link

hkirsman commented Nov 9, 2018

Bug Report

I can't do functional test as it's just normal setup for Drupal 8 recipe. This works in our other computers but fails just in 1.

Tell us about your setup

This problem occurs on both Lando v3.0.0-rc.1 and v3.0.0-beta.47.
OS is MacOS High Sierra version 10.13.4.

name: example.com
recipe: drupal8
config:
  webroot: web
  php: '7.1'
  database: mysql:5.6
  drush: global:8.1.15
proxy:
  appserver:
    - local.example.com
services:
  appserver:
    portforward: 8080
    overrides:
      services:
        ports: ['8080:80']
        volumes:
          - $LANDO_APP_ROOT_BIND/.lando/composer.sh:/helpers/composer.sh
    #xdebug: true
    run:
      - "echo 'Running composer install to initialize your project.'"
      - "cd $LANDO_MOUNT && composer install"
    run_as_root:
      # Speed up site by removing XDebug totally according to xdebug variable in this file.
      - "sh /app/.lando/xdebug.sh"
  elasticsearch:
    type: elasticsearch:5.5
    portforward: 9200

  # Create a node instance for theming.
  # @todo: This seemed big image. Should check for more light-weight versions from the official docker node page.
  node:
    type: node:8.9
    globals:
      gulp-cli: "latest"
    run-as-root:
      - "echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p"
      - npm install
events:
  post-db-import:
    - appserver: /app/.lando/post_db_import.sh
  post-start:
    - /app/.lando/post_start.sh

tooling:
  # As our webroot is a bit non-standard then we need to add --root parameter to Drush.
  drush:
    service: appserver
    cmd:
      - "drush --root=/app/web --uri=http://local.example.com"
  # Fix memory limit issues for composer by using composer2 command instead.
  # I wasn't able to use composer here to override the original command.
  composer2:
    service: appserver
    description: Run composer commands without running into php errors!
    cmd:
      - /helpers/composer.sh
  npm:
    service: node
  gulp:
    description: Run gulp commands to build the theme. For ex use 'lando gulp build', 'lando gulp watch'...
    service: node

.lando/composer.sh:

#!/bin/bash

#
# Helper script to to increase Composer memory limit.
#

export PATH=/bin:/usr/bin:/usr/local/bin
set -e
php -d memory_limit=-1 $(which composer) "$@"

.lando/post_db_import.sh:

#!/bin/bash

#
# Helper script run post-db-import commands.
#

export PATH=/bin:/usr/bin:/usr/local/bin:/app/vendor/bin
set -e

cd /app/web
drush updb -y
# Run cron, this seems to help to do update:entities and maybe other things.
drush cron
# Help 'Config Split' by uninstalling elasticsearch_helper_aws.
drush pm-uninstall elasticsearch_helper_aws -y
# @todo: Cim can probably be removed in future when 'Config Split' is already enabled in the db.
drush cim -y
# Even if you have drush >= 8.1.10 you still need to use 'config-split-import' here.
drush config-split-import dev_split -y
drupal --yes update:entities
# Add content to Elasticsearch.
drush elasticsearch-helper-reindex
drush cron
# Output admin login url.
drush --uri=http://local.example.com/ uli

.lando/post_start.sh:

#!/bin/bash

#
# Helper script run post-start commands.
#

export PATH=/bin:/usr/bin:/usr/local/bin:/app/vendor/bin
set -e

echo ""
echo "#########################################################################################"
echo -e "#/ \033[33;32m GULP over docker at your service, developer. Type \"lando gulp\" to build the theme \033[0m \# "
echo "#########################################################################################"
echo ""
echo "###################################################"
echo -e "#/ \033[33;32m get an admin link running "lando drush uli"! \033[0m\#"
echo "###################################################"
echo ""

.lando/xdebug.sh:

#!/bin/bash

#
# Remove XDebug from PHP if it's disabled in .lando.yml to make the site lot faster.
# It seems xdebug: false/true disables and enables $XDEBUG_CONFIG variable.
# By renaming the xdebug ini file and reloading Apache we can remove it from PHP.
#

export PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin
set -e
conf=/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
conf_disabled="$conf.disabled"
if [ -z "$XDEBUG_CONFIG" ]; then
  if [ -f "$conf" ]; then
    mv "$conf" "$conf_disabled"
  fi
else
  if [ -f "$conf_disabled" ]; then
    mv "$conf_disabled" "$conf"
  fi
fi
service apache2 reload

Tell us about the command you were running

The project is running composer install inside the app but fails when GIT submodules need to get downloaded. The reason is that it can't find the ssh keys. When I checked the contents of /etc/ssh/ssh_config inside the container on my computer and on the problematic computer then I saw it was missing IdentityFile locations. On problematic container it's:

Host *
  StrictHostKeyChecking no
  UserKnownHostsFile=/dev/null
  LogLevel=ERROR

On the working environment it's:

Host *
  StrictHostKeyChecking no
  UserKnownHostsFile=/dev/null
  LogLevel=ERROR
  IdentityFile /user/.ssh/id_rsa

When we manually added the line then git submodules where pulled successfully.

One other way we tested this was trying

ssh -T git@github.com

on host and in container. It failed inside the docker container but connected successfully in host.

The problem happened on v3.0.0-beta.47. We downloaded latest Lando and used the uninstalled script it had (also uninstalled Docker). Then we deleted the ~/.lando folder. After that installed the latest v3.0.0-rc.1, did 'lando start' and still the same problem. Currently it's fixed with the manual entry to /etc/ssh/ssh_config.

Would like to know how Lando populates the etc/ssh/ssh_config inside the container. What could be the reason it's failing?

@pirog pirog added this to the RC1 milestone Nov 28, 2018
@pirog pirog self-assigned this Nov 28, 2018
@pirog pirog modified the milestones: 3.0.0-rc.2, 3.0.0-rc.3 Jan 23, 2019
@pirog pirog modified the milestone: 3.0.0-rc.3 Jan 31, 2019
pirog added a commit that referenced this issue Feb 2, 2019
@pirog
Copy link
Sponsor Member

pirog commented Feb 2, 2019

@hkirsman id try this out on the next release (rc.4) and reopen if its still a no go

@pirog pirog closed this as completed Feb 2, 2019
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