Hi, I’m getting this error in my laravel.log while trying to migrate my data.
production.ERROR: Call to a member function isValid() on null {“userId”:1,“exception”:"[object] (Error(code: 0): Call to a member function isValid() on null at /home/myserveruser/public_html/invoiceninja/app/Http/Controllers/MigrationController.php:211)
After submitting the form on v4, I get : “Migration has started. We’ll update you with status, on your company e-mail.” Email never comes.
Thanks for reporting this to us. Looks like v5 is not able to access your migration files.
Let’s first check if your v4 migration files are generated correctly.
Open invoiceninja v4 directory & navigate to storage/migrations and there you should see your migration files (zip archives). Are they vailid archives? Can you open them?
Okay, that explains a lot. Can you tell me what version of Invoice Ninja are you running? Also, today we published a new version so you may try upgrading & trying again:
I tried updating without luck. I still get the same error even on 4.5.22.
Could it be because I installed invoiceninja via Softaculous in the first place?
But I since exported my data and moved to my own server where I installed it with the zip file…
Hi !
I’ve got the exact same error trying to migrate (same error in laravel.log and email never comes).
In /storage/mirgations/ the zip file contain a json file that has just a “true” string inside.
I’m on v4.5.22 and 5.0.25-26
Regards
This issue should be resolve now. You may need to update your V4 Code to the latest from the master branch… and also your V5 code from the latest in the V5-develop branch.
Can you check your logs? They’re located in “storage/logs/laravel.log”. Also, do you have QUEUE_CONNECTION in the .env file and if so, what’s value of it?
Created only one invoice in v4. Installed v5. Tried to migrate. Still nothing.
No error log in v5 laravel.
A directory was created inside v5 storage/migration with the same name as the zip in my v4 directory. But this new v5 directory was empty. No zip file inside.
If I copy the ZIP file to the new directory, how can I trigger the migration?
That was indeed the issue for me, hopefully it works for others. I was running the v5-stable branch. After pulling the v5-develop, the migration worked. (I never got an email notification as suggested, but all data is there, balances check out, and no errors in the log.)
It seems like the migration is happening on the v4 side… then the task is scheduled on the v5 side… but when it runs, I get this error in the laravel.log
production.ERROR: ZipArchive::extractTo(): Invalid or uninitialized Zip object {"userId":1,"exception":"[object] (ErrorException(code: 0): ZipArchive::extractTo(): Invalid or uninitialized Zip object at /home/stepynny/public_html/invoiceninja/app/Jobs/Util/StartMigration.php:97)
Also, there is a directory that is created in v5 storage/migration.
But the directory is empty. Should the migration zip file be in there and that is throwing the above error?
As you can see, it looks for the file inside the “storage/app/public/migrations” directory.
Shouldn’t it be “storage/migrations” ?
If I manually make the change inside the database, and run “php artisan queue:listen”, it seems to find the zip file but I get this error:
production.ERROR: unserialize(): Error at offset 223 of 993 bytes {"exception":"[object]
(ErrorException(code: 0): unserialize(): Error at offset 223 of 993 bytes at /home/my_user/public_html/invoiceninja/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php:229)
Just to let you know that the fixes in 5.0.31 allowed me to migrate my data.
In PhpMyAdmin, I see the tables populated with my old v4 data.
Only problem, it looks like I can’t refresh my browser to show the data. All my invoices, clients, expenses are empty. I tried clicking on refresh data in the settings. Log out/Log in. Php artisan optimize. And more…
Is there something I need to run in the commande line?
When you migrate, it creates a new company, you’ll want to switch to your company in the top left hand corner of the UI, can you switch between the different companies.