Authentication not allowed after clearing cache of

2019-09-11 01:30发布

问题:

I had a problem with my symfony's cache (changes in html pages were not rendering ) after many Attempts now I can not authenticate to the web site ,it shows me this error :

An exception occurred while executing 'SELECT t0.username AS ......... FROM "fos_user" t0 WHERE t0.username_canonical = ? LIMIT 1' with params ["1999999"]: SQLSTATE[HY000]: General error: 1 no such table: fos_user

in my fos/userbundle/entity/User.php I have these parameters :

namespace FOS\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
 * User
 *
 * @ORM\Table(name="`fos_user`")
 * @ORM\MappedSuperClass
 */
class User
{
.............

and in my Bse/mybundle/entity/User.php I have these parameters :

namespace FOS\UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * User
 *
 * @ORM\Table(name="`fos_user`")
 * @ORM\MappedSuperClass
 */
class User
{.....

the table in the database is called fos_user

I'm using $kernel = new AppKernel('prod',false);in my app.php and $kernel = new AppKernel('dev', true); in my app_dev.php

I'm asking for your help please

回答1:

You've got no table fos_user, which is the problem.

Can you try:

php bin/console doctrine:schema:update --force

See if that does the trick. I'm thinking you made a big change somehow and deleted the table? If the above doesn't work, edit your post and show the file app/config/parameters.yml please.