Project

General

Profile

Actions

Bug #22698

closed

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

Added by Brett Smith 28 days ago. Updated 19 days ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Deployment
Target version:
Story points:
-
Release relationship:
Auto

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.

Actions #1

Updated by Peter Amstutz 21 days ago

  • Target version changed from Development 2025-04-02 to Development 2025-04-16
Actions #2

Updated by Brett Smith 20 days ago

  • Release set to 77
Actions #3

Updated by Brett Smith 20 days ago

I will split this out for the 3.1.1 release.

Actions #4

Updated by Brett Smith 20 days ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF