NCP 1.57.x updating NC fails if app previewgenerator is not installed
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in library.sh by reading is_app_enabled, then inspect its call from bin/ncp-update-nc.d/update-nc.sh. Verify that the function checks the app passed to it, especially notify_push, and review the update path for the reported reinstall failure. Done means the check no longer causes an unnecessary notify_push installation when the app is already enabled.
Written by the indexing model from the issue text.
Description
See discussion:
[NCP - Nextcloud Update 33.0.3 fails](https://help.nextcloud.com/t/ncp-nextcloud-update-33-0-3-fails/244550?u=geow)
There user ernolf (Raphael Gradenwitz) finds:
The root cause appears to be a bug in bin/ncp-update-nc.d/update-nc.sh.
The update log shows this sequence after a successful occ upgrade:
There are no commands defined in the "app_api:daemon" namespace.
notify_push already installed
Abort
Clean up...
Here is what actually happens, step by step:
Step 1 — app_api:daemon:list (line 222)
if $ncc app_api:daemon:list | grep 'No registered daemon configs.' > /dev/null 2>&1
then
$ncc app:disable app_api
fi
Since app_api is disabled on your system, the app_api:daemon command namespace does not exist. The error is visible in the log. However, this does not cause the rollback — the failing command is inside an if condition, so bash’s ERR trap does not fire here.
Step 2 — is_app_enabled has a bug (library.sh)
function is_app_enabled()
{
local app="$1"
ncc app:list --output json | jq -r '.enabled | keys | .[]' | grep '^previewgenerator$' > /dev/null 2> /dev/null
}
The $app argument is accepted but never used. The function always checks whether previewgenerator is enabled, regardless of which app is passed.
Step 3 — The broken check causes the install block to be entered
The script calls:
if ! is_app_enabled notify_push; then
ncc app:install notify_push
...
fi
The intent is: “if notify_push is NOT enabled, install it.” But because is_app_enabled always checks for previewgenerator instead, the actual question being answered is: “is previewgenerator enabled?”
previewgenerator is not in your enabled apps list → the function returns false → ! false = true → the install block is entered, even though notify_push is in fact already enabled and installed.
Step 4 — ncc app:install notify_push fails
notify_push is already installed. Nextcloud’s occ app:install exits with a non-zero status when the app is already present, outputting “notify_push already installed”. The script has trap rollback ERR active, so this non-zero exit triggers the rollback function, which prints “Abort\nClean up…”.
In short: The update fails because of a bug in is_app_enabled in library.sh — it always checks for previewgenerator instead of the app passed as argument. This causes a spurious attempt to reinstall notify_push, which fails and triggers the rollback.
This bug was introduced in PR #2100 (“Add support for NC 33 + fixes”), merged 2026-04-03, and is present in v1.57.0 and v1.57.1. That PR also migrated to the upstream previewgenerator — it looks like previewgenerator was temporarily hardcoded for testing during that work and never changed back to $app before the merge. Before PR #2100 the function correctly used $app. This is a regression worth reporting to the NCP maintainers at Issues · nextcloud/nextcloudpi · GitHub — you can reference this post as context.
I should note that I don’t run NCP myself — I derived all of this purely from reading the source code, so I may be wrong on some details. The NCP developers will be able to verify quickly.
As a workaround until it is fixed, you could try enabling previewgenerator before running the update (so the broken check passes), or manually patch library.sh on your NCP system to use $app instead of the hardcoded previewgenerator.
h.t.h.
ernolf
- Dominant language
- Shell
- Stars
- 2.9k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/nextcloudpi
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/nextcloudpi#2129 ·
-
has-updates
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
nextcloud/nextcloudpi#2025 · 1 comment ·
-
has-updates
Difficulty 3/5 1-2 days Newbie friendliness 57/100
nextcloud/nextcloudpi#2142 · 3 comments ·
-
Nextcloud 34 Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
nextcloud/nextcloudpi#2141 · 2 reactions ·
-
Nextcloud 36 Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
nextcloud/nextcloudpi#2140 ·
All issues in nextcloud/nextcloudpi
Similar issues
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·
-
area: compat bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
zenhub-dev
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenLiberty/ci.docker#747 ·