Announcement

Collapse
No announcement yet.

Cannot rebuild database or add any custom fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot rebuild database or add any custom fields

    I was trying to add another custom field to the cases section in entity manager. When I finish and try to save it I get the following error. Click image for larger version

Name:	database error.png
Views:	688
Size:	5.1 KB
ID:	71553
    I get the same error if I try and use the rebuild button.

    I have added lots of custom fields in the past but never had an issue. I can't figure out what is the issue at this point but I also found this error in the logs.

    [2021-06-10 14:57:54] ERROR: Fault to rebuild database schema. Details: Unknown database type bit requested, Espo\Core\Utils\Database\DBAL\Platforms\MariaDb102 7Platform may not support it. at /opt/bitnami/espocrm/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php:398 [] []
    [2021-06-10 14:57:54] ERROR: (500) Error while rebuilding database. See log file for details.; PUT /Admin/fieldManager/Case/status; line: 134, file: /opt/bitnami/espocrm/application/Espo/Core/DataManager.php [] []

    here are the versions of my system:
    php 7.3.27
    mariadb 10.3.28-MariaDB
    espocrm 6.1.7
    This is running in bitnami VM.

    ​​​​​​​

  • #2
    Hello,

    The possible reason could be extra tables in the database. But what if you install a new instance, like in the first link?
    https://forum.espocrm.com/forum/gene...unning-rebuild
    In fact this error happened in an old project, I don't know what exactly made it happened. this error happens now when I want to rebuild the database from the admin panel, after a small search I fo...

    Comment


    • #3
      I don't have any extra tables. What I have found is there are a few tables in the performance_schema database that have the collation set to utf8_bin. I can't edit that database though so i can't change them. Does anyone know how to edit them?

      Comment


      • #4
        You do not need to update tables in `performance_schema`. It's the system MySQL tables.
        Job Offers and Requests

        Comment


        • #5
          Originally posted by tarasm View Post
          You do not need to update tables in `performance_schema`. It's the system MySQL tables.
          I checked all the other tables and they are all set to utf8_general but I still get the error above. Please can anyone help me sort this out as I have some changes I need to make.

          Comment


          • #6
            There is one wrong database type bit in your tables. Perhaps this could help: http://www.bdodev.com/2016/03/doctri...-database.html

            Comment


            • #7
              Originally posted by shalmaxb View Post
              There is one wrong database type bit in your tables. Perhaps this could help: http://www.bdodev.com/2016/03/doctri...-database.html
              I tried that and it broke my system. Had to remove those 2 lines from the bootstrap file to get it working again.

              Comment


              • #8
                My go to solution when nothing seems to help, instead of spending countless hours troubleshooting some exotic problem, is to wipe out the current installation and install a new one preserving the data and settings.

                I you think that you have reached that point, here's a way to install a new instance without losing your data, customizations or settings.
                I upgraded from 5.82 and followed the procedures to the current build. For two years prior to this upgrade, everything was running smoothly. I did appropriate backups, so I thought and even looked to the server rewinds etc. Now, every 2-4 hours the CRM crashes again and gives just the blue line across the top of the page. I


                Comment


                • #9
                  Originally posted by telecastg View Post
                  My go to solution when nothing seems to help, instead of spending countless hours troubleshooting some exotic problem, is to wipe out the current installation and install a new one preserving the data and settings.

                  I you think that you have reached that point, here's a way to install a new instance without losing your data, customizations or settings.
                  I upgraded from 5.82 and followed the procedures to the current build. For two years prior to this upgrade, everything was running smoothly. I did appropriate backups, so I thought and even looked to the server rewinds etc. Now, every 2-4 hours the CRM crashes again and gives just the blue line across the top of the page. I

                  I would hope to avoid a complete rebuild. But it seems based on the responses here I might be left with no other option.

                  Comment


                  • telecastg
                    telecastg commented
                    Editing a comment
                    It's actually a lot more simple, in my opinion, than trying to make sense of cryptic error messages, etc, plus, going through this process gives you some advantages:

                    1) If you don't have a staging site already, this post will teach you how to do that, so in the future you have a "playground" to try all your customizations first and make sure that everything works before you affect your production (live) website.

                    2) Having a local staging site will also let you test and isolate problems that could be caused by a permissions or other server or hosting issues that have nothing to do with your EspoCRM implementation.

                    3) It will take away some of the fear / nightmare of having a production implementation crashing with the users screaming at you while you try to figure out what to do ;-)

                • #10
                  So I tried all the rebuild steps but when I get to the import of the sql that exported from my actual server i get a phpmyadmin error:
                  phpMyAdmin - Error
                  Incorrect format parameter

                  once again no idea how I keep getting stuck like this but if i can't export my data and import it then i need to be able to fix my current setup which I'm not having any luck with so far either.


                  Comment


                  • #11
                    That looks like a php.ini error in your local setup, here's some information
                    https://stackoverflow.com/questions/...rmat-parameter
                    Last edited by telecastg; 07-02-2021, 04:22 PM.

                    Comment


                    • #12
                      After spending hours setting up a duplicate system to troubleshoot and then make primary I've run into the exact same issue.

                      [2021-07-06 13:21:23] ERROR: Fault to rebuild database schema. Details: Unknown database type bit requested, Espo\Core\Utils\Database\DBAL\Platforms\MariaDb102 7Platform may not support it. at /opt/bitnami/espocrm/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php:398 [] []
                      [2021-07-06 13:21:23] ERROR: (500) Error while rebuilding database. See log file for details.; POST /Admin/rebuild; line: 134, file: /opt/bitnami/espocrm/application/Espo/Core/DataManager.php [] []


                      And this is now with a brand new install nothing done but to import the export and copy over my custom directories to it.

                      So I look at all the tables and the only ones that I can find that are not utf8_general_ci are 2 tables in the performance_schema that are utf8_bin. But the issue is that I can't get rights to change those 2 tables COLLATION. Can someone please help me fix this issue????

                      Comment


                      • #13
                        in my opinion, it is still the same error as above. As the error log states, there is a wrong database type "bit" in your database.
                        Try the following:
                        Export your database. Open the SQL file with an editor and search for "bit". If you find a field with datatype bit, open your database in PHPMyAdmin and change it to INT.

                        I don`t know, if this will work, but it is worth a try.

                        And do not change anything in database performance_schema, that is a database, that PHPMyAdmin needs.

                        Comment


                        • #14
                          Originally posted by shalmaxb View Post
                          in my opinion, it is still the same error as above. As the error log states, there is a wrong database type "bit" in your database.
                          Try the following:
                          Export your database. Open the SQL file with an editor and search for "bit". If you find a field with datatype bit, open your database in PHPMyAdmin and change it to INT.

                          I don`t know, if this will work, but it is worth a try.

                          And do not change anything in database performance_schema, that is a database, that PHPMyAdmin needs.
                          I dumped both the mysql and esprcrm databases and reviewed the files and there are no tables with COLLATION type of bit at all. the only ones that have any type of BIT are the two tables in the performance_schema. So if we can't mod that why is espocrm complaining about them?

                          Comment


                          • #15
                            It is not about COLLATION, it is database (field) type. How did you "review" the SQL-file (from dump)? With an editor (text editor like notepad++)? If not, do that and search for the term "BIT".
                            BIT is a database field type like BOOL, VARCHAR, INT or TINYINT etc.. Nothing with COLLATION. If you found the term Bit, look, in which table that is.
                            I guess you have one field ore more, that got the type BIT and this will not be recognized.

                            If you found the field with that type, go to PHPMyAdmin, look for that field (in the table), choose the tab "Structure", where you can change the type.

                            I would not say, that this is aguaranteed solution, because I do not know your SQL file, but it would be th place and way to search for it.

                            Comment

                            Working...
                            X