#2712 add check for registry entry in pkispawn
Closed: migrated 3 years ago by dmoluguw. Opened 6 years ago by vakwetu.

This resulted froma conversation with a community member who had run into this issue.

Specifically, the community member has attempted to run pkispawn again after an incomplete pkidestroy. The instance directory did not yet exist, but the registry entry under /etc/sysconfig/pki did.

As a result, when trying to create the master dictionary, we call :

compose_pki_master_dictionary , which calls instance.load(), which amongst other things, checks to see if the registry entry exists, and if so, tries to load the CS.cfg for that instance.

Of course at that point, the CS.cfg does not exist yet, and the installer bombs.

File "/usr/sbin/pkispawn", line 820, in <module>
main(sys.argv)
File "/usr/sbin/pkispawn", line 502, in main
create_master_dictionary(parser)
File "/usr/sbin/pkispawn", line 644, in create_master_dictionary
parser.compose_pki_master_dictionary()
File "/usr/lib/python2.7/dist-packages/pki/server/deployment/pkiparser.py", line 615, in compose_pki_master_dictionary
instance.load()
File "/usr/lib/python2.7/dist-packages/pki/server/init.py", line 595, in load
subsystem.load()
File "/usr/lib/python2.7/dist-packages/pki/server/init.py", line 129, in load
lines = open(self.cs_conf).read().splitlines()
IOError: [Errno 2] No such file or directory: '/var/lib/pki/pki-tomcat/ca/conf/CS.cfg'

This is somewhat confusing. One way to fix this would be to check for the registry entry before all this happens. We do check for the existence of the top level instance directory beforehand in the main() function in pkispawn. We could add a check for the registry entry too.

Another would be to refactor the load() function to not read the CS.cfg in this case.


Just as a note, I suspect folks have run into this before, which is why we get bug reports like this:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844119, where the proposed solution is absolutely wrong!

Metadata Update from @vakwetu:
- Custom field component adjusted to General
- Custom field feature adjusted to ''
- Custom field origin adjusted to Community
- Custom field proposedmilestone adjusted to ''
- Custom field proposedpriority adjusted to ''
- Custom field reviewer adjusted to ''
- Custom field type adjusted to defect
- Custom field version adjusted to ''

6 years ago

Metadata Update from @mharmsen:
- Issue assigned to vakwetu
- Issue priority set to: critical
- Issue set to the milestone: 10.4

6 years ago

Metadata Update from @mharmsen:
- Issue priority set to: None (was: critical)
- Issue set to the milestone: 0.0 NEEDS_TRIAGE (was: 10.4)

6 years ago

Metadata Update from @mharmsen:
- Issue priority set to: critical
- Issue set to the milestone: 10.4 (was: 0.0 NEEDS_TRIAGE)

6 years ago

Metadata Update from @mharmsen:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1458010

6 years ago

After discussions with vakwetu and edewata, moving to 10.5.

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.5 (was: 10.4)

6 years ago

The solution isn't as simple as adding a check to pkispawn before the master dictionary is composed. There are cases where the registry and instance should exist beforehand -- like an extrenal CA signing the keys or step 2 of a 2-step install.

Maybe a better fix for this is by creating a pki-nuke script.

Metadata Update from @mharmsen:
- Issue priority set to: major (was: critical)

6 years ago

[20171025] - Offline Triage ==> 10.6

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.6 (was: 10.5)

6 years ago

Per 10.5.x/10.6 Triage: 10.5.x

alee: we've seen this in cases of incomplete install/renewal. fixing this will help in failed installs/cleanups.

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.5 (was: 10.6)

5 years ago

we have a solution that doesn't directly fix this ticket: pkidestroy --force which force removes remnant files of an incomplete installation.

Related Upstream ticket: https://pagure.io/dogtagpki/issue/1172
Related PR [10.5]: https://github.com/dogtagpki/pki/pull/93

This new feature is available in master branch as well.

Can this ticket be considered to be closed?

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/2832

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata Update from @dmoluguw:
- Issue close_status updated to: migrated
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata