{"id":2147,"date":"2017-10-24T21:55:44","date_gmt":"2017-10-25T02:55:44","guid":{"rendered":"http:\/\/osric.com\/chris\/accidental-developer\/?p=2147"},"modified":"2017-10-24T22:01:46","modified_gmt":"2017-10-25T03:01:46","slug":"freeipa-connection-check-passes-but-then-fails-during-install","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2017\/10\/freeipa-connection-check-passes-but-then-fails-during-install\/","title":{"rendered":"FreeIPA connection check passes, but then fails during install"},"content":{"rendered":"<p>One of my FreeIPA servers is on a VM that&#8217;s too small and I&#8217;ve been having problems with it. I should have known that anything that runs Java and Tomcat should have double the processing power, double the memory, and double the drive space of whatever I think it should have. Rather than merely adjust the VM settings though, I thought I would spin up a new VM with better specs and create a new replica. Should be easy, right?<\/p>\n<p>I created a new CentOS 7 VM, trinculo.osric.net, and installed ipa-server 4.5.0:<\/p>\n<pre><code>$ sudo yum install ipa-server<\/code><\/pre>\n<p>I checked the connection from the replica target to the master:<\/p>\n<pre><code>$ sudo ipa-replica-conncheck --master=ariel.osric.net<\/code><\/pre>\n<p>Likewise I checked the connection from the master to the replica target:<\/p>\n<pre><code>$ sudo ipa-replica-conncheck --replica=trinculo.osric.net<\/code><\/pre>\n<p>Everything was successful, so on the existing master I created the replica file:<\/p>\n<pre><code>$ sudo ipa-replica-prepare --ip-address=192.168.0.101 trinculo.osric.net<\/code><\/pre>\n<p>I copied that over to the replica target, but the replica installer indicated a failed connection check:<\/p>\n<pre><code>$ sudo ipa-replica-install \/root\/replica-info-trinculo.osric.net.gpg --ip-address=192.168.0.101\r\n...\r\nipa.ipapython.install.cli.install_tool(CompatServerReplicaInstall): ERROR    Connection check failed!\r\nSee \/var\/log\/ipareplica-conncheck.log for more information.\r\nIf the check results are not valid it can be skipped with --skip-conncheck parameter.<\/code><\/pre>\n<p>A failed connection check when the connection checks passed?<!--more--><\/p>\n<p>I looked at the log:<\/p>\n<pre><code>...\r\n2017-10-20T15:55:04Z DEBUG args=\/usr\/sbin\/ipa-replica-conncheck --master ariel.osric.net --auto-master-check --realm IPA.OSRIC.NET --hostname trinculo.osric.net --principal admin --ca-cert-file \/tmp\/tmp52pKZbria\/real_info\/ca.crt\r\n2017-10-20T15:55:04Z DEBUG Process finished, return code=1\r\n...<\/code><\/pre>\n<p>OK, the <code>return code=1<\/code> means there was an error. The arguments to the <code>ipa-replica-conncheck<\/code> command listed contain items in addition to what I actually specified as well, although those are likely defaults and\/or pulled from the replica file generated on the FreeIPA master. There was additional info in the <code>\/var\/log\/ipareplica-conncheck.log<\/code> file though:<\/p>\n<pre><code>Connection from replica to master is OK.\r\nStart listening on required ports for remote master check\r\nGet credentials to log in to remote master\r\nCheck RPC connection to remote master\r\ntrying https:\/\/ariel.osric.net\/ipa\/json\r\nRetrying using SSH...\r\nCheck SSH connection to remote master\r\nERROR: Could not SSH to remote host.\r\nSee \/var\/log\/ipareplica-conncheck.log for more information.\r\n\r\n2017-10-20T15:55:27Z DEBUG Starting external process\r\n2017-10-20T15:55:27Z DEBUG args=\/usr\/sbin\/ipa-client-install --unattended --uninstall\r\n2017-10-20T15:55:27Z DEBUG Process finished, return code=2\r\n2017-10-20T15:55:27Z DEBUG   File \"\/usr\/lib\/python2.7\/site-packages\/ipapython\/admintool.py\", line 172, in execute\r\n    return_value = self.run()\r\n  File \"\/usr\/lib\/python2.7\/site-packages\/ipapython\/install\/cli.py\", line 333, in run\r\n    cfgr.run()\r\n  File \"\/usr\/lib\/python2.7\/site-packages\/ipapython\/install\/core.py\", line 366, in run\r\n    self.validate()\r\n\r\n  ...\r\n\r\n2017-10-20T15:55:28Z DEBUG The ipa-replica-install command failed, exception: ScriptError: Connection check failed!<\/code><\/pre>\n<p>One log file, but conflicting messages!<\/p>\n<ol>\n<li>Connection from replica to master is OK.<\/li>\n<li>ERROR: Could not SSH to remote host.<\/li>\n<li>ScriptError: Connection check failed!<\/li>\n<\/ol>\n<p>Two things I was thinking:<\/p>\n<ol>\n<li>If SSH is a required connection, why isn&#8217;t it part of the <code>ipa-replica-conncheck<\/code> command?<\/li>\n<li>Maybe I should try the <code>--skip-conncheck<\/code> flag.<\/li>\n<\/ol>\n<p>I had to uninstall ipa-server on the replica target first, since some portion was installed before it encountered an error:<\/p>\n<pre><code>$ sudo ipa-server-install --uninstall<\/code><\/pre>\n<p>Likewise, I had to remove the replica from FreeIPA on the master:<\/p>\n<pre><code>$ sudo ipa host-del trinculo.osric.net<\/code><\/pre>\n<p>I&#8217;d like to say that, at this point, I ran the following and everything went perfectly:<\/p>\n<pre><code>$ sudo ipa-replica-install \/root\/replica-info-trinculo.osric.net.gpg --ip-address=192.168.0.101 --skip-conncheck<\/code><\/pre>\n<p>That would be a lie, of course.<\/p>\n<p>I ran into numerous additional error messages and spent a lot of time following bad leads. Eventually, while researching one of the new error messages, I ran across a thread on the FreeIPA mailing list (<a href=\"https:\/\/www.redhat.com\/archives\/freeipa-users\/2013-April\/msg00000.html\">Issue while setting up Replication<\/a>) where the user was finally successful after spinning up a new virtual machine and starting fresh! Out of frustration, I tried the same, and this time the same command worked (with <code>--skip-conncheck<\/code>):<\/p>\n<pre><code>$ sudo ipa-replica-install \/root\/replica-info-trinculo.osric.net.gpg --ip-address=192.168.0.101 --skip-conncheck<\/code><\/pre>\n<p>That was not the most satisfying solution. On the other hand, it was finally working.<\/p>\n<p>Other people have warned me that a failed FreeIPA installation can leave behind various files and artifacts that cause problems when reinstalling, even after you run <code>ipa-server-install --uninstall<\/code>. I figured that was largely resolved in current versions (I&#8217;m using 4.5.0), but there may still be some issues.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The FreeIPA replica connection check passed between the replica target and the master, and between the master and the replica target. Yet the replica install failed with a message saying the connection check failed! I investigated further, and although I eventually succeeded in installing a FreeIPA replica, I never found the source of that error or the many subsequent errors I encountered attempting to correct it.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[422],"tags":[417],"class_list":["post-2147","post","type-post","status-publish","format-standard","hentry","category-sysadmin","tag-freeipa"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=2147"}],"version-history":[{"count":16,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2147\/revisions"}],"predecessor-version":[{"id":2194,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2147\/revisions\/2194"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=2147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=2147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=2147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}