[Solved] Upgrade to 17.01 failed with GenerateMimetypeFileBuilder::generateFile() must be of the type array, null given

I have had nextcloud running for quite a while now, with all updates working like a charm. This upgrade was the first to fail, I started it via the web backend, but now running a shell to see whats happening:

php7.3 occ -vvv upgrade
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
2019-11-18T17:46:05+00:00 Set log level to debug
2019-11-18T17:46:05+00:00 Repair step: Repair MySQL collation
2019-11-18T17:46:05+00:00 Repair info: All tables already have the correct collation -> nothing to do
2019-11-18T17:46:05+00:00 Repair step: Repair SQLite autoincrement
2019-11-18T17:46:05+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2019-11-18T17:46:05+00:00 Repair step: Drop account terms table when migrating from ownCloud
2019-11-18T17:46:05+00:00 Updating database schema
2019-11-18T17:46:05+00:00 Updated database
2019-11-18T17:46:06+00:00 Checking for update of app accessibility in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "accessibility" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app activity in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "activity" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app calendar in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "calendar" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app carnet in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "carnet" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app cloud_federation_api in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "cloud_federation_api" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app comments in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "comments" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app contacts in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "contacts" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app dav in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "dav" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app federatedfilesharing in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "federatedfilesharing" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app federation in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "federation" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app files in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "files" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app files_pdfviewer in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "files_pdfviewer" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app files_rightclick in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "files_rightclick" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app files_sharing in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "files_sharing" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app files_trashbin in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "files_trashbin" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app files_versions in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "files_versions" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app files_videoplayer in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "files_videoplayer" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app firstrunwizard in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "firstrunwizard" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app gallery in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "gallery" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app logreader in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "logreader" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app lookup_server_connector in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "lookup_server_connector" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app maps in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "maps" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app nextcloud_announcements in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "nextcloud_announcements" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app notes in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "notes" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app notifications in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "notifications" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app oauth2 in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "oauth2" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app password_policy in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "password_policy" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app privacy in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "privacy" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app provisioning_api in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "provisioning_api" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app rainloop in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "rainloop" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app recommendations in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "recommendations" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app serverinfo in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "serverinfo" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app sharebymail in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "sharebymail" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app support in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "support" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app survey_client in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "survey_client" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app systemtags in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "systemtags" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app text in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "text" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app theming in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "theming" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app twofactor_backupcodes in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "twofactor_backupcodes" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app twofactor_u2f in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "twofactor_u2f" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app updatenotification in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "updatenotification" in appstore
2019-11-18T17:46:06+00:00 Checking for update of app workflowengine in appstore
2019-11-18T17:46:06+00:00 Checked for update of app "workflowengine" in appstore
2019-11-18T17:46:06+00:00 Repair step: Repair MySQL collation
2019-11-18T17:46:06+00:00 Repair info: All tables already have the correct collation -> nothing to do
2019-11-18T17:46:06+00:00 Repair step: Repair mime types
2019-11-18T17:46:06+00:00 Repair step: Clean tags and favorites
2019-11-18T17:46:06+00:00 Repair info: 0 tags of deleted users have been removed.
2019-11-18T17:46:06+00:00 Repair info: 0 tags for delete files have been removed.
2019-11-18T17:46:06+00:00 Repair info: 0 tag entries for deleted tags have been removed.
2019-11-18T17:46:06+00:00 Repair info: 0 tags with no entries have been removed.
2019-11-18T17:46:06+00:00 Repair step: Repair invalid shares
2019-11-18T17:46:06+00:00 Repair step: Move .step file of updater to backup location
2019-11-18T17:46:06+00:00 Repair step: Fix potential broken mount points
2019-11-18T17:46:06+00:00 Repair info: No mounts updated
2019-11-18T17:46:06+00:00 Repair step: Add log rotate job
2019-11-18T17:46:06+00:00 Repair step: Clear frontend caches
2019-11-18T17:46:06+00:00 Repair info: Image cache cleared
2019-11-18T17:46:06+00:00 Repair info: SCSS cache cleared
2019-11-18T17:46:06+00:00 Repair info: JS cache cleared
2019-11-18T17:46:06+00:00 Repair step: Clear every generated avatar on major updates
2019-11-18T17:46:06+00:00 Repair step: Add preview background cleanup job
2019-11-18T17:46:06+00:00 Repair step: Queue a one-time job to cleanup old backups of the updater
2019-11-18T17:46:06+00:00 Repair step: Cleanup invalid photocache files for carddav
2019-11-18T17:46:06+00:00 Repair step: Add background job to cleanup login flow v2 tokens
2019-11-18T17:46:06+00:00 Repair step: Remove potentially over exposing share links
2019-11-18T15:10:38+00:00 Repair info: No need to remove link shares.
2019-11-18T15:10:38+00:00 Repair step: Clear access cache of projects
2019-11-18T15:10:38+00:00 Repair step: Cleanup cypress files from viewer app
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\Core\Command\Maintenance\Mimetype\GenerateMimetypeFileBuilder::generateFile() must be of the type array, null given, called in /home/www/cloud/lib/private/IntegrityCheck/Checker.php on line 205 and defined in /home/www/cloud/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php:33
Stack trace:
#0 /home/www/cloud/lib/private/IntegrityCheck/Checker.php(205): OC\Core\Command\Maintenance\Mimetype\GenerateMimetypeFileBuilder->generateFile(NULL)
#1 /home/www/cloud/lib/private/IntegrityCheck/Checker.php(374): OC\IntegrityCheck\Checker->generateHashes(Object(RecursiveIteratorIterator), '/home/www/cloud...')
#2 /home/www/cloud/lib/private/IntegrityCheck/Checker.php(554): OC\IntegrityCheck\Checker->verify('/home/www/cloud...', '/home/www/cloud...', 'core')
#3 /home/www/cloud/lib/private/IntegrityCheck/Checker.php(575): OC\IntegrityCheck\Checker->verifyCoreSignature()
#4 /home/www/cloud/lib/private/Repair/NC16/RemoveCypressFiles.php(80): OC\IntegrityCheck\Checker->runInstanceVerification()
#5 /home/www/cloud/lib/private/Repair.php(101): OC\Repair\NC16\RemoveCypressFiles->run(Object(OC\Repair))
#6 /home/www/cloud/lib/private/Updater.php(273): OC\Repair->run()
#7 /home/www/cloud/lib/private/Updater.php(128): OC\Updater->doUpgrade('17.0.1.1', '16.0.6.1')
#8 /home/www/cloud/core/Command/Upgrade.php(258): OC\Updater->upgrade()
#9 /home/www/cloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /home/www/cloud/3rdparty/symfony/console/Application.php(908): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /home/www/cloud/3rdparty/symfony/console/Application.php(269): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /home/www/cloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /home/www/cloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /home/www/cloud/console.php(97): OC\Console\Application->run()
#15 /home/www/cloud/occ(11): require_once('/home/www/cloud...')
#16 {main}

obviously the first thing I tried was to recreate the mimetypes, but to no avial.
and

php7.3 occ -V
The current PHP memory limit is below the recommended value of 512MB.
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Nextcloud 17.0.1

Anything else unusual? I had yubikey two-factor turned on, but that’s been one update ago, because that app wasn’t developed anymore.

So, please help?

1 Like

I tried to deactivate some apps, but that doesn’t help.

I would really, really appreciate any help.

And what about this?
Edit your php*.ini to manage memory_limit at 512M and after retry your upgrade.

2 Likes

That is not something my hoster allows me to do. [UPDATE: I asked their support, lets see if it works. Still don’t think that’s the reason, its a very small instance, just for my family.]

Its set to 256MB and I can’t change that.

php7.3 occ maintenance:mimetype:update-js
throws the same error by the way, which makes it (in my optinion) very unlikely to be an memory problem.

cat mimetypealiases.json
#{
        "_comment" : "Array of mimetype aliases.",
        "_comment2": "Any changes you make here will be overwritten on an update                           of Nextcloud.",
        "_comment3": "Put any custom mappings in a new file mimetypealiases.json                           in the config/ folder of Nextcloud",

        "_comment4": "After any change to mimetypealiases.json run:",
        "_comment5": "./occ maintenance:mimetype:update-js",
        "_comment6": "Otherwise your update won't propagate through the system."                          ,
}

Is this a normal content for this file?

@Aelethian: You can check the normal content of the file in the source repository: https://github.com/nextcloud/server/blob/master/resources/config/mimetypealiases.dist.json
You probably need to resolve the memory issue anyway. As far as I know even a small instance can peak at certain moments. I recommend a virtual host or a docker container instead of shared hosting. Shared hosting is not suitable for a “production” nextcloud deployment, even if it’s just your family.

1 Like

Thank you. I replaced the file, but that wasn’t the problem.

I kind of lack the monies at this point to upgrade my hosting solution, but thank’s anyway!

I downloaded the whole nextcloud code, untared and wrote it over the existing files. Then the update process went without a hitch. As far as I can tell the automated download of the files did’nt work well. updater.phar was obviously not able to notice that it once failed, I ran that script several times without any error message.

The memory limit, btw, had nothing to do with the error. On the other hand, my hoster increased the memory limit, and that’s nice.

Thanks for the help, guys!

1 Like