Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

There is no tenant with given id: 1 error #2028


User avatar
0
sergiop created

Hello I was developing fine today, but suddenly the application failed to start raising this error. (Attach image) There is no tenant with given id: 1, it seems the default language is null, do you have any idea? Everything on the PC is in English. Thank you !!


4 Answer(s)
  • User Avatar
    0
    sergiop created

    I realize that I have added manually a table to the database, to copy data to the project data, and then forget to remove it, I guess this messed up the migrations even deleting and recreating the database. Have not tried deleting the Migrations table anyway. Started with a project backup to create the database then used the most updated version to update it, now it works. Do you think that the problems could be related? Thank you !!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Is your application is single tenant ? Did you disabled MultiTenancy in your Core module ?

    If so, there is a known bug and we will fix it in the next version. See <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/issues/391">https://github.com/aspnetzero/aspnet-zero/issues/391</a>.

  • User Avatar
    0
    sergiop created

    Hello Thank you, yes I have multitenancy disabled. Ive found that the first time (after DB is deleted manually) when running the command Update-Database, the seed was not running, then as a consequence the basic tables are empty, this is why I have the error. I had to run Update-Database additional times to get the seed running.

    I usually have to delete the database, and recreate it, every time, after working on the Entities and DB Context, I realize that structure update is inconsistent if you run Update-Database over an existent database.

    Thank you !!!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I had the similar problem with Update-Database several times but still couldn't figure out why it does not work sometimes.