RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1456595 - ipa CLI does not check if machine is enrolled before attempting to contact IPA server
Summary: ipa CLI does not check if machine is enrolled before attempting to contact IP...
Keywords:
Status: CLOSED DUPLICATE of bug 1368345
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-29 18:27 UTC by Sudhir Menon
Modified: 2017-08-08 14:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 14:19:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sudhir Menon 2017-05-29 18:27:02 UTC
Description of problem: pa CLI does not check if machine is enrolled before attempting to contact IPA server


Version-Release number of selected component (if applicable):
ipa-server-4.5.0-13.el7.x86_64

How reproducible: Always

Steps to Reproduce:
1. Ensure that IPA server is not installed on a system
2. Now try to run the below command.

#ipa trust-add --type=ad ipaad2008r2.test --admin Administrator --password --two-way=True --server=zombie.ipaad2008r2.test


Actual results:
[root@autohv02 ~]# ipa trust-add --type=ad ipaad2008r2.test --admin Administrator --password --two-way=True --server=zombie.ipaad2008r2.test
ipa: ERROR: IOError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ipalib/cli.py", line 1348, in run
    api.finalize()
  File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 714, in finalize
    self.__do_if_not_done('load_plugins')
  File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 421, in __do_if_not_done
    getattr(self, name)()
  File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 592, in load_plugins
    for package in self.packages:
  File "/usr/lib/python2.7/site-packages/ipalib/__init__.py", line 948, in packages
    ipaclient.remote_plugins.get_package(self),
  File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/__init__.py", line 126, in get_package
    plugins = schema.get_package(server_info, client)
  File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/schema.py", line 534, in get_package
    schema = Schema(client)
  File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/schema.py", line 385, in __init__
    fingerprint, ttl = self._fetch(client, ignore_cache=read_failed)
  File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/schema.py", line 409, in _fetch
    schema = client.forward(u'schema', **kwargs)['result']
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1096, in forward
    return self._call_command(command, params)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1077, in _call_command
    return command(*params)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1218, in _call
    return self.__request(name, args)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 1185, in __request
    verbose=self.__verbose >= 3,
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 672, in single_request
    h = self.make_connection(host)
  File "/usr/lib/python2.7/site-packages/ipalib/rpc.py", line 549, in make_connection
    tls_version_max=api.env.tls_version_max)
  File "/usr/lib/python2.7/site-packages/ipalib/util.py", line 322, in create_https_connection
    ctx.load_verify_locations(cafile)
IOError: [Errno 2] No such file or directory
ipa: ERROR: an internal error has occurred

Expected results:
Fix the traceback with proper error message for e.g
"IPA is not configured on the system"


Additional info:

Comment 3 Petr Vobornik 2017-06-09 15:35:52 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7009

Comment 4 fbarreto 2017-06-13 19:03:30 UTC
When I run the command, I'm getting a different error:

[vagrant@localhost rpms]$ ipa trust-add --type=ad ipaad2008r2.test --admin Administrator --password --two-way=True --server=zombie.ipaad2008r2.test
ipa: ERROR: cannot connect to 'http://localhost:8888/ipa/json': [Errno 111] 
Connection refused

[vagrant@localhost ~]$ ipa --version
VERSION: 4.5.1, API_VERSION: 2.224

Sudhir, what do you mean by "Ensure that IPA server is not installed on a system"? It means that the client (or another component) is installed?

Comment 6 Florence Blanc-Renaud 2017-08-08 14:19:09 UTC
This issue is a duplicate of BZ 1368345 https://bugzilla.redhat.com/show_bug.cgi?id=1368345

*** This bug has been marked as a duplicate of bug 1368345 ***


Note You need to log in before you can comment on or make changes to this bug.