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
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'