Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

After mitigating the root cause of the unsuccessful installation attempt (#5657), it still fails to install with the following error:

root@poc-cfengine-test:/var/log# tail -n2 CFEngine-Install.log
+ cp -a /var/cfengine/state/pg/backup/data/pg_*.conf /var/cfengine/state/pg/data/
cp: cannot stat '/var/cfengine/state/pg/backup/data/pg_*.conf': No such file or directory
root@poc-cfengine-test:/var/log#
root@poc-cfengine-test:/var/log# ls -l /var/cfengine/state/pg/
total 4
drwx------ 19 cfpostgres root 4096 Dec  9 11:12 data
root@poc-cfengine-test:/var/log# 
You must be logged in to vote

Replies: 6 comments · 5 replies

Comment options

Sadly I have not been able to reproduce the original issue during installation so not sure what state your system was in when you tried to install again.

I wonder if you have all of the /var/log/CFEngine-Install*log files? If so, please attach them to this ticket: https://northerntech.atlassian.net/browse/CFE-4474

You must be logged in to vote
2 replies
@0lmi
Comment options

@craigcomstock unfortunately I don't have permissions to update the ticket, so, let me just post the logs here instead.

Initial install:

$ hostname
test-poc-cfengine
$ hostname -d
hppzr1wrhp0ednbudbgifmw05c.oslx.internal.cloudapp.net
$ sudo dpkg -i cfengine-nova-hub_3.24.1-1.ubuntu24_amd64.deb 
Selecting previously unselected package cfengine-nova-hub.
(Reading database ... 67379 files and directories currently installed.)
Preparing to unpack cfengine-nova-hub_3.24.1-1.ubuntu24_amd64.deb ...
Unpacking cfengine-nova-hub (3.24.1-1.ubuntu24) ...
Setting up cfengine-nova-hub (3.24.1-1.ubuntu24) ...
dpkg: error processing package cfengine-nova-hub (--install):
 installed cfengine-nova-hub package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 cfengine-nova-hub
$ 

Related logs:
CFEngine-Install-2024-12-15_18:14:23_UTC.log.gz
CFEngine-Install-2024-12-15_18:12:20_UTC.log.gz

Second install:

$ sudo hostnamectl hostname hub
$ hostname
hub
$ hostname -d
$ echo $?
0
$ sudo dpkg -i cfengine-nova-hub_3.24.1-1.ubuntu24_amd64.deb 
(Reading database ... 139375 files and directories currently installed.)
Preparing to unpack cfengine-nova-hub_3.24.1-1.ubuntu24_amd64.deb ...
A previous version of CFEngine Mission Portal was found,
creating a backup of it at /tmp/cfengine-htdocs.tar.gz
Purging old version from /var/cfengine/httpd/htdocs
Keeping only what's listed in preserve_during_upgrade.txt file
Unpacking cfengine-nova-hub (3.24.1-1.ubuntu24) over (3.24.1-1.ubuntu24) ...
Setting up cfengine-nova-hub (3.24.1-1.ubuntu24) ...
cfapache folder already exists, deleting it
dpkg: error processing package cfengine-nova-hub (--install):
 installed cfengine-nova-hub package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 cfengine-nova-hub
$ 

Related logs:
CFEngine-Install-2024-12-15_18:25:39_UTC.log.gz
CFEngine-Install-2024-12-15_18:23:02_UTC.log.gz

@craigcomstock
Comment options

Very good. Thanks for the logs. I will take a look now.

Comment options

I would say the most reasonable answer to this is that if the package fails to install and you fix something environmental to workaround that, you should fully uninstall/cleanup before attempting again.

Sadly, on debian-based distributions an apt remove doesn't remove things quite fully enough at this time so additional steps are needed:

sudo rm -rf /var/cfengine /opt/cfengine

I will look some more to see if there is something we can realistically do to workaround this specific upgrade from a failed install failure.

Thanks again for the reports!

You must be logged in to vote
0 replies
Comment options

I see that the second install failure is due to the previous install failing part-way through. There isn't much more we can do with this scenario.

I did add some bits to the scriptlets to fail BEFORE we unpack the contents of the package in the case that the FQDN/short-name is too long for a cert to be created. So that should avoid this problem of an unfinished previous install.

Let us know if this seems a reasonable conclusion.

You must be logged in to vote
0 replies
Comment options

I can imagine that cleanup process on a physical service (not a VM in a cloud, which can be re-created fast) could be quite time-consuming if original package manager fails. It's hard to say how to address it in the best way... Perhaps prompting the user for input or at least providing some cleanup hints might be helpful?

You must be logged in to vote
1 reply
@craigcomstock
Comment options

I am pretty sure that apt remove cfengine-nova-hub after the first failure would work as well as it does in a normal case, which sad to say, isn't SO well. I logged a ticket a while back, ENT-12386 (yes, private so not visible to you), to improve this situation if possible.

I will look at the ticket for this, CFE-4474, and see if we can improve things a bit!

Comment options

To have a clean install I can think of the following things off the top of my head (only the first three are really necessary):

  • remove package
  • rm -rf /var/cfengine
  • rm -rf /opt/cfengine
  • rm /var/log/CFEngine*
  • rm /var/log/postgresql*
You must be logged in to vote
1 reply
@craigcomstock
Comment options

On debian-based distros especially there are also some bits left in /etc I think, maybe systemd units and/or init scripts.

We have a few tickets related to this discussion and will work on them as we can.

Thanks again @0lmi for your report!

Comment options

Just a remark. Debian/Ubuntu has two removal options. the remove keeps the configuration files. There is also an purge option that wll remove also the configuration files and directories

You must be logged in to vote
1 reply
@craigcomstock
Comment options

Ah, right. I don't often get into the details too much as it usually doesn't matter much. I will add this to the ticket we have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.