Log message #4101579

# At Username Text
# Dec 6th 2017, 15:46 tomicapo Thanks @dereuromark I'll write again if I find the user cron runs with is the correct one and has permission.
# Dec 6th 2017, 15:46 tomicapo Just wanted to check here since I found an issue on github for an earlier version referencing this L10n class.
# Dec 6th 2017, 15:45 tomicapo I will investigate what user cron runs with. Maybe it's a cPanel issue....
# Dec 6th 2017, 15:45 dereuromark yeah that wont make any difference, it cant load the file for other reasons.
# Dec 6th 2017, 15:44 tomicapo I tried to downgrade to 2.10.4 but the error still occured.
# Dec 6th 2017, 15:44 dereuromark interesting, then it should find it just fine still.
# Dec 6th 2017, 15:44 tomicapo Cake is installed via composer.
# Dec 6th 2017, 15:44 tomicapo This is not a new installation. It has been working for years.
# Dec 6th 2017, 15:44 tomicapo The line is present and ok.
# Dec 6th 2017, 15:43 dereuromark most common beginner mistake is to run shell commands or cronjobs with root user or a non-www-data one, killing not only cache but also file structure, also for deploy should usually be the www-data one.
# Dec 6th 2017, 15:43 dereuromark could also have the wrong permissions, so it cannot read that file. make sure they have the same user as cronjob, usually the group of www-data :slightly_smiling_face:
# Dec 6th 2017, 15:41 dereuromark See https://github.com/cakephp/cakephp/blob/2.x/lib/Cake/I18n/I18n.php#L20 thats how the file should look like
# Dec 6th 2017, 15:40 dereuromark What does your I18n contain? Does it miss the L10n use statement? Maybe you are using an outdated 2.x file?
# Dec 6th 2017, 15:36 tomicapo File uploaded https://cakesf.slack.com/files/U1USW7KLP/F8BKUG1FZ/-.php / https://slack-files.com/T053DPNCM-F8BKUG1FZ-bcd63bfc67
# Dec 6th 2017, 15:35 tomicapo I'm debugging with just that and I get the error above.
# Dec 6th 2017, 15:34 tomicapo I don't think there's anything I should use App:uses() for...
# Dec 6th 2017, 15:34 tomicapo Actually, my shell's main method only contains: $this->log('test'); exit;
# Dec 6th 2017, 15:33 tomicapo I guess... Let me check.
# Dec 6th 2017, 15:33 dereuromark missing to do so would explain it, it is similar to modern use statements, always all used classes per file, no exceptions :slightly_smiling_face:
# Dec 6th 2017, 15:33 dereuromark @tomicapo Are you properly App::uses() all your used classes per file?
# Dec 6th 2017, 15:32 dereuromark never heard of this :c... thing
# Dec 6th 2017, 15:32 dereuromark rbl222 most likely, yeah
# Dec 6th 2017, 15:31 tomicapo :s
# Dec 6th 2017, 15:31 tomicapo This only happens when the console task is invoked by cron.
# Dec 6th 2017, 15:31 tomicapo Any ideas?
# Dec 6th 2017, 15:30 tomicapo PHP v 7.1 (cPanel provided)
# Dec 6th 2017, 15:30 slackebot ConsoleErrorHandler->handleException(Object(Error)) #5 {main} thrown in /home/pezca/public_html/app/vendor/cakephp/cakephp/lib/Cake/I18n/I18n.php on line 163
# Dec 6th 2017, 15:30 slackebot /home/pezca/public_html/app/vendor/cakephp/cakephp/lib/Cake/I18n/I18n.php(198): I18n::getInstance() #2 /home/pezca/public_html/app/vendor/cakephp/cakephp/lib/Cake/basics.php(636): I18n::translate('<error>Error:</...', NULL, 'cake_console') #3 /home/pezca/public_html/app/vendor/cakephp/cakephp/lib/Cake/Console/ConsoleErrorHandler.php(59): __d('cake_console', '<error>Error:</...', 'Class 'I18n' no...', '#0 /home/pezca/...') #4 [internal function]:
# Dec 6th 2017, 15:30 tomicapo Hi, I'm having a problem running a console task on CakePHP 2.10.5 on a linux server. This was working fine until suddenly I started seeing errors in the log File. This is the error: PHP Fatal error: Uncaught Error: Class 'L10n' not found in /home/pezca/public_html/app/vendor/cakephp/cakephp/lib/Cake/I18n/I18n.php:163 Stack trace: #0 /home/pezca/public_html/app/vendor/cakephp/cakephp/lib/Cake/I18n/I18n.php(174): I18n->__construct() #1
# Dec 6th 2017, 15:28 rbl222 I'm wondering if I set my charvar defaults to DEFAULT NULL instead of DEFAULT NULLL::character varying would be easier?
# Dec 6th 2017, 15:24 dereuromark Sry, this one: https://github.com/dereuromark/cakephp-shim/blob/master/src/Database/Type/JsonType.php
# Dec 6th 2017, 15:24 dereuromark but it would sure be better to have a core improvement here (for BC probably safer to go for 3.6 then)
# Dec 6th 2017, 15:23 dereuromark @rbl222 for json type I fixed it in https://github.com/dereuromark/cakephp-shim/blob/master/src/Model/Behavior/NullableBehavior.php
# Dec 6th 2017, 15:17 saeideng Or DB type
# Dec 6th 2017, 15:17 saeideng you can use beforemarshal event
# Dec 6th 2017, 15:16 rbl222 I am using json type, but not sure how that would affect cake setting default values differently
# Dec 6th 2017, 15:16 rbl222 will do
# Dec 6th 2017, 15:14 dereuromark you can either open a ticket or better yet provide a PR with a fix for the ORM to respect null for varying
# Dec 6th 2017, 15:14 dereuromark interesting: so far I only know of this when using json type.
# Dec 6th 2017, 15:12 rbl222 I have a postgres table field set to character varying(20) with a default of NULL::character varying but CakePHP mistakenly fills in the default as a string 'NULL::character varying' instead... Is there a way to have cake honor the default value correctly instead of interpreting it as a string?
# Dec 6th 2017, 13:40 jkpatel291289 yes, it is.. thanks:relaxed: