Cphalcon: [BUG]: Table 'XXX' doesn't exist in database when dumping meta-data for SakuraPanel\Plugins\PluginsManager\Models\Plugins

Created on 16 Aug 2020  路  5Comments  路  Source: phalcon/cphalcon

When i submit a multi request par seconds
one of those requests get an error about 猬囷笍
Table 'plugins' doesn't exist in database when dumping meta-data for SakuraPanel\Plugins\PluginsManager\Models\Plugins
Example : https://imgur.com/a/o2UwxzV

Details

  • Phalcon version: 4.0.3
  • PHP Version: 7.3.12 (cli) (built: Nov 19 2019 13:58:02) ( ZTS MSVC15 (Visual C++ 2017) x64 )
  • Operating System: Windows
  • Installation type: Windows compiled DLL
  • Zephir version (if any):
  • Server: Wamp64
  • Other related info (Database, table schema):
bug unverified

All 5 comments

If you have caching of models meta-data - clear it.
If don't - start to caching, at least via Stream Adapter.

i dont think i use cache for those models

the problem come when i submit a request and in fews ms i submit another
the last cancelled the first

i tested using normal model but its work fine

but with a querybuilder
here the issue come

example of code

public function ajaxAction()
    {
        if ($this->request->isAjax()) {
          $builder = $this->modelsManager->createBuilder()
                          ->columns($this->dataTables_columns)
                          ->from(Country::class);

          $dataTables = new DataTable();

          $dataTables->setOptions([
            'limit'=> abs((int) $this->request->get('length'))
          ]);
          $dataTables->setIngoreUpperCase(true);

          $dataTables->fromBuilder($builder)
          ->addCustomColumn('c_status' , function ($key , $data) {
            $s = Country::getStatusById($data['status']);
            return "<span class='btn btn-$s->color btn-icon-split btn-sm p-0'>
                <span class='icon text-white-50'>
                  <i class='fas fa-$s->icon' style='width:20px'></i>
                </span>
                <span class='text'>$s->title</span>
            </span>";
          })
          ->addCustomColumn('c_actions' , function ($key , $data) {
            $id = $data['id'];
            $actions = "";
            if ($data['status'] != $this::DELETED)
                $actions .= 
                "<span title='Delete Row' data-action ='delete' data-id='$id' class='ml-1 btn btn-danger btn-circle btn-sm table-action-btn'><i class='fas fa-trash'></i></span>";
            if ($data['status'] == $this::DELETED)
                $actions .= 
                "<span title='Restore Row' data-action='restore' data-id='$id' class='ml-1 btn btn-info btn-circle btn-sm table-action-btn' ><i class='fas fa-trash-restore'></i></span>";

            $actions .= 
                "<a href='{$this->page->get('base_route')}/edit/$id' class='ml-1 btn btn-warning btn-circle btn-sm ' ><i class='fas fa-edit'></i></a>";


            return $actions;
          })
          ->sendResponse();
        }
        return  $this->ajax->error('Method Ajax is only allowed')->sendresponse();

_DataTable class source : https://github.com/yassinrais/sakura-panel/tree/master/app/library/datatables_

Check owner of database table. Maybe user(database), who use in connection doesn't have permissions.
For example, user owner table - postgres

Hello guys ! sorry for bothering you about this problem
i just resolve it today
i saw that my plugins in my script was deleting & uploading sql a size of 1.3MB each request (because of missing the column in plugin table who tell that plugin is installed or not )
thats why when i submit a multi request in same time .. the table was deleted by the first request (and the installed column was not existed so .. when i save that is installed in plugins table ... it does not save installed )
and the seconds one can not find the table , that why its make each time a random error about inexistant table 'name'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kkstun picture kkstun  路  3Comments

mynameisbogdan picture mynameisbogdan  路  3Comments

dimak08 picture dimak08  路  3Comments

sharptry picture sharptry  路  3Comments

TimurFlush picture TimurFlush  路  3Comments