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

[Bug]: Nextcloud 24.0.0, Docker image for aarch64: Warning: require(/var/www/html/3rdparty/composer/../symfony/deprecation-contracts/function.php): Failed to open stream: No such file or directory in /var/www/html/3rdparty/composer/autoload_real.php on line 60 #1744

Closed
4 of 8 tasks
module0x90 opened this issue May 6, 2022 · 12 comments

Comments

@module0x90
Copy link

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

Hi,

since the upgrade to NC 24.0.0 my Docker installation on an RPi4 on aarch64 throwing these errors on cron execution:

Warning: require(/var/www/html/3rdparty/composer/../symfony/deprecation-contracts/function.php): Failed to open stream: No such file or directory in /var/www/html/3rdparty/composer/autoload_real.php on line 60

Fatal error: Uncaught Error: Call to a member function getLogger() on null in /var/www/html/cron.php:189
Stack trace:
#0 {main}
thrown in /var/www/html/cron.php on line 189

When I try to do a "docker-compose exec -u www-data nextcloud php occ" I am getting:

Warning: require(/var/www/html/3rdparty/composer/../symfony/deprecation-contracts/function.php): Failed to open stream: No such file or directory in /var/www/html/3rdparty/composer/autoload_real.php on line 60
An unhandled exception has been thrown:
Error: Failed opening required '/var/www/html/3rdparty/composer/../symfony/deprecation-contracts/function.php' (include_path='/var/www/html/3rdparty/pear/archive_tar:/var/www/html/3rdparty/pear/console_getopt:/var/www/html/3rdparty/pear/pear-core-minimal/src:/var/www/html/3rdparty/pear/pear_exception:/var/www/html/apps:/var/www/html/custom_apps') in /var/www/html/3rdparty/composer/autoload_real.php:60
Stack trace:
#0 /var/www/html/3rdparty/composer/autoload_real.php(43): composerRequire2f23f73bc0cc116b4b1eee1521aa8652('6e3fae29631ef28...', '/var/www/html/3...')
nextcloud/server#1 /var/www/html/3rdparty/autoload.php(12): ComposerAutoloaderInit2f23f73bc0cc116b4b1eee1521aa8652::getLoader()
nextcloud/server#2 /var/www/html/lib/base.php(581): require_once('/var/www/html/3...')
nextcloud/server#3 /var/www/html/lib/base.php(1089): OC::init()
nextcloud/server#4 /var/www/html/console.php(48): require_once('/var/www/html/l...')
nextcloud/server#5 /var/www/html/occ(11): require_once('/var/www/html/c...')

I have deleted the container, forced a re-download - but I am still getting the same error.

Steps to reproduce

  1. docker stop c19cb7c219e0 # stop existing nextcloud container
  2. docker rm c19cb7c219e0 # delete nextcloud container
  3. docker-compose up -d # up it again per recommended docker-compose

Expected behavior

Nextcloud should be running seemlessly as with <24.0.0

Installation method

Official Docker image

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Other

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

docker-compose exec -u www-data nextcloud php occ config:list system

Warning: require(/var/www/html/3rdparty/composer/../symfony/deprecation-contracts/function.php): Failed to open stream: No such file or directory in /var/www/html/3rdparty/composer/autoload_real.php on line 60
An unhandled exception has been thrown:
Error: Failed opening required '/var/www/html/3rdparty/composer/../symfony/deprecation-contracts/function.php' (include_path='/var/www/html/3rdparty/pear/archive_tar:/var/www/html/3rdparty/pear/console_getopt:/var/www/html/3rdparty/pear/pear-core-minimal/src:/var/www/html/3rdparty/pear/pear_exception:/var/www/html/apps:/var/www/html/custom_apps') in /var/www/html/3rdparty/composer/autoload_real.php:60
Stack trace:
#0 /var/www/html/3rdparty/composer/autoload_real.php(43): composerRequire2f23f73bc0cc116b4b1eee1521aa8652('6e3fae29631ef28...', '/var/www/html/3...')
nextcloud/server#1 /var/www/html/3rdparty/autoload.php(12): ComposerAutoloaderInit2f23f73bc0cc116b4b1eee1521aa8652::getLoader()
nextcloud/server#2 /var/www/html/lib/base.php(581): require_once('/var/www/html/3...')
nextcloud/server#3 /var/www/html/lib/base.php(1089): OC::init()
nextcloud/server#4 /var/www/html/console.php(48): require_once('/var/www/html/l...')
nextcloud/server#5 /var/www/html/occ(11): require_once('/var/www/html/c...')

Same output for the other two commands.

List of activated Apps

Same error as above.

Nextcloud Signing status

Nextcloud instance doesn't run and Traefik can't talk to it.

Nextcloud Logs

No response

Additional info

traefik:
depends_on:
- dockerproxy
container_name: traefik
hostname: traefik
image: traefik:latest
restart: always

@szaimen szaimen transferred this issue from nextcloud/server May 6, 2022
@khaytsus
Copy link

khaytsus commented May 8, 2022

This affects x86 as well, ran into it today trying to update, however, mine seemed to be up, not sure which step failed. I manually ran the post-update steps and seems fine for me but the initial update was certainly alarming.

Warning: require(/var/www/html/3rdparty/composer/../symfony/deprecation-contracts/function
.php): Failed to open stream: No such file or directory in /var/www/html/3rdparty/composer
/autoload_real.php on line 60 An unhandled exception has been thrown:
Error: Failed opening required '/var/www/html/3rdparty/composer/../symfony/deprecation-con
tracts/function.php' (include_path='/var/www/html/3rdparty/pear/archive_tar:/var/www/html/
3rdparty/pear/console_getopt:/var/www/html/3rdparty/pear/pear-core-minimal/src:/var/www/ht
ml/3rdparty/pear/pear_exception:/var/www/html/apps:/var/www/html/custom_apps') in /var/www
/html/3rdparty/composer/autoload_real.php:60
Stack trace:
#0 /var/www/html/3rdparty/composer/autoload_real.php(43): composerRequire2f23f73bc0cc116b4
b1eee1521aa8652('6e3fae29631ef28...', '/var/www/html/3...')
#1 /var/www/html/3rdparty/autoload.php(12): ComposerAutoloaderInit2f23f73bc0cc116b4b1eee15
21aa8652::getLoader()
#2 /var/www/html/lib/base.php(581): require_once('/var/www/html/3...') #3 /var/www/html/lib/base.php(1087): OC::init()
#4 /var/www/html/console.php(48): require_once('/var/www/html/l...')
#5 /var/www/html/occ(11): require_once('/var/www/html/c...')
#6 {main}Error: non zero exit code: 1: OCI runtime error

Warning: require(/var/www/html/3rdparty/composer/../symfony/deprecation-contracts/function
.php): Failed to open stream: No such file or directory in /var/www/html/3rdparty/composer
/autoload_real.php on line 60
An unhandled exception has been thrown: Error: Failed opening required '/var/www/html/3rdparty/composer/../symfony/deprecation-con
tracts/function.php' (include_path='/var/www/html/3rdparty/pear/archive_tar:/var/www/html/
3rdparty/pear/console_getopt:/var/www/html/3rdparty/pear/pear-core-minimal/src:/var/www/ht
ml/3rdparty/pear/pear_exception:/var/www/html/apps:/var/www/html/custom_apps') in /var/www
/html/3rdparty/composer/autoload_real.php:60
Stack trace:
#0 /var/www/html/3rdparty/composer/autoload_real.php(43): composerRequire2f23f73bc0cc116b4
b1eee1521aa8652('6e3fae29631ef28...', '/var/www/html/3...')
#1 /var/www/html/3rdparty/autoload.php(12): ComposerAutoloaderInit2f23f73bc0cc116b4b1eee15
21aa8652::getLoader()
#2 /var/www/html/lib/base.php(581): require_once('/var/www/html/3...')
#3 /var/www/html/lib/base.php(1087): OC::init()
#4 /var/www/html/console.php(48): require_once('/var/www/html/l...')
#5 /var/www/html/occ(11): require_once('/var/www/html/c...')
#6 {main}Error: non zero exit code: 1: OCI runtime error

@module0x90
Copy link
Author

Which "post-update steps" are you referring to please? Have you used Docker on x86 or have you tried to upgrade on a 'native' installation?

I would expect when using Docker at least that there are no manual steps required. After all, you should 'just' be able to replace the app container with the next one seemlessly - upgrade steps should be run automatically depending on the version it is upgraded from.

@khaytsus
Copy link

khaytsus commented May 8, 2022

Which "post-update steps" are you referring to please? Have you used Docker on x86 or have you tried to upgrade on a 'native' installation?

Maybe these aren't necessary, but this is what I do after upgrades (in my rebuild script..)

docker="podman"
${docker} exec --user www-data nextcloud php occ upgrade
${docker} exec --user www-data nextcloud php occ db:add-missing-primary-keys
${docker} exec --user www-data nextcloud php occ db:add-missing-indices
${docker} exec --user www-data nextcloud php occ maintenance:mode --off

I will likely add some echo's between each so I can identify what's doing what.

@module0x90
Copy link
Author

I can't even execute any "php occ" command inside the container, it is always showing 'file not found'.

@khaytsus
Copy link

khaytsus commented May 9, 2022

Sorry for polluting this issue then, we're likely not facing the same issue, I was able to restart my container and manually clean up a bit (as in re-run my rebuild script steps manually) and mine is okay.

@module0x90
Copy link
Author

Any thoughts, ideas please?

@khaytsus
Copy link

Any thoughts, ideas please?

I assume you've tried doing a clean rebuild of your container? I assume you have volumes, config etc all external so the container is ephemeral, if it's not then please don't blow away any data ;) But assuming you do, I'd try that if you have not, and if you have tried it and it didn't help, have you tried pulling down the previous version, ie instead of nextcloud:latest try nextcloud:23 or such? I don't know exactly which container you use, but the hub page lists all the available tags.

@module0x90
Copy link
Author

I didn't do a clean rebuild, I always just pulled :latest, on my RPi4.

I basically followed https://hub.docker.com/_/nextcloud#running-this-image-with-docker-compose, with the only addition
of fronting it with Traefik (I had other services running there, too, and Traefik was easier to configure with multiple entrypoints).
External volumes and whatnot, yes.

I am using nextcloud:latest.
Consider it is really broken right now, I guess I could go back to previous version. I suspect that the DB upgrade didn't happen anyway due to the errors. Still got to disable my automatic container update script to pull latest. Which is a shame.

@module0x90
Copy link
Author

I have no idea how to fix this thing.
I went back to tag production-apache, then tag 23. Same error with all of them.

I haven't touched anything there. When the container was updated it all fell apart. Could well be gone in ages and as it wasn't restarted I never noticed.

@module0x90
Copy link
Author

"symfony/deprecation-contracts" is referenced in

3rdparty/composer/autoload_static.php
3rdparty/composer/autoload_files.php
3rdparty/composer/installed.php
3rdparty/composer/installed.json
3rdparty/egulias/email-validator/composer.lock
3rdparty/composer.lock
apps/nextcloud_announcements/composer.lock
apps/logreader/composer.lock
apps/support/composer.lock
apps/activity/composer.lock
apps/photos/composer.lock
apps/recommendations/composer.lock
apps/circles/composer.lock
apps/password_policy/composer.lock
apps/notifications/composer.lock
apps/text/composer.lock

but there isn't a 3rdparty/symfony/deprecation-contracts/ at all on my volume for /var/www/html/.

@rovo89
Copy link

rovo89 commented May 11, 2022

I had the same issue yesterday. Here's what I did:

  1. Had the image running via Docker Compose. No "user" directive, so it was running as "root" user.
  2. Switched to the latest NC24 image, it detected that an upgrade was needed.
  3. Upgrade failed with something like "su: php not found". Seems to come from this:
    su -p www-data -s /bin/sh -c "$1"

    Looks fine, but /usr/local/bin isn't in $PATH after the su.
  4. Worked around the issue by restarting the container with user: www-data:www-data. Upgrade started, but was somehow stuck waiting for /var/www/html/nextcloud-init-sync.lock. I assume this was a left-over from the previous failed attempt.
  5. Deleted the lock file and restarted the container. Upgrade still showed the warning, but finished successfully.
  6. Restarted the container without the "user" option to avoid warnings from php-fpm about some settings being ignored.
  7. Was able to access the frontend again.
  8. Ran occ db:add-missing-indices to finalize the upgrade.

@module0x90
Copy link
Author

module0x90 commented May 11, 2022

@rovo89: You're my Nextcloud-saver! Thanks!

I noticed that I did had a nextcloud-init-sync.lock file yesterday. So I basically did your steps from the 5th one onwards.

The underlaying reason in my case was that the SD card in my RPi 4B is a 'slow' one - Samsung Evo. It's known to be 'slow' with RPis: https://forums.raspberrypi.com/viewtopic.php?t=308428.

The upgrade process doesn't copy the data, but it updates Nextcloud itself from /usr/src/nextcloud/ and that's "only" 405MB in size. Enough to have the rsync running for quite a while (like 10 minutes!) due to the slow SD card.

I have ordered just a few days ago faster SD cards. Nextcloud is then one of many RPis to benefit from them.

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

No branches or pull requests

3 participants