nextcloud / nextcloud/nextcloudpi

ncp-notify-unattended-upgrade issues wrong notifications

Open
#1,454 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Shell
Stars
2.9k
Forks
318
PR merge metrics
No merged PRs in 30d

Description

Executing the command sudo ncp-notify-unattended-upgrade always returns the same packages that seem to have automatically been updated in addition to an error message sed: can't read LOGFILE: No such file or directory on the latest nextcloudpi image from March 2022.

simon@RaspberryServer:~ $ sudo ncp-notify-unattended-upgrade
sed: can't read LOGFILE: No such file or directory
Packages automatically upgraded: apache2 apache2-bin apache2-data apache2-utils base-files bind9-dnsutils bind9-host bind9-libs dirmngr dnsutils galera-4 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv libarchive13 libcryptsetup12 libexpat1 libflac8 libmariadb3 libpam-systemd libsasl2-2 libsasl2-modules libsasl2-modules-db libssl1.1 libsystemd0 libtiff5 libudev1 libxml2 mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common mariadb-server mariadb-server-10.5 mariadb-server-core-10.5 openssl systemd systemd-sysv systemd-timesyncd sysvinit-utils tasksel tasksel-data udev zlib1g zlib1g-dev

Somehow I found the file /usr/local/bin/ncp-notify-unattended-upgrade and looked into it. I noticed the line sed -i 's|INFO Packages that will be upgraded:|INFO Packages that will be upgraded :|' \LOGFILE' is causing the issue. sed cannot find the log file thus it does not mark the packages as already read and always returns them along with the error message.

Changing it to sed -i 's|INFO Packages that will be upgraded:|INFO Packages that will be upgraded :|' $LOGFILE fixes the issue.

I don't know where the file /usr/local/bin/ncp-notify-unattended-upgrade results from because failed to find it inside the nextcloudpi repository. The only reference to the broken line that I found is this.

PS: I know it does not belong here but since this is about the unattended upgrades: Only my admin user is notified about the upgrades but no other user belonging to the group admin. Why is this? With earlier versions, all users were upgraded.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bin/ncp/UPDATES/nc-notify-updates.sh and compare it with the installed /usr/local/bin/ncp-notify-unattended-upgrade script. Run ncp-notify-unattended-upgrade to reproduce the sed error, then verify that the log is updated and already reported packages are not repeatedly listed.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.