Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fails when trying to stop Ombi #25

Closed
didyouexpectthat opened this issue Mar 9, 2018 · 8 comments
Closed

Update fails when trying to stop Ombi #25

didyouexpectthat opened this issue Mar 9, 2018 · 8 comments
Assignees

Comments

@didyouexpectthat
Copy link
Contributor

First Checks:

Replace the check box for each line with a ☑ or 'x' after confirming.
x I am running the most recent version of the script.
x I have followed the setup instructions correctly.
x I have set the appropriate file permissions and modes.
x I am running the script as the correct user.

Update Script Version

1.1.02

Ombi Version:

3.0.2973

Operating System:

Linux 4.9.0-0.bpo.5-amd64 #1 SMP Debian 4.9.65-3+deb9u2~bpo8+1 (2017-01-05) x86_64 GNU/Linux

Custom Configuration: (update_ombi.conf)

defaultuser="ombi"
defaultgroup="ombi"
defaultport="5001"
verbosity=7
defaultinstalldir=/opt/ombi

Update Script Applicable Logs: (/var/log/ombiupdater.log by default)

[2018-03-09 01:54:05 UTC] [info] Script config file found...parsing...
[2018-03-09 01:54:05 UTC] [info] Parsed config file
[2018-03-09 01:54:05 UTC] [info] update_ombi v1.1.02
[2018-03-09 01:54:05 UTC] [info] Verbosity level: [debug]
[2018-03-09 01:54:05 UTC] [debug] Update script running as: root
[2018-03-09 01:54:05 UTC] [notice] InstallDir not parsed...setting to default: /opt/ombi
[2018-03-09 01:54:05 UTC] [notice] User not parsed...setting to default: ombi
[2018-03-09 01:54:05 UTC] [notice] Group not parsed...setting to default: ombi
[2018-03-09 01:54:05 UTC] [notice] IP not parsed or set as "*"...setting to default: 127.0.0.1
[2018-03-09 01:54:05 UTC] [notice] Port not parsed...setting to default: 5001
[2018-03-09 01:54:05 UTC] [info] Downloading Ombi update...
[2018-03-09 01:54:05 UTC] [info] Checking for latest version
[2018-03-09 01:54:13 UTC] [debug] latestversion: 3.0.2989
[2018-03-09 01:54:14 UTC] [debug] jobId: 6kb4x4eep3t59mth
[2018-03-09 01:54:14 UTC] [debug] version: 3.0.2989
[2018-03-09 01:54:14 UTC] [info] Latest version: 3.0.2989...determining expected file size...
[2018-03-09 01:54:14 UTC] [debug] size: 47317277
[2018-03-09 01:54:14 UTC] [info] Expected file size: 47317277...downloading...
[2018-03-09 01:54:25 UTC] [info] Version 3.0.2989 downloaded...checking file size...
[2018-03-09 01:54:25 UTC] [info] File size validated...checking Ombi service status...
[2018-03-09 01:54:25 UTC] [info] Ombi is active...attempting to stop...
[2018-03-09 01:54:25 UTC] [alert] Unknown error...bailing!
[2018-03-09 01:59:34 UTC] [info] Script config file found...parsing...
[2018-03-09 01:59:34 UTC] [info] Parsed config file
[2018-03-09 01:59:34 UTC] [info] update_ombi v1.1.02
[2018-03-09 01:59:34 UTC] [info] Verbosity level: [debug]
[2018-03-09 01:59:34 UTC] [debug] Update script running as: root
[2018-03-09 01:59:34 UTC] [notice] InstallDir not parsed...setting to default: /opt/ombi
[2018-03-09 01:59:34 UTC] [notice] User not parsed...setting to default: ombi
[2018-03-09 01:59:34 UTC] [notice] Group not parsed...setting to default: ombi
[2018-03-09 01:59:34 UTC] [notice] IP not parsed or set as "*"...setting to default: 127.0.0.1
[2018-03-09 01:59:34 UTC] [notice] Port not parsed...setting to default: 5001
[2018-03-09 01:59:34 UTC] [info] Downloading Ombi update...
[2018-03-09 01:59:34 UTC] [info] Checking for latest version
[2018-03-09 01:59:35 UTC] [debug] latestversion: 3.0.2989
[2018-03-09 01:59:35 UTC] [debug] jobId: 6kb4x4eep3t59mth
[2018-03-09 01:59:35 UTC] [debug] version: 3.0.2989
[2018-03-09 01:59:35 UTC] [info] Latest version: 3.0.2989...determining expected file size...
[2018-03-09 01:59:36 UTC] [debug] size: 47317277
[2018-03-09 01:59:36 UTC] [info] Expected file size: 47317277...downloading...
[2018-03-09 01:59:48 UTC] [info] Version 3.0.2989 downloaded...checking file size...
[2018-03-09 01:59:48 UTC] [info] File size validated...checking Ombi service status...
[2018-03-09 01:59:48 UTC] [info] Ombi is not active...installing update...
[2018-03-09 01:59:50 UTC] [info] Update installed...setting ownership...
[2018-03-09 01:59:50 UTC] [info] Ownership set...not starting Ombi
[2018-03-09 01:59:50 UTC] [info] Cleaning up...
[2018-03-09 01:59:50 UTC] [info] Update complete...elapsed time 16 seconds...

Problem Description:

When running update_ombi, it goes to shut down Ombi via systemd then says an unknown error and bailing.

Initial Troubleshooting:

Not sure why systemd returning unknown here.

++ date '+%Y-%m-%d %H:%M:%S %Z' -u
+ echo '[2018-03-09 02:04:36 UTC] [info]' 'File size validated...checking Ombi service status...'
+ declare -i running=0
++ systemctl is-active ombi
+ '[' active == active ']'
+ running=1
+ .log 6 'Ombi is active...attempting to stop...'
+ local LEVEL=6
+ shift
+ [[ 7 =~ ^-?[0-8]$ ]]
+ '[' 7 -ge 6 ']'
++ date +%H:%M:%S
+ echo '[18:04:36] [info]' 'Ombi is active...attempting to stop...'
[18:04:36] [info] Ombi is active...attempting to stop...
+ '[' 7 -eq 8 ']'
+ '[' 6 -ne 8 ']'
++ date '+%Y-%m-%d %H:%M:%S %Z' -u
+ echo '[2018-03-09 02:04:36 UTC] [info]' 'Ombi is active...attempting to stop...'
+ declare -i i=1
+ declare -i j=5
+ '[' 1 -le 5 ']'
+ '[' root = root ']'
+ systemctl stop ombi.service
+ '[' 0 -ne 0 ']'
++ systemctl is-active ombi
+ '[' unknown == active ']'
++ systemctl is-active ombi
+ '[' unknown == inactive ']'
+ .log 1 'Unknown error...bailing!'
+ local LEVEL=1
+ shift
+ [[ 7 =~ ^-?[0-8]$ ]]
+ '[' 7 -ge 1 ']'
++ date +%H:%M:%S
+ echo '[18:04:36] [alert]' 'Unknown error...bailing!'
[18:04:36] [alert] Unknown error...bailing!
+ '[' 7 -eq 8 ']'
+ '[' 1 -ne 8 ']'
++ date '+%Y-%m-%d %H:%M:%S %Z' -u
+ echo '[2018-03-09 02:04:36 UTC] [alert]' 'Unknown error...bailing!'
+ exit 99

Reproduction Steps:

Simply run update_ombi with Ombi started.

Additional Detail:

systemd version 215-17+deb8u7

@Unimatrix0
Copy link
Owner

What happens when you (as root) run systemctl stop ombi.service followed by systemctl is-active ombi?

@didyouexpectthat
Copy link
Contributor Author

Same, it says unknown

@Unimatrix0
Copy link
Owner

That sounds more like a systemd problem than a script problem. Should systemctl ever be returning unknown?

@Unimatrix0 Unimatrix0 self-assigned this Mar 14, 2018
@Unimatrix0 Unimatrix0 added the bug label Mar 14, 2018
@Unimatrix0
Copy link
Owner

Unimatrix0 commented Mar 14, 2018

Per https://bugzilla.redhat.com/show_bug.cgi?id=1264727, this may be caused by not rebooting after a systemd upgrade.

@Unimatrix0
Copy link
Owner

@didyouexpectthat Can you also tell me the output of systemctl show ombi.service -p ActiveState?

@didyouexpectthat
Copy link
Contributor Author

didyouexpectthat commented Mar 28, 2018

Hi,
Sorry for my delay in returning to this bug. Had a few minutes to play around with it.
Not sure exactly where the problem was at.
I rebooted 10 days ago and it persisted.
I tried to make changes to my systemd service file to see if that would help (I was missing Type) but didn't seem to be problematic.

root@hosting:/opt/update_ombi# systemctl show ombi -p ActiveState
ActiveState=inactive

I believe this happened after I tried to decommission this server. I used systemctl disable ombi to disable the process from booting automatically if the server ever restarted. From that time I believe I have been unable to properly get the status when it is inactive. Once I used systemctl enable ombi to make it start again (because I have not fully migrated my servers), then I was able to use systemctl is-active ombi properly.

root@hosting:/opt/update_ombi# systemctl is-active ombi
active
root@hosting:/opt/update_ombi# systemctl show ombi -p ActiveState
ActiveState=active

And the upgrade was okay.

root@hosting:/opt/update_ombi# bash /opt//update_ombi/update_ombi.sh
[13:25:08] [info] Script config file found...parsing...
[13:25:08] [info] Parsed config file
[13:25:08] [info] update_ombi v1.3.00
[13:25:08] [info] Verbosity level: [debug]
[13:25:08] [debug] Update script running as: root
[13:25:08] [info] Ombi service file for systemd found...parsing...
[13:25:08] [info] Parsing complete: InstallDir: /opt/ombi/, User: ombi, Group: ombi, Port: 5001
[13:25:08] [notice] IP not parsed or set as "*"...setting to default: 127.0.0.1
[13:25:08] [info] Downloading Ombi update...
[13:25:08] [info] Checking for latest version
[13:25:11] [debug] latestversion: 3.0.3115
[13:25:13] [debug] jobId: ef6k02n8ju0ysx88
[13:25:13] [debug] version: 3.0.3115
[13:25:13] [info] Latest version: 3.0.3115...determining expected file size...
[13:25:13] [debug] size: 47410378
[13:25:13] [info] Expected file size: 47410378...downloading...
/tmp/tmp.7K3bhi80nx/ombi_3.0.3115.tar.gz                            100%[====================================================================================================================================================================>]  45.21M  6.73MB/s   in 5.7s
[13:25:20] [info] Version 3.0.3115 downloaded...checking file size...
[13:25:20] [info] File size validated...checking Ombi service status...
[13:25:20] [info] Ombi is active...attempting to stop...
[13:25:20] [info] Ombi stopped...installing update...
[13:25:20] [info] Backing up Ombi.db to Ombi.db.1522268720
[13:25:22] [info] Update installed...setting ownership...
[13:25:22] [info] Ownership set...starting Ombi...
[13:25:22] [info] Ombi started...waiting for confirmation...
[13:25:27] [warning] Ombi startup not confirmed...waiting 5 seconds...[attempt 1 of 5]
[13:25:42] [info] Ombi startup confirmed...cleaning up...
[13:25:42] [info] Cleaning up...
[13:25:42] [info] Update complete...elapsed time 34 seconds...

So this is still systemd weirdness. the -p ActiveState seems to be more reliable though.

@Unimatrix0
Copy link
Owner

Has this problem recurred since then?
If not, I'm going to close this bug report.

@didyouexpectthat
Copy link
Contributor Author

No, I haven't seen this one come back. I'll close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants