Two exactly same repositories but different result

I can install a script from its original Github repo (project1) in an Ubuntu server: I clone the original repo and start installation in the server, no problem at all.

However if I create a repo (project2) in my GitHub account, then copy all the files (except .git) from the original repo (project1) to my new repo (project2), then clone my repo and start installation in the server, installation gives me an error.

ango.db.migrations.exceptions.InvalidBasesError: Cannot resolve bases for [<ModelState: 'dictionary.MetaFlatPage'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 in an app with no migrations; see for more

Those two repositories are the exactly same. I didn't change any file, any line. Do you know what possibly causes this issue?

Script is a Django script.

The easiest and most common explanation would be that on one system there already happened a migration and there is a migration folder, and on the other system that is not the case. Such that on one system there might be a model that on the new system is missing or similar. But let us assume that is not the problem.

The error in other words tells you that a migration that has been generated would try to migrate a model that is dependent on another model that is not yet known (meaning the migration for that model does not exist yet). It also tells you that this is probably related to built-in models like User or models that inherit from User.

From what I can see without source code your MetaFlatPage model seems to inherit from another model. To fix that issue look into the generated migration file for that model and make sure the migration file creates MetaFlatPage AFTER the model it inherits from.

Why this is occurring is not clear to me. It might be that the order of model creation has some dependency on a package or python functionality that might differ in a slightly different version or os specific package. If that is the case you struck a rare bug or something :)

Back to Top