Comments (7)
Are u sure the logging is the problem? What if u disable the db logging?
from cakephp-databaselog.
The error does not appear when I revert to file logging. Strangely, I'm not logging anything in my file upload method. Perhaps there's default logging for all actions?
from cakephp-databaselog.
No some error must happen then. Maybe invalid db credentials. stack trace should tell u more.
from cakephp-databaselog.
The credentials are fine and am able to log in other actions. However, this particular action accepts a json request with a file attachment throws the error below:
Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 16384 bytes) in /var/www/mcaz_ctr_dev/vendor/dereuromark/cakephp-databaselog/src/Model/Table/DatabaseLogsTable.php on line 69
Fatal error: Allowed memory size of 2151677952 bytes exhausted (tried to allocate 262144 bytes) in /var/www/mcaz_ctr_dev/vendor/cakephp/cakephp/src/ORM/Marshaller.php on line 281
from cakephp-databaselog.
aha, so the blob file data might be the cause.
what are u logging here?
from cakephp-databaselog.
Not logging anything in my action (below). I suspect the upload plugin may be logging something automatically.
public function addAttachments()
{
$application = $this->Applications->get($this->request->getData('foreign_key'), ['contain' => [], 'fields' => ['id', 'user_id']]);
if (empty($application)) {
$this->response->body('Failure');
$this->response->statusCode(403);
$this->set([
'errors' => 'The application does not exist',
'message' => 'Failure',
'_serialize' => ['errors','message']]);
return;
}
//$category = $this->request->getData();
if ($this->request->is('post')) {
$application = $this->Applications->patchEntity($application, $this->request->getData());
if ($this->Applications->save($application)) {
$this->set([
'message' => 'Success',
//'category' => $category,
'content' => $application['attachments'],
'_serialize' => ['message', 'content', 'category']]);
return;
} else {
$this->response->body('Failure');
$this->response->statusCode(403);
$this->set([
'errors' => $application->errors(),
'message' => 'Failure',
'_serialize' => ['errors','message']]);
return;
}
}
$this->set(compact('application'));
$this->set('_serialize', ['application']);
}
from cakephp-databaselog.
Well, you need to find the point where it logs and debug the data it tries to log. To find out why this fails.
Then, once reproducible we can find out how to fix things.
from cakephp-databaselog.
Related Issues (18)
- Add monitor shell command HOT 1
- Fix postgres compatability
- Building a dashboard HOT 1
- Missing route HOT 2
- Duplicate errors being written to the DB table HOT 8
- Unit-Testing doesn't seem to work HOT 2
- Some fatal/syntax errors do not log HOT 9
- use datetime instead of timestamp HOT 1
- Deprecated errors HOT 2
- Add summary field for paginated filter backend
- Missing Controller Error HOT 4
- DatbaseLogsTable::ensureTables() causes app to crash in environments without test connection HOT 5
- Cake 4.3 Routing deprecation HOT 1
- New release HOT 2
- Three debug messages are produced by the plugin tests HOT 1
- Bad Gateway HOT 2
- working with AuthComponent HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cakephp-databaselog.