Mimetype Warning after upgrading to 28.0.9 or 29.0.5

I tried but it doesn’t work, when I launched the command it gives me this result
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /srv/dockerdata/nextcloud_data/updater/lib/private/DB/Connection.php:233
and the warning still appears… I’m trying to solve

Even on the Docker container version of 30.0.0 this was an issue, maybe it moved over in my instance upgrading from 29.0.6 or the like.

Anyway, adjustingthe RepairMimeType file worked like a charm, after over 14 hours of mimetype repair function being stuck on my server.

Thanks!

Sounds like your command line PHP environment isn’t configured appropriately. Wild guess is that you may have multiple PHP versions installed, so you may need to specify php81 or something along those lines. You may want to created a dedicated thread so to get help with your situation, since it presumably means all occ usage is broken for you.

Try to do Your recommendations and got an error:

sudo -u www-data php occ maintenance:mode --on
rm ./nextcloud.log && rm ./data/nextcloud.log
sudo -u www-data php occ integrity:check-core
sudo -u www-data php occ maintenance:mode --off
[sudo] password for aiplinux:
sudo: php: command not found
rm: cannot remove ‘./nextcloud.log’: No such file or directory
sudo: php: command not found
sudo: php: command not found

What’s wrong?

Can You help - what’s the error?

sudo -u www-data php occ maintenance:repair --include-expensive
sudo: php: command not found

Try this:

type

which php

and hit enter

then enter the whole returned path in the line where you were calling php, eg:

sudo -u www-data /usr/bin/php occ maintenance:repair --include-expensive

samps

aiplinux@dtcsvncloud01:~$ which php
aiplinux@dtcsvncloud01:~$

nothing…

It seems like the mimetype migration is not completing even after running occ maintenance:repair --include-expensive. Here are a few things to check:

  1. Check for Stuck Migrations: Run occ status to see if any migrations are pending.
  2. Database Cleanup: Run occ db:repair and then retry the repair command.
  3. File Permissions: Ensure Nextcloud has the correct permissions to modify files by running sudo -u www-data php occ files:scan --all.
  4. Clear Mimetype Cache: Delete the mimetype cache and rerun the repair command.
  5. Logs: Check nextcloud.log for any specific migration errors.
  6. Compatibility: Verify that your PHP version and Nextcloud version are fully compatible.

If the issue persists, try running the command with --debug for more detailed logs.

That sorta suggests that PHP is not installed, however, I doubt that you’d have gotten this far if that was the case. How about:

sudo which php

If that also returns nothing then try:

sudo apt install php

then try

which php

again …

aiplinux@dtcsvncloud01:~$ sudo which php
/usr/bin/php
aiplinux@dtcsvncloud01:~$ sudo -u www-data /usr/bin/php occ maintenance:repair --include-expensive
Could not open input file: occ

Are you in the folder where Nextcloud is installed?
That is where occ is. If you are trying sudo -u www-data /usr/bin/php occ maintenance:repair --include-expensive from anywhere else, it won’t find it.

How can I find where Nextcloud is installed?

You can search for occ…

@wwwzebra

sudo find / -type f -name “occ”

LOL… I get this error now with a fresh install of 30.0.2. Not even an update.

So not fixed?