nextcloud / nextcloud/user_migration

Export from version 5.0 fails on importing in version 7.0 even success message available

Open
#842 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
30
Forks
10
Avg merge
6h 5m
Merged PRs (30d)
12

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce
  1. Export users on a Nextcloud 28.0 instance (User Migration 5.0)
  2. Transfer file to new Nextcloud 30.0 instance (User Migration 7.0) and start import
  3. Find in the UI a success message BUT in the Nextcloud notification an error message that import failed
Expected behaviour

Import should be possible when exporting.

Actual behaviour

When exporting an account without any data (just calender entries) and importing all works fine.
For an account with approx. 200 MB of data it failes for the above described scenario with the above described error / success messages.

Server configuration

Web server: Apache

Database: MySQL/Maria

PHP version: 8.3

Nextcloud version: export on: 28.0.8 | import on: 30.0.1

Detailled error message in Nextcloud logs
{"reqId":"DLolciUhMsrT9OmUoABN","level":3,"time":"2025-03-01T13:55:01+00:00","remoteAddr":"","user":"--","app":"user_migration","method":"","url":"--","message":"Invalid or uninitialized Zip object","userAgent":"--","version":"30.0.1.2","exception":{"Exception":"ValueError","Message":"Invalid or uninitialized Zip object","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Archive/ZIP.php","line":147,"function":"getFromName","class":"ZipArchive","type":"->"},{"file":"/var/www/nextcloud/apps/user_migration/lib/ImportSource.php","line":56,"function":"getFile","class":"OC\\Archive\\ZIP","type":"->"},{"file":"/var/www/nextcloud/apps/user_migration/lib/ImportSource.php","line":148,"function":"getFileContents","class":"OCA\\UserMigration\\ImportSource","type":"->"},{"file":"/var/www/nextcloud/apps/user_migration/lib/ImportSource.php","line":160,"function":"getMigratorVersions","class":"OCA\\UserMigration\\ImportSource","type":"->"},{"file":"/var/www/nextcloud/lib/public/UserMigration/TMigratorBasicVersionHandling.php","line":36,"function":"getMigratorVersion","class":"OCA\\UserMigration\\ImportSource","type":"->"},{"file":"/var/www/nextcloud/apps/user_migration/lib/Service/UserMigrationService.php","line":234,"function":"canImport","class":"OCA\\UserMigration\\Service\\UserMigrationService","type":"->"},{"file":"/var/www/nextcloud/apps/user_migration/lib/BackgroundJob/UserImportJob.php","line":100,"function":"import","class":"OCA\\UserMigration\\Service\\UserMigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\UserMigration\\BackgroundJob\\UserImportJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":43,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":29,"function":"start","class":"OCP\\BackgroundJob\\QueuedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\QueuedJob","type":"->"}],"File":"/var/www/nextcloud/lib/private/Archive/ZIP.php","Line":147,"message":"Invalid or uninitialized Zip object","exception":[],"CustomMessage":"Invalid or uninitialized Zip object"},"id":"67c316736b4b8"}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/user_migration/lib/ImportSource.php, especially the getFile and getFileContents path, then inspect lib/private/Archive/ZIP.php at the reported getFromName call. Reproduce a migration from Nextcloud 28.0.8 to 30.0.1 using an account with about 200 MB of data and compare the UI success message with the notification error. Done means the import completes without the invalid Zip object error and reports a consistent result.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.