Page MenuHomePhabricator

Construction of a DateTime() with epoch raised an exception
Closed, InvalidPublic

Description

Occasionally we receive the following error message in our Recent Activity Widget in the standard dashboard we setup as a welcome page:

Exception: Construction of a DateTime() with epoch '1443021184.9325991675' raised an exception.

Last thing I remember doing, was some wiki editing. Any help is appreciated.

Selection_113.png (249×831 px, 29 KB)

Event Timeline

chr86 updated the task description. (Show Details)
chr86 added a subscriber: chr86.

I've not seen this before, so we would definitely need more steps to reproduce if you can come up with them.

The full stack track from your PHP error log would be useful as well.

epriestley claimed this task.
epriestley added a subscriber: epriestley.

Closing because we aren't able to reproduce this.

Please provide the steps to reproduce

i don't know how it happens, just sometimes it shows me that error, and some times it goes away

the error apears when function "phabricator_format_local_time" in phabricator/src/view/viewutils.php, gets a $epoch var that for some reason has a decimal point, so when some sort of activity somehow manages to get a timestamp from something like pushing a commit that has a decimal point, DateTime() will throw and exception, i don't know how phabricator manages to get that decimal point there, but i recently pushed a commit and it seems phabricator gave it a timestamp of "1449419124.4675491878", so anything that displays list of my activities (including my profile page) gets this error because of the invalid time stamp. i think there should be some code to make sure the timestamp is a rounded int.

There should be a stack trace in your web server logs. We're only interested in the root issue.

I assume your install is at HEAD, correct?

2015/12/06 20:28:44 [error] 7203#0: *9085 FastCGI sent in stderr: "[2015-12-06 19:28:43] EXCEPTION: (Exception) Construction of a DateTime() with epoch '1449419124.4675491878' raised an exception. at [<phabricator>/src/view/viewutils.php:86]
arcanist(head=master, ref.master=9e78d15fc0c7), phabricator(head=master, ref.master=5b4825cf1eea), phutil(head=master, ref.master=5538909d6468)

#0 <#2> phabricator_format_local_time(string, PhabricatorUser, string) called at [<phabricator>/src/view/viewutils.php:7]
#1 <#2> phabricator_date(string, PhabricatorUser) called at [<phabricator>/src/view/viewutils.php:20]
#2 <#2> phabricator_relative_date(string, PhabricatorUser) called at [<phabricator>/src/applications/feed/builder/PhabricatorFeedBuilder.php:46]
#3 <#2> PhabricatorFeedBuilder::buildView() called at [<phabricator>/src/applications/people/controller/PhabricatorPeopleProfileController.php:251]
#4 <#2> PhabricatorPeopleProfileController::buildPeopleFeed(PhabricatorUser, PhabricatorUser) called at [<phabricator>/src/applications/people/controller/PhabricatorPeopleProfileController.php:165]
#5 <#2> PhabricatorPeopleProfileController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:29]
#6 <#2> AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:237]
#7 phlog(Exception) called at [<phabricator>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:32]
#8 PhabricatorDefaultRequestExceptionHandler::handleRequestException(AphrontRequest, Exception) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:632]
#9 AphrontApplicationConfiguration::handleException(Exception) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:242]
#10 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicati

pulled latest version still same

chad edited projects, added Feed; removed Dashboards.

Feed Story's getEpoch() is doing some serious magic: https://secure.phabricator.com/diffusion/P/browse/master/src/applications/feed/storage/PhabricatorFeedStoryData.php;20e6a4200dbc72760ea5de4eb15053bc1b2c8dac$41

@nnnn20430: Is your system 32 or 64 bits? Do you have the bc extension? Do you have any database issues (Visit "config" tab).

@avivey: 32bit, yes, no
and the error just went away...

Probably can try to install bc and report back if you still see it. What MySQL version are you running?

Closing for lack of feedback. Specifically we'd need to know exactly how to reproduce this locally before attempting any fixes.