Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QA] encryption fails on ubuntu 22.04 #342

Open
jnweiger opened this issue Jun 3, 2022 · 3 comments
Open

[QA] encryption fails on ubuntu 22.04 #342

jnweiger opened this issue Jun 3, 2022 · 3 comments

Comments

@jnweiger
Copy link
Contributor

jnweiger commented Jun 3, 2022

Seen with encryption 1.5.2-rc1 and 1.5.1 and 1.5.0 (not a regression)

On a Ubuntu 22.04 system, php8 is default. We install 7.4 like this:

    LC_ALL=C.UTF-8 add-apt-repository --yes ppa:ondrej/php
    LC_ALL=C.UTF-8 add-apt-repository --yes ppa:ondrej/apache2
    apt update
    apt install -y libapache2-mod-php7.4 php7.4-imagick php7.4-common php7.4-curl php7.4-gd php7.4-imap php7.4-intl
    apt install -y php7.4-ldap php7.4-pgsql php7.4-json php7.4-mbstring php7.4-mysql php7.4-sqlite3 php7.4-ssh2
    apt install -y php7.4-xml php7.4-zip php7.4-apcu php7.4-redis php7.4-gmp
    apt install -y php7.4-bcmath php7.4-igbinary

Note: there is no php7.4-phpseclib package currently available.

After installing owncloud 10.10.0 the following occ commands crash the system:

occ app:enable encryption
occ encryption:enable
occ encryption:select-encryption-type masterkey -y
An unhandled exception has been thrown:
ArgumentCountError: Too few arguments to function OC\Files\Storage\Wrapper\Wrapper::file_put_contents(), 1 passed in /var/www/owncloud/lib/private/Files/View.php on line 1226 and exactly 2 expected in /var/www/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php:259

After that, the system is unusable.

Expected behaviour:

  • owncloud detects the incompatibility early, and does not enable encryption on a system, where preconditions are not met.

See also:

@jnweiger jnweiger mentioned this issue Jun 3, 2022
36 tasks
@mmattel
Copy link
Contributor

mmattel commented Jun 3, 2022

  1. The php-phpseclib not found issue has been fixed, this was a typo adding 7.4 in the name. A background description has been added in the docs-server PR and a note in the public docs below the installation command. See https://doc.owncloud.com/server/10.10/admin_manual/installation/manual_installation/server_prep_ubuntu_22.04.html#clean-ubuntu-22-04-installation

  2. See the IMPORTANT note at the introduction section regarding openSSL https://doc.owncloud.com/server/10.10/admin_manual/installation/manual_installation/server_prep_ubuntu_22.04.html#introduction

@jnweiger
Copy link
Contributor Author

jnweiger commented Jun 5, 2022

We ship 3 copies of the pure php code already with owncloud core:

find . -name phpseclib | xargs du -sh
3.0M	./lib/composer/phpseclib
1.4M	./apps/openidconnect/vendor/phpseclib
3.0M	./apps/files_external/3rdparty/phpseclib

So maybe it is actually harmful to also install a possibly older version from the distribution?

@mmattel
Copy link
Contributor

mmattel commented Jun 5, 2022

See the phpseclib release history: https://github.com/phpseclib/phpseclib/blob/master/CHANGELOG.md

U20.04 phpseclib 2.0.23 (2019-09-16)
U22.04 phpseclib 2.0.36 (2022-01-30)
(https://packages.ubuntu.com/search?keywords=php-phpseclib&searchon=names)

Reading the code, ./lib/composer/phpseclib uses phpseclib3 (at least a v3 version going back to 2020-12-16). With v3 uses namespace changed from phpseclib\ to \phpseclib3

Plus, our sharepoint app needs phpseclib to be installed. This was an issue (PR already merged) I remember hopefully correctly you raised...

This raises following issues:

  • Ubuntu uses different versions we use in core or other apps
  • Seems we already have packaged phpseclib in core, the exact version to be identified, but looks like it is at least a v3 version
  • Some other apps also add phpseclib into their app library, without checking if it is present in core
  • The Sharepoint app needs checking if phpseclib is part of the app library
  • We need to do checking in all apps where phpseclib is needed and if phpseclib can be accessed as part of core, and for development if phpseclib is available in the system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants