What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

hi, I have another one πŸ™‚ I'm getting `Exception: Duplicate table found: spy_au

U01G4K5E0J2
U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

hi, I have another one πŸ™‚
I'm getting Exception: Duplicate table found: spy_auth_reset_password. while running propel:install
I am currently trying to update the project to match spryker-shop/suite 1.7, and I might be getting this completely wrong, but it seems to me, that both spryker/auth (required) and spryker/user-reset-password (required by spryker/merchant-user) have this table in their schema, which causes the trouble
Did anyone have similiar problem or could point me what am I doing wrong?

Comments

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    the schemas are merged eventually by propel into one representation, so this is okay. This is also the way how you would extend the existing schemas, introduce new columns, etc.

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    I see
    what could be the reason for propel:instal trying to create same table again?

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    never had that before, but theoretically the reason could be f.e. that propel have lost track of the current DB schema version (propel_migration table in your DB) and decided to run full migration again. But the table you had was already there

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    Propel also can’t track if certain actions were done manually. F.e. you could have created a table somehow manually and then propel:install was executed

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2020

    or, you’ve received a migration file after pulling from the repo that one of your collegues has generated. So you end up having 2 migrations that are trying to install the same table

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    so any consistency loss between xml schemas + migrations + actual database schema

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    I actally managed to "solve" this by removing user-password-reset, merchant-user and every package that requires one of those two from composer.json

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    I end up with just src/Orm/Propel/Schema/spy_auth.schema.xml which contains spy_auth_reset_password declaration and everytihing is "fine"

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    but I imagine, that once I restore my dependencies I end up with same error as before

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    no, this should not happen. Can you confirm that after inclusion of the module and running β€œpropel:install” you see the same table mentioned twice?

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    sure, give me a minute

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    I would suggest to check also your migration files

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet
    Creating Database
    Adjust propel config for PostgreSQL and missing functions (group_concat)
    Clean schema directory
    Copy and merge schema files
    Build Propel2 classes
    Propel\Generator\Exception\EngineException - Exception: Duplicate table found: spy_auth_reset_password. 
    in /data/shop/development/current/vendor/propel/propel/src/Propel/Generator/Model/Schema.php (298)
    
    Command: vendor/bin/console propel:install
    
    Trace: 
    #0 /data/shop/development/current/vendor/propel/propel/src/Propel/Generator/Manager/AbstractManager.php(438): Propel\Generator\Model\Schema->joinSchemas(Array)
    
  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    and I have two files with spy_auth_reset_password

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    src/Orm/Propel/Schema/spy_auth.schema.xml
    and
    src/Orm/Propel/Schema/spy_user_password_reset.schema.xml

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    interesting. Thanks for letting know, we will need to check that. It’s not the only case where we have the same table mentioned several times in different modules where propel merges the schemas, but seem not in this case.

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    hi guys, see the description https://github.com/spryker/auth

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet

    so make sure that you will remove spryker/auth and spryker/auth-mail-connector before starting using security-gui and user-password-reset

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2020

    in https://github.com/spryker-shop/suite/blob/1.7/composer.json
    I can see auth, but cannot see security-gui

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    "spryker/merchant-user": "^0.5.0", requires user-password-reset

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    so correct me if I misunderstood you

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    I cannot use spryker/auth and spryker/user-password-reset at the same time?

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2020

    Right. do you need merchant-user? I see the issue now.

  • Stanislav Matveyev
    Stanislav Matveyev Sprykee Posts: 211 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2020

    If you want to use merchant-user with auth try to decrease the version of merchant-user