uvdesk / community-skeleton

UVdesk Opensource Community Helpdesk Project built for all to make a Full Ticketing Support System along with many more other features.
https://www.uvdesk.com
MIT License
8.53k stars 459 forks source link

Base table or view not found error. #264

Closed PrakashLakhara closed 4 years ago

PrakashLakhara commented 4 years ago

We have php extensions installed and it passes the check also. While setting up project with composer and configuring the db and after installing the fronted the site is giving error with Base table or view not found: 1146 Table 'uv_article' doesn't exist.

"PDOException PDOException TableNotFoundException HTTP 500 Internal Server Error An exception occurred while executing 'SELECT u0_.id AS id0, u0.name AS name1, u0.slug AS slug2, u0.content AS content3, u0.stared AS stared_4 FROM uvarticle u0 WHERE u0.status = ? ORDER BY u0.viewed DESC LIMIT 10' with params [1]:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb_uvdesk.uv_article' doesn't exist"

papnoisanjeev commented 4 years ago

@PrakashLakhara

Please write all the steps you gone through. and also send us full error screenshot.

papnoisanjeev commented 4 years ago

@PrakashLakhara You can try below command to migrate all missing tables as sometime In your first attempt all the table not get migrated due to less max_execution_time in your php.ini

php bin/console uvdesk:configure-helpdesk

PrakashLakhara commented 4 years ago

@papnoisanjeev Steps are:

php version 7.1

error

PrakashLakhara commented 4 years ago

I also tried the command php bin/console uvdesk:configure-helpdesk after increasing the max execution time from 30 to 1000. So the result of the command was https://prnt.sc/sljepi

papnoisanjeev commented 4 years ago

@PrakashLakhara

Try to run below commands:

php bin/console doctrine:migrations:diff php bin/console doctrine:migrations:migrate

And finally clear your project cache by: php bin/console c:c

And then make a try.

PrakashLakhara commented 4 years ago

Got this error on while running the command php bin/console doctrine:migrations:migrate

Migration 20200522040716 failed during Execution. Error An exception occurred while executing 'CREATE TABLE uv_article (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) DEFAULT NULL, content LONGTEXT NOT NULL, meta_description VARCHAR(255) DEFAULT NULL, keywords VARCHAR(255) DEFAULT NULL, viewed INT DEFAULT NULL, status INT DEFAULT 0, date_added DATETIME NOT NULL, date_updated DATETIME NOT NULL, stared INT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, INDEX search_idx (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.

papnoisanjeev commented 4 years ago

@PrakashLakhara

Please let us know your MySQL version.

vaishaliwebkul commented 4 years ago

Hi @PrakashLakhara Could you please mention the UVDesk version.

Thanks

PrakashLakhara commented 4 years ago

Hi, Uvdesk version is 4.3.8 and mysql version is 5.6

php bin/console -V Symfony 4.3.8 (env: dev, debug: true)

mysql -V

mysql Ver 14.14 Distrib 5.6.47, for Linux (x86_64) using EditLine wrapper

papnoisanjeev commented 4 years ago

@PrakashLakhara

Please upgrade your MySQL version 5.7 or greater. As you can see it is clearly mentioned here.

Also check this: https://stackoverflow.com/questions/42043205/how-to-fix-mysql-index-column-size-too-large-laravel-migrate

PrakashLakhara commented 4 years ago

Ohh, thanks for your help. @papnoisanjeev and @vaishaliwebkul

PrakashLakhara commented 4 years ago

Hi, I have now MySQL 5.7 and php7.2 with all required extensions are installed. But when I started installation it throws the following error:

An exception occurred while executing 'SELECT t0.id AS id_1, t0.code AS code_2, t0.description AS description_3 FROM uv_support_role t0 WHERE t0.code = ? LIMIT 1' with params ["ROLE_SUPER_ADMIN"]:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'uvdesk.uv_support_role' doesn't exist

I am attaching a screenshot. Firefox_Screenshot_2020-05-25T09-41-46 236Z

And after that I ran the following commands also : php bin/console doctrine:migrations:diff php bin/console doctrine:migrations:migrate php bin/console c:c The commands were successful with no error. After that I refreshed site in the browser and it is again showing me the installation page of uvdesk.

papnoisanjeev commented 4 years ago

@PrakashLakhara

Please try to re-setup project with new database and before setup check your max_execution_time in php.ini and read/write permission for config, public folder and .env file of this project.

PrakashLakhara commented 4 years ago

Sorry to say that but I have tried all the things you have mentioned but still nothing happening. @papnoisanjeev and @vaishaliwebkul

papnoisanjeev commented 4 years ago

@PrakashLakhara

Check your database if only uv_support_role table is missing in your database. Also count how many tables exist in database currently. It is only due to migration is not taking place properly.

Again try to run below commands:

Clear doctrine cache by: doctrine:cache:clear-metadata

php bin/console uvdesk:configure-helpdesk

or

php bin/console doctrine:migrations:diff php bin/console doctrine:migrations:migrate

And clear your cache: php bin/console c:c

If still all does not work please try to import uv_support_role table manually in your db.

uv_support_role.sql.zip

papnoisanjeev commented 4 years ago

@PrakashLakhara

Is your issue resolved ? we are closing issue if still exist you can reopen it.

You can also try this method if unable to do. https://github.com/uvdesk/community-skeleton/issues/290#issuecomment-661113642