running engine-setup against postgresql running on non-default port

Hi, I'm running Linux From Scratch and I'm compiling ovirt from source. It all builds and installs fine. However, since I may sometimes run engine-setup from within a chroot on a host that already runs ovirt-engine and postgresql on port 5432, I would like to be able to start a new instance of postgresql on port 55555 inside the chroot, run engine-setup within the same chroot, tell it to connect to postgresql on port 55555, then once set up, I would like to manually change all config files and change postgresql port from 55555 to 5432, so when I transfer this installation to a different computer postgresql will run on 5432 and ovirt-engine (and all the other components) will know to use port 5432. Trouble is, this is easier said than done. Even when I tell engine-setup to connect to 55555 something insists on connecting to 5432: [ INFO ] Installing PostgreSQL uuid-ossp extension into database [ ERROR ] Failed to execute stage 'Misc configuration': could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? I've manually changed all the ovirt-engine and ovirt-engine-dwh files that contained 5432, to no avail. Ideas? Thanks, IvanK.

On Sun, Feb 24, 2019 at 5:48 PM <ivan.kabaivanov@gmail.com> wrote:
Hi,
I'm running Linux From Scratch and I'm compiling ovirt from source. It all builds and installs fine. However, since I may sometimes run engine-setup from within a chroot on a host that already runs ovirt-engine and postgresql on port 5432, I would like to be able to start a new instance of postgresql on port 55555 inside the chroot, run engine-setup within the same chroot, tell it to connect to postgresql on port 55555, then once set up, I would like to manually change all config files and change postgresql port from 55555 to 5432, so when I transfer this installation to a different computer postgresql will run on 5432 and ovirt-engine (and all the other components) will know to use port 5432.
Trouble is, this is easier said than done. Even when I tell engine-setup to connect to 55555 something insists on connecting to 5432:
[ INFO ] Installing PostgreSQL uuid-ossp extension into database [ ERROR ] Failed to execute stage 'Misc configuration': could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
You have ran into a known bug, which is not documented anywhere except for comments in the code, so I do not provide a link to a bug. Feel free to report it if you want. The bug is in the case of 'Local' database and 'Manual' provisioning. In this case (which is what you want to do), database hostname is 'localhost'. Elsewhere in the code, in more than one place, we have heuristics that say that if database hostname is 'localhost', we "own" it, and can do admin stuff on it. This includes the above uuid-ossp extension. A trivial workaround, which might be also what we'll eventually decide to suggest even if you open a bug, is to not provide 'localhost', but a different name or IP address that points at the local machine. If you do not want to rely on a particular IP address, you can even add to the '127.0.0.1' line in /etc/hosts another name (e.g. 'localpg' or whatever) and use that - the check is purely textual. If you want, you can search the code for all occurrences of "'localhost'". You'll get a few "false positives", but this will be a good start. One reason this isn't easy to fix is that we do not save anywhere, after engine-setup finished, the answer to the question "Automatically provision pg?". So a later run has no-way to know if it's 'localhost' and 'Automatic' or 'localhost' and 'Manual'. Since almost all users use 'Automatic', and among those that use 'Manual' almost all use also 'Remote', very few actually run into the bug, like you. To fix it we need to save the answer (easy), but also consider what to do if we do not (yet) have it, as we only _ask_ it during initial setup, not upgrade. So a theoretical fix can be to proactively ask on upgrade "DB host is 'localhost', was it automatically provisioned by Setup in the past?". Since this is so ugly that no-one will ever want it, we'll probably have to use something else, e.g. allow a user (like you) to set in some conf file somewhere 'db is manually provisioned, do not touch it'.
I've manually changed all the ovirt-engine and ovirt-engine-dwh files that contained 5432, to no avail.
Ideas?
Thanks, IvanK. _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/YMMUX63N6D4WLB...
-- Didi

Thanks for the tip, it worked! As soon as I replaced localhost with the FQDN of the host, it just worked. Thanks! IvanK.

On Mon, Feb 25, 2019 at 8:19 PM <ivan.kabaivanov@gmail.com> wrote:
Thanks for the tip, it worked! As soon as I replaced localhost with the FQDN of the host, it just worked.
Thanks for the report! Now filed [1], ~5 years too late, but hopefully better late than never... [1] https://bugzilla.redhat.com/show_bug.cgi?id=1683126
Thanks! IvanK. _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/VMMDEUSTRH2RL6...
-- Didi
participants (2)
-
ivan.kabaivanov@gmail.com
-
Yedidyah Bar David