Closed jdcrecur closed 5 years ago
Content with id 14 is admin, at least on eZPlatform 5. I suspect that the migration code is trying to log you in as admin and not finding the admin user. If you have removed the default admin and replaced it with another one, you should use the available command-line switch for migration commands that uses the new admin account - note that that switch might have not yet been implemented for all commands, but at least it is available for migration execution (you can test f.e. with a simple migration created by hand)
Yup. and just in case. take in account you need to have things in your db before running your first migration. that admin user is automatically added by the install command. ./bin/console ezplatform:install clean
once you do this, you can start to work with migrations.
if this is not the case, @gggeek said it. probably you have changed your admin user at some point.
Ah right I see.
Yes, the admin account was removed as we have 3 other accounts under the admin role so this seemed redundant. Is it possible to reinstate the default admin user?
I cannot see by reading the database schema any issue with simply injecting back into the users table the admin user and forcing the admin id to contentobject_id 14.
Is there anything you know of which would break the admin for this?
well, you can not reuse an object-id / user-id. The only way would be a sql command to alter the current admin. Either that, or change your usage of migration commands to always use one of the new admins
ps: mig bundle uses 14 by default as there is no good heuristic (that I know of) to find the current 'admin', given that both the user, group and role might have been changed / renamed
I understand and thank you for the advice.
I will attempt to simply assign another admin user with id 14 first.
@gggeek OK, attempting to force another admin user to be contentobject id 14 did not work. I can only assume it will be heavily related to the content object tables.
How do I, or is there a doc on, instructing the migrations to run as another user id?
If you run the commands with -h
you should get the info
Thanks for the help! Up and running again.
I cannot run any new migrations, nor even dump the migrations of what we already have. The following:
Results in the error:
Content type: Article is of id 14. I cannot find a content object of id 14.
Any ideas on where I could debug this further?