Whenever I publish an article setting "published = true", and setting a published date/time, I get this error:

I then have to go into the database directly and set the published_at field. Any help on why this is happening?
I am using the latest OctoberCMS + latest plugin. I am using SQL Server with October CMS.
Any help would be appreciated.
Check your error logs and see if you can get a stack trace.
Or maybe try to use a different SQL engine (SQLite) to test where the problem is.
Where do I find the error logs?
In backend administration in Settings >聽Event log.
Or in file system: /storage/logs/system.log.
Closing as it has been over a month since any activity on this occurred.
this issue is surfacing on Windows 2019 server:
timezone: Asia/Singapore
Windows Region date format has been updated to M/d/yyyy
here is the trace:
InvalidArgumentException: Data missing in C:\STTC\vendor\nesbot\carbon\src\Carbon\Carbon.php:917
Stack trace:
#0 C:\STTC\vendor\jenssegers\date\src\Date.php(100): Carbon\Carbon::createFromFormat()
#1 C:\STTC\vendor\october\rain\src\Database\Model.php(562): Jenssegers\Date\Date::createFromFormat()
#2 C:\STTC\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Concerns\HasAttributes.php(738): October\Rain\Database\Model->asDateTime()
#3 C:\STTC\vendor\october\rain\src\Database\Model.php(579): Illuminate\Database\Eloquent\Model->fromDateTime()
#4 C:\STTC\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Concerns\HasAttributes.php(532): October\Rain\Database\Model->fromDateTime()
#5 C:\STTC\vendor\october\rain\src\Database\Model.php(1214): Illuminate\Database\Eloquent\Model->setAttribute()
#6 C:\STTC\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1394): October\Rain\Database\Model->setAttribute()
#7 C:\STTC\vendor\october\rain\src\Extension\ExtendableTrait.php(387): Illuminate\Database\Eloquent\Model->__set()
#8 C:\STTC\vendor\october\rain\src\Database\Model.php(635): October\Rain\Database\Model->extendableSet()
#9 C:\STTC\modules\backend\traits\FormModelSaver.php(81): October\Rain\Database\Model->__set()
#10 C:\STTC\modules\backend\traits\FormModelSaver.php(40): Backend\Behaviors\FormController->setModelAttributes()
#11 C:\STTC\modules\backend\behaviors\FormController.php(317): Backend\Behaviors\FormController->prepareModelsToSave()
#12 [internal function]: Backend\Behaviors\FormController->update_onSave()
#13 C:\STTC\vendor\october\rain\src\Extension\ExtendableTrait.php(411): call_user_func_array()
#14 C:\STTC\modules\backend\classes\Controller.php(184): Backend\Classes\Controller->extendableCall()
#15 [internal function]: Backend\Classes\Controller->__call()
#16 C:\STTC\modules\backend\classes\Controller.php(620): call_user_func_array()
#17 C:\STTC\modules\backend\classes\Controller.php(478): Backend\Classes\Controller->runAjaxHandler()
#18 C:\STTC\modules\backend\classes\Controller.php(277): Backend\Classes\Controller->execAjaxHandlers()
#19 C:\STTC\modules\backend\classes\BackendController.php(165): Backend\Classes\Controller->run()
#20 [internal function]: Backend\Classes\BackendController->run()
@chrisvidal What is your app.timezone config in config/app.php?
@chrisvidal What is your
app.timezoneconfig inconfig/app.php?
Asia/Singapore
in config/cms.php as well
@chrisvidal app.timezone should generally be kept as UTC. cms.backendTimezone can be changed to Asia/Singapore. Try changing it back to that and see if that works.
we tried that to leave it on UTC but the exception is still there.
I also tried unsuccessfully to use ignoreTimezone: true in the .yaml, still the exception shows up
@chrisvidal can you modify vendor/october/rain/src/database/model.php asDateTime()
return Argon::createFromFormat(
str_replace('.v', '.u', $this->getDateFormat()),
$value
);
to dd($this->getDateFormat(), $value) and then post the results?
Also what DB driver are you using?
alright thanks @LukeTowers
I will do so next week, after the client give me remote access to their server hopefully.
result is 2020-07-10 06:30:00 for the 10th of July
@chrisvidal I need to see both variables, what is the output of $this->getDateFormat()?
damnit I didn't get it, as it showed up in a long dialog box, sorry
I'll need to see it in order to help further.
I understand, but we are going to have to wait - I do not have any more access to the client server as we are biding for their project, testing OC installation on their Windows env.
I will be able to know more if we win the project in the next few days/weeks.
Sounds good, looking forward to an update.
alright, I am facing the problem now, since I am doing the installation on this Winder Server.
same error
so the results from dd($this->getDateFormat(), $value) is
"Y-m-d H:i:s.v"
"2020-10-12 02:49:40.673"
settings are as such app.timezone kept as UTC.
cms.backendTimezone can be changed to Asia/Singapore
results coming upon saving a new article in the blog plugin:
"Y-m-d H:i:s.v"
"2020-10-12 03:32:38.420"
after some digging, the blog post published date returns the value 2020-10-29 11:20:00 and the expected format is Y-m-d H:i:s.v. So apparently there is missing this .v expected from the format here.
meaning that the datetime picker widget does not provide the expected format?
@chrisvidal I can tell you that the JS based datetime picker does not include microseconds in it's format. Why on earth is the .v in your expected datetime format?
Where does this expected date format come from?
We are on Windows Server 2019 though, SQL Server, PHP 7.4.
What could we explore to fix this?
Mmm not sure if related but looks like it https://github.com/laravel/framework/issues/27200 and here https://github.com/laravel/framework/issues/22407
@chrisvidal what version of the Laravel Framework are you using specifically?
I just installed the last OC version with the wizard installer. Not sure which Laravel Framework version it is.
@chrisvidal could you give https://github.com/octobercms/library/pull/528/files a try?
here is the october/rain composer.json file on the Microsoft / SQL Server machine, which I am surprised to see a completely different the one I have on my local machine
{
"name": "october/rain",
"description": "October Rain Library",
"homepage": "http://octobercms.com",
"keywords": ["october", "cms", "rain"],
"license": "MIT",
"authors": [
{
"name": "Alexey Bobkov",
"email": "[email protected]"
},
{
"name": "Samuel Georges",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.0",
"doctrine/dbal": "2.5.*",
"erusev/parsedown-extra": "~0.7",
"kriswallsmith/assetic": "~1.3",
"linkorb/jsmin-php": "~1.0",
"leafo/scssphp": "~0.6",
"symfony/yaml": "~3.2",
"twig/twig": "~2.0",
"league/csv": "~8.0",
"jenssegers/date": "~3.0",
"laravel/tinker": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~5.7",
"illuminate/database": "5.5.*",
"illuminate/filesystem": "5.5.*",
"illuminate/encryption": "5.5.*",
"illuminate/queue": "5.5.*",
"illuminate/support": "5.5.*",
"illuminate/log": "5.5.*",
"illuminate/mail": "5.5.*",
"illuminate/events": "5.5.*",
"illuminate/pagination": "5.5.*",
"illuminate/routing": "5.5.*",
"illuminate/validation": "5.5.*",
"illuminate/view": "5.5.*",
"illuminate/cache": "5.5.*",
"symfony/dom-crawler": "~3.1",
"symfony/css-selector": "~3.1",
"meyfa/phpunit-assert-gd": "1.1.0",
"squizlabs/php_codesniffer": "3.*",
"php-parallel-lint/php-parallel-lint": "^1.0"
},
"replace": {
"october/auth": "self.version",
"october/config": "self.version",
"october/database": "self.version",
"october/extension": "self.version",
"october/filesystem": "self.version",
"october/halcyon": "self.version",
"october/html": "self.version",
"october/mail": "self.version",
"october/network": "self.version",
"october/parse": "self.version",
"october/router": "self.version",
"october/support": "self.version",
"october/translation": "self.version"
},
"autoload": {
"files": [
"src/Support/helpers.php",
"src/Html/helpers.php",
"src/Parse/Assetic/Less/lessc.inc.php"
],
"psr-4": {
"October\\Rain\\": "src/"
},
"psr-0": {
"Less": "src/Parse/Assetic/Less/lib/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
],
"psr-4": {
"October\\Rain\\Tests\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
@chrisvidal were you able to apply https://github.com/octobercms/library/pull/528/files to see if that resolved your issue?
having a remote call with my client in 2 hours to check this out. will post results here.
ok it seems to be working, thanks so much @LukeTowers
However, I am facing multiple issues from SQL Server with "simple" Eloquent query from the component Posts for example the ORDER BY clause is invalid in views..., when a category of post is queried with an order by published_at. From the listForFrontEnd method in post.php model. Any experience with that by any chance?
@chrisvidal can you post the full error message you get for that / the full SQL statement it tries to run?
SQL Server]The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries
select * from [rainlab_blog_posts] where exists (select * from [rainlab_blog_categories] inner join [rainlab_blog_posts_categories] on [rainlab_blog_categories].[id] = [rainlab_blog_posts_categories].[category_id] where [rainlab_blog_posts].[id] = [rainlab_blog_posts_categories].[post_id] and [id] in (?) order by [nest_left] asc) order by [published_at] desc
@bennothommo can you take a look at the above?
Maybe it is better that I create a new thread for this?
(I am waiting to gain access to the client remote server through another remote pc to post the complete exception trace)
Continuing thread in https://github.com/rainlab/blog-plugin/issues/525.
Since the last OC 471 update, my client is facing again the date error issue when creating new post.
OC #471
rainlab blog 1.4.3
here are the errors:
"Data missing" on line 917 of D:\STTC\vendor\nesbot\carbon\src\Carbon\Carbon.php
and
InvalidArgumentException: Data missing in D:\STTC\vendor\nesbot\carbon\src\Carbon\Carbon.php:917
Stack trace:
#0 D:\STTC\vendor\jenssegers\date\src\Date.php(100): Carbon\Carbon::createFromFormat()
#1 D:\STTC\vendor\october\rain\src\Database\Model.php(561): Jenssegers\Date\Date::createFromFormat()
#2 D:\STTC\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Concerns\HasAttributes.php(738): October\Rain\Database\Model->asDateTime()
#3 D:\STTC\vendor\october\rain\src\Database\Model.php(578): Illuminate\Database\Eloquent\Model->fromDateTime()
#4 D:\STTC\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Concerns\HasAttributes.php(532): October\Rain\Database\Model->fromDateTime()
#5 D:\STTC\vendor\october\rain\src\Database\Model.php(1213): Illuminate\Database\Eloquent\Model->setAttribute()
#6 D:\STTC\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1394): October\Rain\Database\Model->setAttribute()
#7 D:\STTC\vendor\october\rain\src\Extension\ExtendableTrait.php(390): Illuminate\Database\Eloquent\Model->__set()
#8 D:\STTC\vendor\october\rain\src\Database\Model.php(634): October\Rain\Database\Model->extendableSet()
#9 D:\STTC\modules\backend\traits\FormModelSaver.php(81): October\Rain\Database\Model->__set()
#10 D:\STTC\modules\backend\traits\FormModelSaver.php(40): Backend\Behaviors\FormController->setModelAttributes()
#11 D:\STTC\modules\backend\behaviors\FormController.php(249): Backend\Behaviors\FormController->prepareModelsToSave()
#12 [internal function]: Backend\Behaviors\FormController->create_onSave()
#13 D:\STTC\vendor\october\rain\src\Extension\ExtendableTrait.php(414): call_user_func_array()
#14 D:\STTC\modules\backend\classes\Controller.php(184): Backend\Classes\Controller->extendableCall()
#15 [internal function]: Backend\Classes\Controller->__call()
#16 D:\STTC\modules\backend\classes\Controller.php(620): call_user_func_array()
#17 D:\STTC\modules\backend\classes\Controller.php(478): Backend\Classes\Controller->runAjaxHandler()
#18 D:\STTC\modules\backend\classes\Controller.php(277): Backend\Classes\Controller->execAjaxHandlers()
#19 D:\STTC\modules\backend\classes\BackendController.php(165): Backend\Classes\Controller->run()
#20 [internal function]: Backend\Classes\BackendController->run()
#21 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Controller.php(54): call_user_func_array()
#22 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()
#23 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Route.php(212): Illuminate\Routing\ControllerDispatcher->dispatch()
#24 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Route.php(169): Illuminate\Routing\Route->runController()
#25 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Router.php(658): Illuminate\Routing\Route->run()
#26 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#27 D:\STTC\modules\backend\classes\BackendController.php(68): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#28 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(131): Backend\Classes\BackendController->Backend\Classes\{closure}()
#29 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#30 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#31 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(149): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#32 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#33 D:\STTC\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#34 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(149): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#35 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#36 D:\STTC\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(63): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#37 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(149): Illuminate\Session\Middleware\StartSession->handle()
#38 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#39 D:\STTC\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#40 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(149): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#41 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#42 D:\STTC\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php(68): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#43 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(149): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#44 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#45 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#46 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Router.php(660): Illuminate\Pipeline\Pipeline->then()
#47 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Router.php(635): Illuminate\Routing\Router->runRouteWithinStack()
#48 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Router.php(601): Illuminate\Routing\Router->runRoute()
#49 D:\STTC\vendor\october\rain\src\Router\CoreRouter.php(20): Illuminate\Routing\Router->dispatchToRoute()
#50 D:\STTC\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(176): October\Rain\Router\CoreRouter->dispatch()
#51 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#52 D:\STTC\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#53 D:\STTC\vendor\october\rain\src\Foundation\Http\Middleware\CheckForMaintenanceMode.php(25): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()
#54 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(149): October\Rain\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()
#55 D:\STTC\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#56 D:\STTC\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()
#57 D:\STTC\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(151): Illuminate\Pipeline\Pipeline->then()
#58 D:\STTC\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#59 D:\STTC\index.php(43): Illuminate\Foundation\Http\Kernel->handle()
Apparently, the vendor/october/rain/src/database/Model.php is still causing the same issue in this OC #471