When I attempt to visit the Craft CP, front-end, or run any Craft CLI command on a Craft 3.4.30 site in Homestead local dev, I get the following error:
Unknown Property – yii\base\UnknownPropertyException
Getting unknown property: craft\models\Info::configVersion
Screenshot: https://share.getcloudapp.com/2NujEYBq
When I add the following lines to vendor/craftcms/cms/src/models/Info.php, the error goes away and I'm able to regain access to the CP and front-end, and CLI commands. If I delete the lines, the error returns.
/**
* @var string Field version
* @since 3.5.6
*/
public $configVersion = '000000000000';
I initially noticed the issue when the site was still running 3.4.25. I have a hunch that updating to 3.5.x would solve the issue, since this was introduced in 3.5.6. However, I cannot do so until a known plugin issue is resolved.
In the craft_info table, I see: version -> 3.4.30 and shemaVersion -> 3.4.11.
I have another site for the same client that I maintain in parallel, so same Craft version, common plugins, and don't have this issue. Very strange...
Thanks for your help!
Info.php fileInfo.phpHm, did you update to 3.5 at some point and then roll back? Maybe the rollback wasn’t completely successful. Try nuking your vendor/ folder and run composer install.
I was running into the same issue, my database and composer were out of sync. Once I pulled the same composer.json that the server running the database was using (3.5 instead of 3.4) the craft setup command worked for me.
I did not update to 3.5.x and roll back. I have the Craft version number fixed in composer.json so that I have control over what gets updated and when. Sorry but forgot to mention that I twice deleted vendor and composer.lock and then ran composer install.
you could try removing the composer.lock and making a new one. maybe check if the version in the info table is matching the composer files?
@ademers configVersion wasn’t added until 3.5.6, so _something_ must have touched Craft 3.5 at some point. Maybe you restored a DB backup from another environment that was running Craft 3.5?
I tried _composer nuke_ again rm -rf vendor/ && rm composer.lock && composer clear-cache && composer update after my previous comment and no change. After that, I took chance and pushed the Craft 3.4.30 update to Production and all is still OK in that env. It's only an issue in Homestead local dev. I have Craft scripts set up to only pull from the Production env. which is never ahead of local dev in terms of Craft and plugin versions. I'll have to file this under _unsolved mysteries_ for now and use the work around until I can safely update to 3.5.x.
Does your info table in your database have a configVersion column?
No. Neither in local dev, nor in Production.
Someone wrote into support with a similar error, and the issue was that Craft was attempting to load the project config from cache, and the cache has this dependency that references the configVersion (added in 3.5.6):
The customer had updated to 3.5 and then downgraded back to 3.4, which is when the error occurred.
From your screenshot I can tell that the same thing was happening here. So… _somehow_ your project config got cached with that dependency. Perhaps your project shares the same storage/ folder as another project that is running 3.5.6+, or Craft was in fact briefly updated to 3.5.6+ before rolling back to 3.4. Or you pulled in cache files from a different project. Doesn’t matter now, but the culprit must have been something along those lines.
To anyone that is seeing this exact error, the solution is to clear your cache files, by deleting your storage/runtime/cache/ folder, or running php craft clear-caches/data.
Hi @brandonkelly I have this exact issue when downgrading from 3.5 to 3.4. I'm running via a docker container so everything get's binned and rebuilt from scratch but the error persists when I spin up the containers.
php_1 | mysql running> @php craft migrate/all
php_1 | Exception 'yii\base\UnknownPropertyException' with message 'Setting unknown property: craft\models\Info::configVersion'
I've nuked the vendor directory and run composer install and composer clear-cache to clear anything local to my machine.
I had to remove the volume in order for this tot be resolved.
I experienced this issue downgrading from 3.5. Even after deleting the directory, restoring the 3.4 database, pulling a new copy of the site down from git, and running composer install I still have this issue. Any solutions?
@boxadesign Could you provide more detail on "remove the volume"? Are you referring to your Docker instance?
Worth noting, that if Craft website is using Redis, the redis template cache needs to be cleared.
I experienced this issue downgrading from 3.5. Even after deleting the directory, restoring the 3.4 database, pulling a new copy of the site down from git, and running composer install I _still_ have this issue. Any solutions?
@boxadesign Could you provide more detail on "remove the volume"? Are you referring to your Docker instance?
Hi, yes the docker instance.
docker container prune
docker volume prune
docker-compose pull
docker-compose build
docker-compose up
I experienced this error because the DB is running 3.5 while composer / vendor are running 3.4
Make sure that the Craft CMS version in Composer.json is at least 3.5, then run composer update, then ./craft should work again.
I experienced the same error on a Craft CMS installation "3.4.24" using Redis. My solution was to run "redis-cli flushall" which fixed my problem.
Most helpful comment
I experienced this error because the DB is running 3.5 while composer / vendor are running 3.4
Make sure that the Craft CMS version in Composer.json is at least 3.5, then run composer update, then
./craftshould work again.