1

I having an strange situation,
in futon, the JavaSCript shell is returning date time in GMT+8,
which is inline with the server timezone.

However, when I tail the log file,
it is showing GMT -3, 11 hours difference.

I'm suspecting there is a configuration somewhere to fix this issue.
Anyone has an idea?

OS:- CentOS release 5.7 (2.6.18-194.11.4.el5)
Couchdb version :- Apache CouchDB 1.1.1
Erlang :- V5.8.1 (R14B (erts-5.8.1)) Log format:-

[Sun, 04 Dec 2011 04:10:06 GMT] [info] [<0.19767.816>] IP - - 'GET' URL 200

Current server time is 3pm

Here is the screen capture :-

Eshell V5.8.1  (abort with ^G)
1> {Date={Year,Month,Day},Time={Hour,Minutes,Seconds}} = erlang:localtime().
{{2011,12,6},{9,56,22}}

[root@localhost] ~ >> date
Tue Dec  6 09:56:41 SGT 2011

Here is the result of date :-

date && date -u
Tue Dec  6 12:03:35 SGT 2011
Tue Dec  6 04:03:35 UTC 2011

NOTE: I might confuse over the GMT log format (likely my wrong interpretation)

@JeffSnider - I think you are close, most likely is my mis-understanding originally

1> httpd_util:rfc1123_date().
"Tue, 06 Dec 2011 04:09:19 GMT"
ajreal
  • 183
  • 12
  • What is the OS that couchdb is running on? Can you provide an example of the time as it appears in the log? What version of couchdb? What version of erlang? – Jeff Snider Dec 04 '11 at 04:52
  • Could you run "date;date -u" and add that output? – Jeff Snider Dec 05 '11 at 19:08
  • This may be easier to work on over instant messages and include the solution here after we've sorted it out. Would that be ok? – Jeff Snider Dec 06 '11 at 03:59
  • Give httpd_util:rfc1123_date(). a shot in erl too. That is the specific function that couchdb uses in its log writer function. – Jeff Snider Dec 06 '11 at 04:08
  • @JeffSnider - looks like the GMT offset? (previously there is 11 hours difference, but now is 8 hr, I hugely suspect I seeing something wrong previously)' – ajreal Dec 06 '11 at 04:08
  • Restart couchdb completely, give it a try in a browser, and grab the last log line. Everything is looking good so far. Maybe it is just couchdb that has the date oddity? – Jeff Snider Dec 06 '11 at 04:11
  • If couchdb is still showing the gmt date offset, take a look at the environment with **cat /proc/\`pgrep beam\`/environ |tr "\000" "\n"** – Jeff Snider Dec 06 '11 at 04:24

1 Answers1

0

I suspect it is the clock or timezone settings at the os level rather than a couchdb or erlang configuration issue. If your clock and timezone is correct (the date command I asked for show that for sure) then I would like to look into the environment that beam is running with. There could be a hint there.

I know that's not the answer you're hoping for but from what I can tell, there isn't a configuration for couch or erlang that would control this. The date and time in the log is retrieved from the built in erlang library httpd_util using the rfc1123_date() function. I haven't been able to find anything that would make that return anything but the time in GMT.

Jeff Snider
  • 3,252
  • 17
  • 17