Hide Forgot
Description of problem: If the tfm-rubygem-fusor_server package is updated on the fusor server while Satellite services are stopped, the postinstall rpm script throws some ugly ruby traceback output: **** # yum update tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch.rpm Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager Examining tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch.rpm: tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch Marking tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch.rpm as an update to tfm-rubygem-fusor_server-1.1.5-1.el7sat.noarch Resolving Dependencies --> Running transaction check ---> Package tfm-rubygem-fusor_server.noarch 0:1.1.5-1.el7sat will be updated ---> Package tfm-rubygem-fusor_server.noarch 0:1.1.7-1.el7sat will be an update --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================================== Updating: tfm-rubygem-fusor_server noarch 1.1.7-1.el7sat /tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch 750 k Transaction Summary ====================================================================================================================================================== Upgrade 1 Package Total size: 750 k Is this ok [y/d/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch 1/2 rake aborted! PG::Error: 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"? /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `initialize' [...] /opt/rh/rh-ror41/root/usr/share/gems/gems/railties-4.1.5/lib/rails/application.rb:379:in `block in run_tasks_blocks' Tasks: TOP => db:migrate => environment (See full trace by running task with --trace) warning: %post(tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch) scriptlet failed, exit status 1 Non-fatal POSTIN scriptlet failure in rpm package tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch Cleanup : tfm-rubygem-fusor_server-1.1.5-1.el7sat.noarch 2/2 Verifying : tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch 1/2 Verifying : tfm-rubygem-fusor_server-1.1.5-1.el7sat.noarch 2/2 Updated: tfm-rubygem-fusor_server.noarch 0:1.1.7-1.el7sat Complete! **** Version-Release number of selected component (if applicable): tfm-rubygem-fusor_server-1.1.7-1.el7sat.noarch.rpm How reproducible: 100% Steps to Reproduce: 1.) Update a fusor server from tfm-rubygem-fusor_server-1.1.5-1.el7sat to tfm-rubygem-fusor_server-1.1.7-1.el7sat. Actual results: Error output during yum/rpm update. Expected results: No error output. Additional info: tfm-rubygem-fusor_server calls foreman-rake db:migrate, regardless of whether the foreman db is running: # rpm -q --scripts tfm-rubygem-fusor_server postinstall scriptlet (using /bin/sh): if [ "$1" = "2" ]; then foreman-rake db:migrate fi At the very least, it should log the error output to /var/log/foreman/db_migrate.log, like the foreman rpm's script does: # rpm -q --scripts foreman postinstall scriptlet (using /bin/sh): [...] /sbin/chkconfig --add foreman || : (/sbin/service foreman status && /sbin/service foreman restart) >/dev/null 2>&1 exit 0 posttrans scriptlet (using /bin/sh): # We need to run the db:migrate after the install transaction # always attempt to reencrypt after update in case new fields can be encrypted /usr/sbin/foreman-rake db:migrate db:encrypt_all >> /var/log/foreman/db_migrate.log 2>&1 || : /usr/sbin/foreman-rake db:seed >> /var/log/foreman/db_seed.log 2>&1 || : /usr/sbin/foreman-rake apipie:cache:index >> /var/log/foreman/apipie_cache.log 2>&1 || : (/sbin/service foreman status && /sbin/service foreman restart) >/dev/null 2>&1 exit 0
The following Sat6 BZ is also relevant. At some point foreman-rake commands will probably be moved out of rpm %post scripts. Bug 1383530 - [upgrades] database migration and seed operation in %post section of RPM causes multiple hour yum updates https://bugzilla.redhat.com/show_bug.cgi?id=1383530
Plan is to remove the actual migration from the rpm post, but we want to display a warning message to the user that they should run "fusor-installer --upgrade"
https://github.com/fusor/fusor/pull/1298
Verified by inspection of RPM tfm-rubygem-fusor_server in compose: QCI-1.1-RHEL-7-20161212.t.2
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2017:0335