nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.89k stars 4.02k forks source link

Unable to install app: Error: Could not extract app #20342

Closed alex9434 closed 4 years ago

alex9434 commented 4 years ago

How to use GitHub

Steps to reproduce

  1. sudo -u www-data -g www-data php -d memory_limit=-1 /usr/local/share/nextcloud/occ -vvv app:install calendar (or any other app)
  2. Error message: Error: Could not extract app calendar (or any other app)

Expected behaviour

App installed

Actual behaviour

Error message

Server configuration

Operating system: Debian Stretch Web server: Nxinx 1.10.3 Database: postgresql 9.6 PHP version: 7.3 Nextcloud version: (see Nextcloud admin page) 18.0.3 Updated from an older Nextcloud/ownCloud or fresh install: Updated from 18.0.1 (originally from 17.0.0) Where did you install Nextcloud from: Command line updater Signing status:

Signing status ``` Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed paste the results here. No errors have been found.

List of activated apps:

App list ``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your Nextcloud installation folder Enabled: - accessibility: 1.4.0 - activity: 2.11.0 - bookmarks: 2.3.4 - cloud_federation_api: 1.1.0 - comments: 1.8.0 - dav: 1.14.0 - deck: 0.8.0 - federatedfilesharing: 1.8.0 - federation: 1.8.0 - files: 1.13.1 - files_pdfviewer: 1.7.0 - files_rightclick: 0.15.2 - files_sharing: 1.10.1 - files_trashbin: 1.8.0 - files_versions: 1.11.0 - files_videoplayer: 1.7.0 - firstrunwizard: 2.7.0 - logreader: 2.3.0 - lookup_server_connector: 1.6.0 - nextcloud_announcements: 1.7.0 - notes: 3.2.0 - notifications: 2.6.0 - oauth2: 1.6.0 - onlyoffice: 4.1.4 - password_policy: 1.8.0 - passwords: 2020.4.0 - photos: 1.0.0 - privacy: 1.2.0 - provisioning_api: 1.8.0 - recommendations: 0.6.0 - registration: 0.4.7 - serverinfo: 1.8.0 - settings: 1.0.0 - sharebymail: 1.8.0 - support: 1.1.0 - survey_client: 1.6.0 - systemtags: 1.8.0 - text: 2.0.0 - theming: 1.9.0 - twofactor_backupcodes: 1.7.0 - updatenotification: 1.8.0 - viewer: 1.2.0 - workflowengine: 2.0.0 Disabled: - admin_audit - encryption - files_ebookreader - files_external - user_ldap

Nextcloud configuration:

Config report { "system": { "debug": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "intra.anzald.com", "cf.wiegand.biz", "nextcloud.lan" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "pgsql", "version": "18.0.3.0", "overwrite.cli.url": "http:\/\/nextcloud.lan\/nextcloud", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "remember_login_cookie_lifetime": 2678400, "knowledgebaseenabled": true, "appstoreenabled": true, "apps_paths": [ { "path": "\/usr\/local\/share\/nextcloud\/apps", "url": "\/apps", "writable": false }, { "path": "\/usr\/local\/share\/nextcloud\/apps2", "url": "\/apps2", "writable": true } ], "filelocking.enabled": true, "memcache.locking": "\\OC\\Memcache\\Redis", "memcache.distributed": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 6379, "timeout": 1.5 }, "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "2525", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "theme": "", "loglevel": 0, "maintenance": false, "app_install_overwrite": [ "files_ebookreader" ], "updater.secret": "***REMOVED SENSITIVE VALUE***" } }

Are you using external storage, if yes which one: local/smb/sftp/... no Are you using encryption: yes/no no Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... no

LDAP configuration (delete this part if not used)

LDAP config ``` With access to your command line run e.g.: sudo -u www-data php occ ldap:show-config from within your Nextcloud installation folder Without access to your command line download the data/owncloud.db to your local computer or access your SQL server remotely and run the select query: SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap'; Eventually replace sensitive data as the name/IP-address of your LDAP server or groups. ```

Client configuration

Browser: N/A Operating system: N/A

Logs

Web server error log

Web server error log ``` Insert your webserver log here ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` Insert your Nextcloud log here ```

Browser log

Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
kesselb commented 4 years ago

Duplicate of #19674

alex9434 commented 4 years ago

Hello @kesselb, the referenced issue #19674 has been closed by you without an actual solution. The user has just been told to install the app manually. This is not a satisfactory solution, because it would require MANUALLY updating all apps individually. Because of this bug the automatic update is broken.

kesselb commented 4 years ago

19674 is still open? I closed this report as duplicate. It's not necessary to have multiple issues for the same problem and also does not speed up resolution. Please use the search before creating a new issue the next time.

caos30 commented 3 years ago

I have same problem with News app. Ubuntu 20.04, Nextcloud 20.0.6

The PHP error is always the same:

Invalid argument supplied for foreach() at /home/myuser/web/nextcloud.mydomain.com/public_html/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#158

On the line of that file the foreach() is applied on a supposed array of network interfaces file-settings retrieved a couple of lines above with:

public function getNetworkInterfaces() {
                $interfaces = glob('/sys/class/net/*');
                $result = [];

                foreach ($interfaces as $interface) {

I suspect that it could be a problem of "user/group permissions" to access to that /sys/class/net content files... but i unkonw why this was no problem with previous versions of Nextcloud. I've Nextcloud 18.X installed on another VPS with less permissions and it not seems to be a problem.

Indeed, another clue: when i go to Settings > System it seems that the PHP script cannot get information neither about RAM and obviously about network interfaces (appears in blank that section).

Please, some kind of help to users like me less experts in the deeps of the linux sysadmin? I understand that if there is a problem of permissions to access RAM/networks interfaces of the server then it is not possible to shown in System section. But it should NOT imply a PROBLEM TO INSTALL/UPDATE an app, it should?

i'm suggesting that probably there is an unnecessary call to the method ->getNetworkInterfaces() when installing/updating an app. Certainly i have been able to install apps (like calendar, for example) without this problem, in the same Nextcloud instance and server, the same day. So, i conclude that some apps are requesting this "network interfaces" info without needing it.

Thanks in advance!

alex9434 commented 3 years ago

I did a re-install of Nextcloud and now the problem seems to be gone.