App updates broken? Or maybe it’s just me

Nextcloud: 12.0.5
CentOS: 7.4.1708
Apache: 2.4.6
PHP: 7.1.11

The issue you are facing:

I had some troubles updating from 12.0.4, but managed to solve them by running chmod g+w on config, config.php, and apps. However, app updates appear to be broken, and I’m wondering if it’s a permissions issue. Updating an app via the web interface shows 'success’ in the JSON response (and so the button disappears), but the app doesn’t actually get updated. Refreshing the page shows the previous version, and allows me to update again.

This is this the first time I’ve seen this error.

Steps to replicate it:

  1. Go to Apps
  2. Click Update to v.v.v

Admin > Logging

The logs do not show anything new when an app is ‘updated’.

Config

$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'cloud.domain.tld',
  ),
  'datadirectory' => '/var/props/cloud/data',
  'overwrite.cli.url' => 'https://cloud.domain.tld',
  'dbtype' => 'mysql',
  'version' => '12.0.5.3',
  'dbname' => 'ncloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_xxx',
  'dbpassword' => 'xxx',
  'logtimezone' => 'UTC',
  'installed' => true,
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'smtp',
  'mail_domain' => 'domain.tld',
  'htaccess.RewriteBase' => '/',
  'appstore.experimental.enabled' => true,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'smtp.office365.com',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpsecure' => 'tls',
  'mail_smtpname' => 'cloud@domain.tld',
  'mail_smtppassword' => 'xxx',
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'loglevel' => 0,
  'theme' => '',
  'updater.release.channel' => 'stable',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'updater.secret' => ‘xxx',
);

Error logs

Nothing in the error logs relating to any NC execution.

Hi,

I haven’t heard of such an issue so far, so not a general issue I’d say.
Can you check again:

  • the permissions and ownership of apps and their files in the apps folder
  • other logs (web server logs and system logs) just to make sure that there is no other issue causing this

Hi, thanks for the quick revert.

Here are the permissions:

ls -lah
total 256K
drwxrwx--- 61 apache apache 4.0K Jan 28 09:04 .
drwxr-x--- 14 apache apache 4.0K Jan 28 09:04 ..
drwxr-xr-x 10 apache apache 4.0K Jan 28 09:04 activity
drwxr-xr-x  4 apache apache 4.0K Jan 28 09:04 admin_audit
drwxr-x---  5 apache apache 4.0K Mar  6  2017 admin_notifications
drwxr-x---  9 apache apache 4.0K Jun 14  2017 announcementcenter
drwxr-x---  8 apache apache 4.0K Aug 29 20:06 apporder
drwxr-x---  9 apache apache 4.0K Aug 13 17:29 bookmarks
drwxr-x---  9 apache apache 4.0K Jan 15 19:45 bruteforcesettings
drwxr-x--- 11 apache apache 4.0K Aug 29 20:09 calendar
drwxr-x---  6 apache apache 4.0K Aug 13 17:29 checksum
drwxr-xr-x  8 apache apache 4.0K Jan 28 09:04 comments
drwxr-x---  9 apache apache 4.0K Jan 15 19:46 contacts
drwxr-xr-x  7 apache apache 4.0K Jan 28 09:04 dav
drwxr-x---  9 apache apache 4.0K Jan 15 19:46 deck
drwxr-x--- 10 apache apache 4.0K Aug 29 20:08 drawio
drwxr-xr-x 10 apache apache 4.0K Jan 28 09:04 encryption
drwxr-x---  9 apache apache 4.0K Jun 14  2017 external
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 federatedfilesharing
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 federation
drwxr-xr-x 10 apache apache 4.0K Jan 28 09:04 files
drwxr-x---  7 apache apache 4.0K Jan 15 19:46 files_accesscontrol
drwxr-x---  7 apache apache 4.0K Jun 14  2017 files_automatedtagging
drwxr-x---  6 apache apache 4.0K Jun 14  2017 files_downloadactivity
drwxr-xr-x 11 apache apache 4.0K Jan 28 09:04 files_external
drwxr-x---  6 apache apache 4.0K Sep 20 17:30 files_markdown
drwxr-xr-x 10 apache apache 4.0K Jan 28 09:04 files_pdfviewer
drwxr-xr-x  8 apache apache 4.0K Jan 28 09:04 files_reader
drwxr-x---  9 apache apache 4.0K Jun 14  2017 files_retention
drwxr-xr-x 10 apache apache 4.0K Jan 28 09:04 files_sharing
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 files_texteditor
drwxr-xr-x 10 apache apache 4.0K Jan 28 09:04 files_trashbin
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 files_versions
drwxr-xr-x  7 apache apache 4.0K Jan 28 09:04 files_videoplayer
drwxr-xr-x 10 apache apache 4.0K Jan 28 09:04 firstrunwizard
drwxr-xr-x 13 apache apache 4.0K Jan 28 09:04 gallery
drwxr-x--- 10 apache apache 4.0K Aug 29 20:08 groupfolders
drwxr-x---  8 apache apache 4.0K Aug 29 20:10 impersonate
drwxr-x---  9 apache apache 4.0K Aug 29 20:11 keeweb
drwxr-xr-x 13 apache apache 4.0K Jan 28 09:04 logreader
drwxr-xr-x  4 apache apache 4.0K Jan 28 09:04 lookup_server_connector
drwxr-x--- 23 apache apache 4.0K Aug 29 20:09 music
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 nextcloud_announcements
-rw-r-----  1 apache apache 8.3K Jun 20  2017 nextcloud-sharerenamer-master.zip
drwxr-x--- 11 apache apache 4.0K Jan 15 19:46 notes
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 notifications
drwxr-xr-x  8 apache apache 4.0K Jan 28 09:04 oauth2
drwxr-xr-x 11 apache apache 4.0K Jan 28 09:04 password_policy
drwxr-xr-x  5 apache apache 4.0K Jan 28 09:04 provisioning_api
drwxr-x---  9 apache apache 4.0K Jan 15 19:46 quota_warning
drwxr-xr-x 10 apache apache 4.0K Jan 28 09:04 serverinfo
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 sharebymail
drwxr-x---  8 apache apache 4.0K Jun 14  2017 sharerenamer
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 survey_client
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 systemtags
drwxr-x--- 10 apache apache 4.0K Aug 29 20:10 tasks
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 theming
drwxr-xr-x  9 apache apache 4.0K Jan 28 09:04 twofactor_backupcodes
drwxr-xr-x  8 apache apache 4.0K Jan 28 09:04 updatenotification
drwxr-xr-x  5 apache apache 4.0K Jan 28 09:04 user_external
drwxr-xr-x 11 apache apache 4.0K Jan 28 09:04 user_ldap
drwxr-xr-x  8 apache apache 4.0K Jan 28 09:04 workflowengine

Does that look correct?

I’ve double-checked the logs – nothing of significance there.

Hi,

Yes, looking good so far. Can you move nextcloud-sharerenamer-master.zip out of the app folder? Not sure if this may cause issues, but it doesn’t belong there anyway :wink:
The permission differ however and I’m wondering which apps don’t update and if others do. If some do, it would be interesting to compare that with the different permissions.

Furthermore, could you pick on app, that doesn’t update and check the output of
ls -laR
on that app folder? For example, if the app contacts doesn’t update:
ls -laR /var/www/nextcloud/apps/contacts

Yeah, I just left that there after installing the NC version of it from GH. Didn’t have issues with that before the update, though.

All app updates do the same thing, whether or not they are enabled. They may differ due to the chmod command I ran to get the update working.

ls for impersonate:

ls -laR impersonate
impersonate:
total 76
drwxr-x---  8 apache apache  4096 Aug 29 20:10 .
drwxrwx--- 61 apache apache  4096 Jan 28 09:04 ..
drwxr-x---  2 apache apache  4096 Aug 29 20:10 appinfo
-rw-r-----  1 apache apache   221 Aug 29 20:10 CHANGELOG.md
-rw-r-----  1 apache apache 34519 Aug 29 20:10 COPYING
drwxr-x---  2 apache apache  4096 Aug 29 20:10 css
-rw-r-----  1 apache apache  3350 Aug 29 20:10 .drone.yml
drwxr-x---  2 apache apache  4096 Aug 29 20:10 img
drwxr-x---  2 apache apache  4096 Aug 29 20:10 js
drwxr-x---  3 apache apache  4096 Aug 29 20:10 lib
drwxr-x---  2 apache apache  4096 Aug 29 20:10 screenshots

impersonate/appinfo:
total 20
drwxr-x--- 2 apache apache 4096 Aug 29 20:10 .
drwxr-x--- 8 apache apache 4096 Aug 29 20:10 ..
-rw-r----- 1 apache apache  659 Aug 29 20:10 app.php
-rw-r----- 1 apache apache 1839 Aug 29 20:10 info.xml
-rw-r----- 1 apache apache  649 Aug 29 20:10 routes.php

impersonate/css:
total 8
drwxr-x--- 2 apache apache 4096 Aug 29 20:10 .
drwxr-x--- 8 apache apache 4096 Aug 29 20:10 ..
-rw-r----- 1 apache apache    0 Aug 29 20:10 settings-admin.css

impersonate/img:
total 12
drwxr-x--- 2 apache apache 4096 Aug 29 20:10 .
drwxr-x--- 8 apache apache 4096 Aug 29 20:10 ..
-rw-r----- 1 apache apache 1449 Aug 29 20:10 app.svg

impersonate/js:
total 16
drwxr-x--- 2 apache apache 4096 Aug 29 20:10 .
drwxr-x--- 8 apache apache 4096 Aug 29 20:10 ..
-rw-r----- 1 apache apache 1260 Aug 29 20:10 impersonate.js
-rw-r----- 1 apache apache  722 Aug 29 20:10 impersonate_logout.js

impersonate/lib:
total 12
drwxr-x--- 3 apache apache 4096 Aug 29 20:10 .
drwxr-x--- 8 apache apache 4096 Aug 29 20:10 ..
drwxr-x--- 2 apache apache 4096 Aug 29 20:10 Controller

impersonate/lib/Controller:
total 16
drwxr-x--- 2 apache apache 4096 Aug 29 20:10 .
drwxr-x--- 3 apache apache 4096 Aug 29 20:10 ..
-rw-r----- 1 apache apache 1655 Aug 29 20:10 LogoutController.php
-rw-r----- 1 apache apache 2101 Aug 29 20:10 SettingsController.php

impersonate/screenshots:
total 220
drwxr-x--- 2 apache apache  4096 Aug 29 20:10 .
drwxr-x--- 8 apache apache  4096 Aug 29 20:10 ..
-rw-r----- 1 apache apache 65296 Aug 29 20:10 1.png
-rw-r----- 1 apache apache 80020 Aug 29 20:10 2.png
-rw-r----- 1 apache apache 69380 Aug 29 20:10 3.png

Dang! What’s going on here? So many strange issues with the latest update with no obvious root cause.

Okay, let’s try a few things:

  • check the logs for messages related to any \OC\Memcache\APCu problems
  • as the admin on the NC web GUI in the Apps section
    1. do a full reload of the site (CTRL + R)
    2. update the app
    3. do full reload again (CTRL + R)
    4. check if app has new version now

  • make sure that ‘loglevel’ => 0, is still set in your config/config.php
  • run following commands on your nextcloud folder (correct the path if it differs on your server):
    chown -R apache:apache /var/www/nextcloud/
    find /var/www/nextcloud/ -type f -print0 | xargs -0 chmod 0666
    find /var/www/nextcloud/ -type d -print0 | xargs -0 chmod 0777
  • check if one app can be updated successfully
  • if that update was successful, run:
    find /var/www/nextcloud/ -type f -print0 | xargs -0 chmod 0640
    find /var/www/nextcloud/ -type d -print0 | xargs -0 chmod 0750
  • update another app and see if it still works
  • if updates didn’t work check /var/props/cloud/data/nextcloud.log for some messages that might indicate an issue

Still nothing working? Have you tried a reboot of the server?
Is
journalctl -xe
giving some output that points us into the right direction? If your server doesn’t log to a journal, maybe it is /var/log/messages where you can check for output. Could be possible that you don’t need to look for Nextcloud messages/ errors necessarily but for all messages that are related to Apache, Apache modules, PHP, memcache, redis (you don’t use redis actually, do you?).

I’m running out of ideas if we don’t find something with the steps above. The only one left is the russian method: hit the server with a hammer once or twice :stuck_out_tongue:

Hmm, I see there are APCu logs…

Memcache \OC\Memcache\APCu not available for local cache
Memcache \OC\Memcache\APCu not available for distributed cache

Could that be the root cause?

Going to give the 0666/0777 a shot in a bit. If that fails, I’ll have a look at messages (didn’t actually look at that before; not sure if it exists…)

What surprises me the most is that the updater returns a green light… This means that it’s not doing any verification checks, which I think should be looked into.

I believe it is possible, that the failing Memcache might be the root cause. Can still be something else though, but I think you should fix that anyway.
However I really hope that the problem will be solved by fixing this.