Server has no maintenance window start time configured

I wrote a small bash script that sets the parameter based on the local time of your server. Maybe it is of any help:

#!/bin/bash
#
# Set the local time when you want the maintenance window to start:
# (Only use full hours in 24hrs (HH:MM) formating) e.g. "00:00" "01:00" "02:00" etc...)
#
TIME="01:00"
#
# Set the path where your Nextcloud is installed:
#
NCPATH="/var/www/nextcloud"
#
# Set the web server user:
#
WWWUSER="www-data"
#
# DO NOT CHANGE ANYTHING BELOW THIS LINE!
#
LOCALSTARTTIME=$(date -d "$TIME" +%s)
UTCSTARTTIME=$(date -u -d "@$LOCALSTARTTIME" "+%-H")
sudo -u $WWWUSER php $NCPATH/occ config:system:set maintenance_window_start --value="$UTCSTARTTIME" --type=integer
exit 0

This may be of interest to those of you who, like me, don’t want to set a time window at all. So all tasks should be able to be started at any time.
In order for the message to disappear anyway, you have to deactivate the time window with the value 100:

  'maintenance_window_start' => 100,

ernolf

4 Likes

Good to know, and thanks for sharing. :slight_smile:

Is this documented somewhere, or how did you find out?

Documented here:

… and since it only checks IF it is set to any value at all to supress the warning:

Find out here, that you can deactivate the time window with any value greater than 23:

:wink:


ernolf

2 Likes

Ah yes, the config.sample.php file, I should have thought of that myself :wink:

Thanks :slight_smile:

EDIT: In the meantime it’s also in the docs: Configuration Parameters — Nextcloud latest Administration Manual latest documentation

Or maybe it has been since the feature was introduced, and I didn’t find it? Never mind. It’s in there now. :wink:

for me the documentation link for this new warning entry pointed to the entirely outdated /15/ with no mention at all of maintenance_window_start.

I took the above and tweaked it so it works on FreeBSD:

cd /usr/local/www/nextcloud
su -m www -c "php ./occ config:system:set maintenance_window_start --value=1 --type=integer"

Running that, I got the following in green:
System config value maintenance_window_start set to integer 1

And the error message went away. I didn’t even have to restart Apache or reboot :+1:

EDIT: @ernolf Thanks for the additional info! I’ve now changed my choice to 100 :slight_smile:

NCmaintenanceWindow

1 Like

The documentation did actually address the Maintenance Window Start for me, but really poorly:

Wouldn’t it have been nice if it actually gave useful information instead of telling us to manually edit the config.php without an example or an explanation of the options!

I would have loved to have been given the occ command, or the explanation about using 100 to disable it and the warning.

1 Like

Do you have an old custom theme still active? That’s the only scenario I’m aware of that happening - because the theme overrides the default URL.

To be fair, the OCC command for setting configuration options is already documented here, and the configuration parameter itself is documnted here, the same way as any other configuration parameter.

But I agree, if there is an extra section on maintenance that the warning in the overview is pointing to, it would be useful to explain it in more detail there, or at least include links to the sections describing the “occ config” command and the “maintenance-window-start” option.

2 Likes

Done (well, PR is pending[1]).

There’s an Edit button in the upper right if you ever feel like proposing adjustments. Alternatively can create an issue the Documentation repository[2]. :slight_smile:

[1] fix(background_jobs_configuration) Add example by joshtrichards · Pull Request #11497 · nextcloud/documentation · GitHub
[2] GitHub - nextcloud/documentation: 📘 Nextcloud documentation

3 Likes

yes, that’s what happened. interesting choice to have the theme overwrite that… anyway, thank you!

1 Like

I think the idea is for branded deployments with their own non-Nextcloud provided docs.

To be fair, your first link doesn’t actually reference the maintenance window start at all, and the second is not discoverable unless you already know what to search for.

The link in the UI is useless. It’s terrible. I’d be lost without this forum and the input of people like you!

I’m on FreeBSD, we have some of the best documentation in the OSS world. You can tell the NC devs are primarily linux users :stuck_out_tongue:

Thanks, I might do that later :slight_smile:

EDIT:

Sorry, you’re not able to edit this repository directly—you need to fork it and propose your changes from there instead.

Uh, meh. Maybe I won’t.

The truth is that there is a snap version that is installed in my server, but I dont use it at all. I’d like to believe that everything is configured to point my live installation.

this fix worked for me as well i’m on 28.0.2

Funny but this worked with value “100”. Seems for some reason that value “1” can’t be parsed.

Thank you

It has been updated, an example and more detailed explanations have been added: Background jobs — Nextcloud latest Administration Manual latest documentation

2 Likes

Not sure why it doesn’t work for for you. I did multiple test installations using a value of “1” and never saw the warning.