Skip to content

Log the output of 'occ maintenance:mode --off' if it fails - #617

Merged
Altahrim merged 2 commits into
masterfrom
enh/noid/log-occ-maintenance-off-output
Oct 24, 2025
Merged

Log the output of 'occ maintenance:mode --off' if it fails#617
Altahrim merged 2 commits into
masterfrom
enh/noid/log-occ-maintenance-off-output

Conversation

@julien-nc

Copy link
Copy Markdown
Member

If the return code of occ maintenance:mode --off is not 0, we might be interested in the command output.

We can backport this to 31, 30 and 29.

@julien-nc

Copy link
Copy Markdown
MemberAuthor

It turns out that system just returns what's written in stdout, not stderr (what we are mostly interested in).
How about switching to something like https://www.php.net/manual/fr/function.system.php#94929 ?

@come-nc

Copy link
Copy Markdown
Collaborator

Yeah, do we have a helper somewhere for that?

@skjnldsv

Copy link
Copy Markdown
Member

Any news @julien-nc ? :)

@julien-nc

Copy link
Copy Markdown
MemberAuthor

@skjnldsv No news. If you and @come-nc are ok with using proc_open() instead of system() to be able to get stderr, I might implement it soon-ish.

@julien-nc
julien-ncforce-pushed the enh/noid/log-occ-maintenance-off-output branch from d671ab5 to 48f413aCompareAugust 25, 2025 13:46
@julien-nc

Copy link
Copy Markdown
MemberAuthor

@skjnldsv@come-nc It now uses proc_open and prints stderr or stdout if they are not empty when the command fails.

@julien-nc
julien-ncforce-pushed the enh/noid/log-occ-maintenance-off-output branch from 2092392 to 1a365e2CompareAugust 25, 2025 15:44
@skjnldsv

Copy link
Copy Markdown
Member

you also need make index.php

@julien-nc

Copy link
Copy Markdown
MemberAuthor

@skjnldsv It does not make any change to index.php if I run make index.php.

@come-nc

Copy link
Copy Markdown
Collaborator

The failure comes from the changes in vendor I think.
Probably you use a different version of composer.

…mand if it fails
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc
julien-ncforce-pushed the enh/noid/log-occ-maintenance-off-output branch from 1a365e2 to 4b1318eCompareSeptember 25, 2025 12:06
@come-nc
come-ncforce-pushed the enh/noid/log-occ-maintenance-off-output branch from e61eef3 to bcdb6a9CompareSeptember 26, 2025 09:42
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc
come-ncforce-pushed the enh/noid/log-occ-maintenance-off-output branch from bcdb6a9 to f183e46CompareSeptember 26, 2025 09:47
@Altahrim
Altahrim merged commit e5d4471 into masterOct 24, 2025
22 checks passed
@Altahrim
Altahrim deleted the enh/noid/log-occ-maintenance-off-output branch October 24, 2025 11:13
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@julien-nc@come-nc@skjnldsv@Altahrim@anthraxNICK94