Magento 2 is not generating the db_schema_whitelist.json file via CLIAre the file paths inside a db table?The sender of the order mail can not be changedUnable to Install Magento 2.3 Via ComposerMagento 2.3 Useful SSH CLI Commands ListMagento 2: How to setup Elasticsearch from CLI?in magento 2 I want to write the dynamic var shipping_company into the xml fileMagento 2 - CLI Installation - MySQL Access Denied despite correct authenticationIssue regarding css/js file path in magento 2.3How to run CLI command in docker Magento 2How to override the checkout_cart_configure.xml template file into custom module

How long after the last departure shall the airport stay open for an emergency return?

How to have a sharp product image?

How to pronounce 'c++' in Spanish

Can I criticise the more senior developers around me for not writing clean code?

Why doesn't the standard consider a template constructor as a copy constructor?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

What does a straight horizontal line above a few notes, after a changed tempo mean?

How exactly does Hawking radiation decrease the mass of black holes?

Unknown code in script

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

Older movie/show about humans on derelict alien warship which refuels by passing through a star

What is the best way to deal with NPC-NPC combat?

Apply a different color ramp to subset of categorized symbols in QGIS?

Is Diceware more secure than a long passphrase?

A strange hotel

All ASCII characters with a given bit count

Will I lose my paid in full property

std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?

Why do games have consumables?

Why do real positive eigenvalues result in an unstable system? What about eigenvalues between 0 and 1? or 1?

Why did C use the -> operator instead of reusing the . operator?

Crossed out red box fitting tightly around image

How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?

How to not starve gigantic beasts



Magento 2 is not generating the db_schema_whitelist.json file via CLI


Are the file paths inside a db table?The sender of the order mail can not be changedUnable to Install Magento 2.3 Via ComposerMagento 2.3 Useful SSH CLI Commands ListMagento 2: How to setup Elasticsearch from CLI?in magento 2 I want to write the dynamic var shipping_company into the xml fileMagento 2 - CLI Installation - MySQL Access Denied despite correct authenticationIssue regarding css/js file path in magento 2.3How to run CLI command in docker Magento 2How to override the checkout_cart_configure.xml template file into custom module






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I’m updating a module to Magento 2.3 and need to migrate the old setup install scripts to the new db_schema.xml file (the new declarative schema). The db_schema.xml file was correctly generated after running:



php bin/magento setup:install --convert-old-scripts=1



But now I need to generate the db_schema_whitelist.json file and running the following command does nothing:



php bin/magento setup:db-declaration:generate-whitelist --module-name=[module_name]


I followed all the steps outlined in the docs and checked the permissions of the etc folder.



But the result is always the same: no errors, no response, nothing. Any ideas?










share|improve this question




























    0















    I’m updating a module to Magento 2.3 and need to migrate the old setup install scripts to the new db_schema.xml file (the new declarative schema). The db_schema.xml file was correctly generated after running:



    php bin/magento setup:install --convert-old-scripts=1



    But now I need to generate the db_schema_whitelist.json file and running the following command does nothing:



    php bin/magento setup:db-declaration:generate-whitelist --module-name=[module_name]


    I followed all the steps outlined in the docs and checked the permissions of the etc folder.



    But the result is always the same: no errors, no response, nothing. Any ideas?










    share|improve this question
























      0












      0








      0








      I’m updating a module to Magento 2.3 and need to migrate the old setup install scripts to the new db_schema.xml file (the new declarative schema). The db_schema.xml file was correctly generated after running:



      php bin/magento setup:install --convert-old-scripts=1



      But now I need to generate the db_schema_whitelist.json file and running the following command does nothing:



      php bin/magento setup:db-declaration:generate-whitelist --module-name=[module_name]


      I followed all the steps outlined in the docs and checked the permissions of the etc folder.



      But the result is always the same: no errors, no response, nothing. Any ideas?










      share|improve this question














      I’m updating a module to Magento 2.3 and need to migrate the old setup install scripts to the new db_schema.xml file (the new declarative schema). The db_schema.xml file was correctly generated after running:



      php bin/magento setup:install --convert-old-scripts=1



      But now I need to generate the db_schema_whitelist.json file and running the following command does nothing:



      php bin/magento setup:db-declaration:generate-whitelist --module-name=[module_name]


      I followed all the steps outlined in the docs and checked the permissions of the etc folder.



      But the result is always the same: no errors, no response, nothing. Any ideas?







      magento2.3






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 22 '18 at 18:04









      Daniel KratohvilDaniel Kratohvil

      442312




      442312




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Found my own answer. Turns out the db_schema.xml file generated automatically by Magento had an error. The line that declares the name of the table was missing the resource value.



          This is how the tag was generated after running the CLI command:



          <table name="my_table_name" resource="" engine="innodb" comment="My Table Comment">


          And this is how it should be:



          <table name="my_table_name" resource="default" engine="innodb" comment="My Table Comment">


          resource should contain the database shard on which to install the table. This value must be default, quote, or sales. In my case, adding default did the trick.



          Edit (04/25/2019):



          Whenever the db_whitelist_schema.json file is not created automatically when running the bin/magento setup:db-declaration:generate-whitelist --module-name=Vendor_Modulename command you can safely assume there’s an error in the etc/db_schema.xml file of your module.



          Since the terminal won’t return an error msg to help you fix the issue, you can resort to the following hack to discover the missing piece in your db_schema file.



          1) Open the following core file: vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php



          2) Locate the getDeclarationConfig() method and add a try-catch like this:



          /**
          * @inheritdoc
          */
          public function getDeclarationConfig()

          try
          $schema = $this->schemaFactory->create();
          $data = $this->readerComposite->read(FileResolverByModule::ALL_MODULES);
          $this->declarativeSchemaBuilder->addTablesData($data['table']);
          $schema = $this->declarativeSchemaBuilder->build($schema);
          return $schema;
          catch (Exception $e)
          $writer = new ZendLogWriterStream(BP . '/var/log/schema.log');
          $logger = new ZendLogLogger();
          $logger->addWriter($writer);
          $logger->info($e->getMessage());




          3) Now run the bin/magento setup:db-declaration:generate-whitelist



          4) Check for any errors in var/log/schema.log



          5) Rinse and repeat until you fix all the errors in your db_schema.xml file



          6) Don’t forget to remove the temporary changes you made to the core file!






          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f255583%2fmagento-2-is-not-generating-the-db-schema-whitelist-json-file-via-cli%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Found my own answer. Turns out the db_schema.xml file generated automatically by Magento had an error. The line that declares the name of the table was missing the resource value.



            This is how the tag was generated after running the CLI command:



            <table name="my_table_name" resource="" engine="innodb" comment="My Table Comment">


            And this is how it should be:



            <table name="my_table_name" resource="default" engine="innodb" comment="My Table Comment">


            resource should contain the database shard on which to install the table. This value must be default, quote, or sales. In my case, adding default did the trick.



            Edit (04/25/2019):



            Whenever the db_whitelist_schema.json file is not created automatically when running the bin/magento setup:db-declaration:generate-whitelist --module-name=Vendor_Modulename command you can safely assume there’s an error in the etc/db_schema.xml file of your module.



            Since the terminal won’t return an error msg to help you fix the issue, you can resort to the following hack to discover the missing piece in your db_schema file.



            1) Open the following core file: vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php



            2) Locate the getDeclarationConfig() method and add a try-catch like this:



            /**
            * @inheritdoc
            */
            public function getDeclarationConfig()

            try
            $schema = $this->schemaFactory->create();
            $data = $this->readerComposite->read(FileResolverByModule::ALL_MODULES);
            $this->declarativeSchemaBuilder->addTablesData($data['table']);
            $schema = $this->declarativeSchemaBuilder->build($schema);
            return $schema;
            catch (Exception $e)
            $writer = new ZendLogWriterStream(BP . '/var/log/schema.log');
            $logger = new ZendLogLogger();
            $logger->addWriter($writer);
            $logger->info($e->getMessage());




            3) Now run the bin/magento setup:db-declaration:generate-whitelist



            4) Check for any errors in var/log/schema.log



            5) Rinse and repeat until you fix all the errors in your db_schema.xml file



            6) Don’t forget to remove the temporary changes you made to the core file!






            share|improve this answer





























              0














              Found my own answer. Turns out the db_schema.xml file generated automatically by Magento had an error. The line that declares the name of the table was missing the resource value.



              This is how the tag was generated after running the CLI command:



              <table name="my_table_name" resource="" engine="innodb" comment="My Table Comment">


              And this is how it should be:



              <table name="my_table_name" resource="default" engine="innodb" comment="My Table Comment">


              resource should contain the database shard on which to install the table. This value must be default, quote, or sales. In my case, adding default did the trick.



              Edit (04/25/2019):



              Whenever the db_whitelist_schema.json file is not created automatically when running the bin/magento setup:db-declaration:generate-whitelist --module-name=Vendor_Modulename command you can safely assume there’s an error in the etc/db_schema.xml file of your module.



              Since the terminal won’t return an error msg to help you fix the issue, you can resort to the following hack to discover the missing piece in your db_schema file.



              1) Open the following core file: vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php



              2) Locate the getDeclarationConfig() method and add a try-catch like this:



              /**
              * @inheritdoc
              */
              public function getDeclarationConfig()

              try
              $schema = $this->schemaFactory->create();
              $data = $this->readerComposite->read(FileResolverByModule::ALL_MODULES);
              $this->declarativeSchemaBuilder->addTablesData($data['table']);
              $schema = $this->declarativeSchemaBuilder->build($schema);
              return $schema;
              catch (Exception $e)
              $writer = new ZendLogWriterStream(BP . '/var/log/schema.log');
              $logger = new ZendLogLogger();
              $logger->addWriter($writer);
              $logger->info($e->getMessage());




              3) Now run the bin/magento setup:db-declaration:generate-whitelist



              4) Check for any errors in var/log/schema.log



              5) Rinse and repeat until you fix all the errors in your db_schema.xml file



              6) Don’t forget to remove the temporary changes you made to the core file!






              share|improve this answer



























                0












                0








                0







                Found my own answer. Turns out the db_schema.xml file generated automatically by Magento had an error. The line that declares the name of the table was missing the resource value.



                This is how the tag was generated after running the CLI command:



                <table name="my_table_name" resource="" engine="innodb" comment="My Table Comment">


                And this is how it should be:



                <table name="my_table_name" resource="default" engine="innodb" comment="My Table Comment">


                resource should contain the database shard on which to install the table. This value must be default, quote, or sales. In my case, adding default did the trick.



                Edit (04/25/2019):



                Whenever the db_whitelist_schema.json file is not created automatically when running the bin/magento setup:db-declaration:generate-whitelist --module-name=Vendor_Modulename command you can safely assume there’s an error in the etc/db_schema.xml file of your module.



                Since the terminal won’t return an error msg to help you fix the issue, you can resort to the following hack to discover the missing piece in your db_schema file.



                1) Open the following core file: vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php



                2) Locate the getDeclarationConfig() method and add a try-catch like this:



                /**
                * @inheritdoc
                */
                public function getDeclarationConfig()

                try
                $schema = $this->schemaFactory->create();
                $data = $this->readerComposite->read(FileResolverByModule::ALL_MODULES);
                $this->declarativeSchemaBuilder->addTablesData($data['table']);
                $schema = $this->declarativeSchemaBuilder->build($schema);
                return $schema;
                catch (Exception $e)
                $writer = new ZendLogWriterStream(BP . '/var/log/schema.log');
                $logger = new ZendLogLogger();
                $logger->addWriter($writer);
                $logger->info($e->getMessage());




                3) Now run the bin/magento setup:db-declaration:generate-whitelist



                4) Check for any errors in var/log/schema.log



                5) Rinse and repeat until you fix all the errors in your db_schema.xml file



                6) Don’t forget to remove the temporary changes you made to the core file!






                share|improve this answer















                Found my own answer. Turns out the db_schema.xml file generated automatically by Magento had an error. The line that declares the name of the table was missing the resource value.



                This is how the tag was generated after running the CLI command:



                <table name="my_table_name" resource="" engine="innodb" comment="My Table Comment">


                And this is how it should be:



                <table name="my_table_name" resource="default" engine="innodb" comment="My Table Comment">


                resource should contain the database shard on which to install the table. This value must be default, quote, or sales. In my case, adding default did the trick.



                Edit (04/25/2019):



                Whenever the db_whitelist_schema.json file is not created automatically when running the bin/magento setup:db-declaration:generate-whitelist --module-name=Vendor_Modulename command you can safely assume there’s an error in the etc/db_schema.xml file of your module.



                Since the terminal won’t return an error msg to help you fix the issue, you can resort to the following hack to discover the missing piece in your db_schema file.



                1) Open the following core file: vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php



                2) Locate the getDeclarationConfig() method and add a try-catch like this:



                /**
                * @inheritdoc
                */
                public function getDeclarationConfig()

                try
                $schema = $this->schemaFactory->create();
                $data = $this->readerComposite->read(FileResolverByModule::ALL_MODULES);
                $this->declarativeSchemaBuilder->addTablesData($data['table']);
                $schema = $this->declarativeSchemaBuilder->build($schema);
                return $schema;
                catch (Exception $e)
                $writer = new ZendLogWriterStream(BP . '/var/log/schema.log');
                $logger = new ZendLogLogger();
                $logger->addWriter($writer);
                $logger->info($e->getMessage());




                3) Now run the bin/magento setup:db-declaration:generate-whitelist



                4) Check for any errors in var/log/schema.log



                5) Rinse and repeat until you fix all the errors in your db_schema.xml file



                6) Don’t forget to remove the temporary changes you made to the core file!







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 7 hours ago

























                answered Dec 22 '18 at 18:25









                Daniel KratohvilDaniel Kratohvil

                442312




                442312



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f255583%2fmagento-2-is-not-generating-the-db-schema-whitelist-json-file-via-cli%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Nidaros erkebispedøme

                    Birsay

                    Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?