Project

General

Profile

Actions

Bug #22698

open

Rails postinst fails with "can't shift that many" if database isn't ready

Added by Brett Smith 6 days ago.

Status:
In Progress
Priority:
Normal
Assigned To:
Category:
Deployment
Target version:
Story points:
-

Description

$ sudo apt install --no-install-recommends arvados-api-server
[package install blah blah]
Setting up arvados-api-server (3.1.0-1) ...
[gem and Passenger install blah blah]
Creating symlinks to configuration in /etc/arvados/api ...... done.                                                            
Extending systemd unit configuration ...... done.                                                                              
Checking configuration for completeness...
Defaulting to memory cache, because /var/www/arvados-api/current/tmp/cache does not exist                                      
 done.                                                                                                                         
/var/lib/dpkg/info/arvados-api-server.postinst: 79: shift: can't shift that many                                               
dpkg: error processing package arvados-api-server (--configure):                                                               
 installed arvados-api-server package post-installation script subprocess returned error exit status 2                         
Errors were encountered while processing:                                                                                      
 arvados-api-server                                                                                                            
E: Sub-process /usr/bin/dpkg returned an error code (1)                                                                        

This happens in source:build/rails-package-scripts/postinst.sh at the bottom where we say:

elif ! prepare_database; then
    report_not_ready 22 "database setup could not be completed" 

This report_not_ready does not pass a third argument, which is supposed to be optional. report_not_ready is prepared for it to be not set, but then still tries to shift it, which causes the whole script to error exit, and skip the error message we wanted to report.

This is not critical since it "just" means the error reporting doesn't work but obviously it's confusing as heck to the user. We can just delete the shift. I currently have this change in my branch for #22238 but I can spin it out separately if needed.

No data to display

Actions

Also available in: Atom PDF