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

Host key verification failed when starting micro-RTPS #5

Open
rsisto opened this issue Oct 25, 2018 · 3 comments
Open

Host key verification failed when starting micro-RTPS #5

rsisto opened this issue Oct 25, 2018 · 3 comments

Comments

@rsisto
Copy link

rsisto commented Oct 25, 2018

Hi, there's an issue in the Dockerfile when creating the micro-RTPS image.
This happens when building the docker image
docker build -t fiware/micro-rtps-examples ./micro-rtps
At this line:
git clone --recursive https://github.com/eProsima/micro-RTPS.git
The error:

Step 20/22 : RUN git clone --recursive https://github.com/eProsima/micro-RTPS.git
---> Running in f5ea07e8ebd2
Cloning into 'micro-RTPS'...
Submodule 'agent' (git@github.com:eProsima/Micro-XRCE-DDS-Agent.git) registered for path 'agent'
Submodule 'client' (git@github.com:eProsima/Micro-XRCE-DDS-Client.git) registered for path 'client'
Submodule 'gen' (git@github.com:eProsima/Micro-XRCE-DDS-Gen.git) registered for path 'gen'
Cloning into 'agent'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of 'git@github.com:eProsima/Micro-XRCE-DDS-Agent.git' into submodule path 'agent' failed

This happens when trying to clone using the ssh form on the dependencies.
Probably because the host verification is failing or there's an invalid key when trying to ssh github.

For verification purposes, running this command locally works fine:
git clone --recursive https://github.com/eProsima/micro-RTPS.git

@jason-fox
Copy link
Member

jason-fox commented Oct 25, 2018

This isn't an issue with the tutorial itself, the problem lies in the /eProsima/micro-RTPS GitHub repository - or rather the .gitmodules within the renamed eProsima/Micro-XRCE-DDS GitHub

see: https://github.com/eProsima/Micro-XRCE-DDS/blob/master/.gitmodules

[submodule "client"]
	path = client
	url = git@github.com:eProsima/Micro-XRCE-DDS-Client.git
[submodule "agent"]
	path = agent
	url = git@github.com:eProsima/Micro-XRCE-DDS-Agent.git
[submodule "gen"]
	path = gen
	url = git@github.com:eProsima/Micro-XRCE-DDS-Gen.git

The URLs within the .gitmodules need to be updated to use the public HTTP URL since git within your Docker Image can't find the public key needed to download the repo from your server - the details are described in this Stack Overflow Question

I have raised this as separate PR on the eProsima repo itself.

jason-fox added a commit to jason-fox/Micro-XRCE-DDS that referenced this issue Oct 25, 2018
The current `.submodules` file is causing an issue when instantiating within a Docker environment. See FIWARE/tutorials.Fast-RTPS-Micro-RTPS#5 - this can be simply fixed by using HTTP urls rather than SSH
richiware pushed a commit to eProsima/Micro-XRCE-DDS that referenced this issue Oct 29, 2018
* Switch to use public HTTP endpoints

The current `.submodules` file is causing an issue when instantiating within a Docker environment. See FIWARE/tutorials.Fast-RTPS-Micro-RTPS#5 - this can be simply fixed by using HTTP urls rather than SSH

* Change colon to Slash
@rsisto
Copy link
Author

rsisto commented Oct 29, 2018

Hi Jason, sorry for the late reply.
You can add the ignore SSL of the repo with this line (I know it should be corrected in the .gitmodules file though, but for the sake of moving forward):
RUN git -c http.sslVerify=false clone --recursive https://github.com/eProsima/micro-RTPS.git

After moving forward, the problem now is that when executing the command
git checkout 344a25cbce4c2e8abca14bc0288164318a52d612
the folders micro-RTPS-agent and micro-RTPS-client become empty (thus the cmake fails):

CMake Error at CMakeLists.txt:64 (add_subdirectory):
  The source directory

    /micro-RTPS/micro-RTPS-agent

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:65 (add_subdirectory):
  The source directory

    /micro-RTPS/micro-RTPS-client

  does not contain a CMakeLists.txt file.

This happens because the submodules of that revision are not fetched.
This command needs to be executed before the cmake in order to fetch the submodules:
git submodule update --init
After this I see errors in the cmake command:

Cloning into 'thirdparty/micrortps_transport'...
fatal: could not read Username for 'https://github.com': No such device or address

I went this far, I'll continue tomorrow but wanted to list my findings..

@rsisto
Copy link
Author

rsisto commented Oct 29, 2018

This is my dockerfile so far:


# Dockerfile for installing Fast-RTPS and micro-RTPS
FROM phusion/baseimage:0.9.17

MAINTAINER Filip Lemic <filip.lemic@gmail.com>

RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

RUN echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" > /etc/apt/sources.list

RUN echo "deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main universe multiverse restricted" >> /etc/apt/sources.list

RUN apt-get -y update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q python-software-properties software-properties-common

# Install Java 8
RUN apt-get update && \
	apt-get upgrade -y && \
	apt-get install -y software-properties-common && \
	add-apt-repository ppa:webupd8team/java -y && \
	apt-get update && \
	echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
	apt-get install -y oracle-java8-installer


# install g{test} sources & put headers into /usr/include
RUN apt-get update && apt-get install -y libgtest-dev unzip build-essential

RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
	apt-get update && \
# 	apt-get install -y cpp curl make cmake libprotobuf-dev libboost-all-dev protobuf-compiler
	apt-get install -y cmake

RUN \
  apt-get update && \
  apt-get install -y software-properties-common && \
  add-apt-repository ppa:ubuntu-toolchain-r/test && \
  apt-get update && \
  apt-get install -y gcc-7 g++-7 && \
  update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60 && \
  update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60


# build & install gtest (cmake -DBUILD_SHARED_LIBS=ON . for shlibs)
RUN cd /usr/src/gtest ; cmake CMakeLists.txt ; make

RUN cp /usr/src/gtest/*.a /usr/lib/

# Download and install Gradle
RUN cd /usr/local && \
    curl -L https://services.gradle.org/distributions/gradle-2.5-bin.zip -o gradle-2.5-bin.zip && \
    unzip gradle-2.5-bin.zip && \
    rm gradle-2.5-bin.zip

# Export some environment variables
ENV GRADLE_HOME=/usr/local/gradle-2.5

ENV PATH=$PATH:$GRADLE_HOME/bin

RUN apt-get update && apt-get install -y git

RUN git clone --recursive https://github.com/eProsima/Fast-RTPS.git /Fast-RTPS

RUN mkdir /Fast-RTPS/build && \
	cd /Fast-RTPS/ && \
	git checkout 201a393b500a35d56d3e46b5b6c2c6a96e85928e && \
	cd build && \
	cmake -DTHIRDPARTY=ON -DBUILD_JAVA=ON .. && \
	make  && \
	make install


RUN  git -c http.sslVerify=false clone https://github.com/eProsima/micro-RTPS.git

RUN cd /micro-RTPS/ && \
	git checkout 344a25cbce4c2e8abca14bc0288164318a52d612 && \
	git -c http.sslVerify=false submodule update --init

RUN mkdir /micro-RTPS/build && \
	cd /micro-RTPS/build && \
	cmake -DTHIRDPARTY=ON -DEPROSIMA_BUILD_EXAMPLES=ON .. && \
	make && \
	make install && \
	cd .. && \
	ldconfig /usr/local/lib/

CMD ["bin/bash"]

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