Bug 1551830 - FreeIPA client fails to fetch vault secrets
Summary: FreeIPA client fails to fetch vault secrets
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: freeipa
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: IPA Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-06 01:16 UTC by Brian J. Atkisson
Modified: 2018-03-18 00:48 UTC (History)
10 users (show)

Fixed In Version: freeipa-4.6.90.pre1-1.fc28
Clone Of:
Environment:
Last Closed: 2018-03-18 00:48:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Brian J. Atkisson 2018-03-06 01:16:22 UTC
Description of problem:
When using the IPA server in RHEL 7, Fedora 27 clients fail to fetch vault secrets

[batkisso@dione tmp]$ ipa vault-retrieve iam-vault --shared --out secret.txt
ipa: ERROR: non-public: TypeError: write() argument must be str, not bytes
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ipalib/backend.py", line 141, in execute
    return self.Command[_name](*args, **options)
  File "/usr/lib/python3.6/site-packages/ipalib/frontend.py", line 450, in __call__
    return self.__do_call(*args, **options)
  File "/usr/lib/python3.6/site-packages/ipalib/frontend.py", line 478, in __do_call
    ret = self.run(*args, **options)
  File "/usr/lib/python3.6/site-packages/ipalib/frontend.py", line 1204, in run
    return self.forward(*args, **options)
  File "/usr/lib/python3.6/site-packages/ipaclient/plugins/vault.py", line 1139, in forward
    f.write(data)
TypeError: write() argument must be str, not bytes
ipa: ERROR: an internal error has occurred


Version-Release number of selected component (if applicable):
freeipa-client-4.6.3-2.fc27.x86_64
freeipa-client-common-4.6.3-2.fc27.noarch
freeipa-common-4.6.3-2.fc27.noarch

server:
ipa-server-4.5.0-22.el7_4.x86_64
ipa-server-dns-4.5.0-22.el7_4.noarch
ipa-common-4.5.0-22.el7_4.noarch
ipa-client-common-4.5.0-22.el7_4.noarch
ipa-client-4.5.0-22.el7_4.x86_64
ipa-server-common-4.5.0-22.el7_4.noarch


This works fine on a RHEL 7.4 client:
[batkisso@aeon tmp]$ ipa vault-retrieve iam-vault --shared --out secret.txt
-------------------------------------
Retrieved data from vault "iam-vault"
-------------------------------------
[batkisso@aeon tmp]$ rpm -qa | egrep '^ipa'
ipa-common-4.5.0-22.el7_4.noarch
ipa-client-common-4.5.0-22.el7_4.noarch
ipa-client-4.5.0-22.el7_4.x86_64

Comment 1 Martin Kosek 2018-03-06 08:05:17 UTC
CCing Standa, looks like some Py2 to Py3 conversion related issue.

Comment 2 Standa Laznicka 2018-03-06 08:34:57 UTC
Thank you Brian for your observation. This is indeed a bug we overlooked during Python 3 migration. See the fix at https://github.com/freeipa/freeipa/pull/1653.

A workaround for this is not to use the "--out" option until the fix lands in Fedora.

Comment 3 Standa Laznicka 2018-03-06 08:42:04 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7430

Comment 4 Standa Laznicka 2018-03-06 12:02:39 UTC
Fixed upstream
master:
https://pagure.io/freeipa/c/c9c41d2d9077202f68c16db53f532da1b7055c10

Comment 5 Tibor Dudlák 2018-03-08 08:01:09 UTC
Fixed upstream
ipa-4-6:
https://pagure.io/freeipa/c/a1472331243a0d614c9647546fabeef2dc8273ff

Comment 6 Fedora Update System 2018-03-16 21:08:45 UTC
freeipa-4.6.90.pre1-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2fd7295cb9

Comment 7 Fedora Update System 2018-03-17 19:29:28 UTC
dogtag-pki-10.6.0-0.2.fc28, dogtag-pki-theme-10.6.0-0.2.fc28, freeipa-4.6.90.pre1-1.fc28, pki-console-10.6.0-0.2.fc28, pki-core-10.6.0-0.2.fc28, tomcat-8.5.29-1.fc28, tomcatjss-7.3.0-0.2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2fd7295cb9

Comment 8 Fedora Update System 2018-03-18 00:48:20 UTC
dogtag-pki-10.6.0-0.2.fc28, dogtag-pki-theme-10.6.0-0.2.fc28, freeipa-4.6.90.pre1-1.fc28, pki-console-10.6.0-0.2.fc28, pki-core-10.6.0-0.2.fc28, tomcat-8.5.29-1.fc28, tomcatjss-7.3.0-0.2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


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