Calling Developers!
We are reenergizing our code contribution process! Learn More

After upgrade to 202180.0, error about the loaderScriptDir

Options
giovanni.piemontese
giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
edited June 2023 in Propel ORM

Hi guys,

I have, after upgrade to 202180.0, always the error about the loaderScriptDir from propel

Zed.CRITICAL: Propel\Runtime\Exception\PropelException - Database map was not initialized. Please check the database loader script included by your conf.

After propel:install is problem gone. After docker/sdk up i have again the problem.... How can solve the problem?
Standard configuration used!

Tagged:

Comments

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    Options

    Hey @UL65CH0MC that what helped me on one of the projects recently, do you have that?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    It seems that the database map (autogenerated) located per default in spryker under /data/cache/propel is only in container and not synced locally... it means that on up it will be synced to empty..

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    @UKJSE6T47 according project release changes we don't need it, because it was decladed in config as standard value

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    but not src/Orm/Propel .... -> data/cache/propel..

    I have also added in .dockerignore

    !/data/cache/propel

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    I think it make sense to have this file under cache because is autogenerated and it was about me the quickly solution... but a little bit dangerous because without this file it does not work nothing... because no connection db map..

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    Heyhey,
    the answer from @UKJSE6T47 is correct but should not be needed anymore (we patched it). There will be a default value set (to the cache folder as you pointed out). But with this config value you can override the path if you want. The file gets generated with console propel:model:build

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    Are you saying that it will be lost after you do another docker/sdk up because it is in the cache folder?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    @florian.scholz yes correct... it is generated but only in container and not synced back locally via mutagen.. even if it is explicity not ignored in dockerignore..

    I have already more times bootstraped and up the docker sdk

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    this is strange - i am also using mutagen but i can see the file on my host-machine in phpstorm 😕

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    ok strange... can u share your dockerignore ?

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options
    .git*
    .idea
    .DS_Store
    node_modules
    /vendor
    /data
    !/data/import
    !/data/export
    .git*
    .unison*
    .docker-sync
    /.nvmrc
    /.scrutinizer.yml
    /newrelic.ini
    
    /docker
    !/docker/deployment/
    
    /src/Orm/Zed/*/Persistence/Base
    /src/Orm/Zed/*/Persistence/Map
    /src/Orm/Propel/*
    !/src/Orm/Propel/.gitkeep
    
    /src/Generated
    /public/Yves/assets
    /public/Zed/assets
    
    /tests/*/*/*/_output/*
    /tests/*/*/*/_support/_generated/*
    
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    it is the default

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    it is just the same.. i just added !/data/cache/propel to solve the problem but without effort... ok.. i will debug in deep to understand the root cause of the missing sync...

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    Please keep me updated, maybe I missed something while patching it

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    Of course...
    Did u tried already to delete the file on host system and then run the propel command to see if the file is again synced back to host?

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    i did now and it synched it back

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    if i configured in config_propel as u said in the first reply

    'loaderScriptDir' => APPLICATION_ROOT_DIR . '/src/Orm/Propel/generated-conf/',
    

    then it works as expected...

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    but not in cache..
    what was the problem why it was patched with default config and the choosing of data/cache/propel path?

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,016 ⚖️ - Guardians (admin)
    Options

    Main problem was that the propel update required some kind of mapping file now. But make this new path required on project level creates noise whenever somebody updates the project and does not know why he/she is now getting an exception. Since the propel paths are not touched in most projects anyway the goal was to set a default which CAN be adjusted, but not required anymore. The path-change itself follows an agreement of not having cached things inside /src folder anymore. so new code should not add additional cached files there like the new propel-conf. So one of the IDEAS is to move more out of /src and into /data folder

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    ok, understood. Thanks a lot for clarifing..