Bug 971761 - Timezone cannot be set
Summary: Timezone cannot be set
Status: CLOSED DUPLICATE of bug 972356
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers   
(Show other bugs)
Version: 2.x
Hardware: Unspecified Unspecified
Target Milestone: ---
: ---
Assignee: Hiro Asari
QA Contact: libra bugs
Keywords: SupportQuestion
Depends On:
TreeView+ depends on / blocked
Reported: 2013-06-07 08:43 UTC by Raph
Modified: 2015-05-14 23:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
app running on jboss eap 6
Last Closed: 2013-06-17 19:28:18 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Raph 2013-06-07 08:43:13 UTC
Description of problem:
Timezone cannot be set to europe.
Before this could be could be done by setting jvm option in an action hooker
or setting time zone in .bash_profile

Version-Release number of selected component (if applicable):
started with the introduction of caridge version 2 a few days ago

How reproducible:

Steps to Reproduce:
1. add export JAVA_OPTS="-Duser.timezone=Europe/Zurich -Dfile.encoding=UTF-8" to the hooker pre_start_jbosseap-6.0
2. create a jsp that print out a date (<%@page import="java.util.*"%><%= new Date() %>

Actual results:
time displayed is the one somewhere in the us
Wed Jun 05 00:48:12 EDT 2013 (error was notice since this date)

Expected results:
time displayed should be the one in europe 
Wed Jun 05 06:48:12 CEST 2013 

Additional info:
Zurich timezone is avaliable if you run this code bellow (result see : http://fapp-esmart.rhcloud.com/test.jsp):
p>timezones : </p>
 String[] tzs = TimeZone.getAvailableIDs();
for(int i=0; i<tzs.length; i++)  {     
<p>iteration : <%= tzs[i] %></p>

Comment 1 Dan Mace 2013-06-10 17:50:23 UTC

Can you grant the OpenShift operations team permission to view the contents of your application's server logs and the source contents under ~/app-root/repo/.openshift?

I was able to create a new jbosseap-6.0 application and add a '.openshift/action_hooks/pre_start_jbosseap' (mode +x) with the following contents:

  export JAVA_OPTS="-Duser.timezone=Europe/Zurich -Dfile.encoding=UTF-8"

Which upon push yielded the following output from my test.jsp (same as the reported script):

  Mon Jun 10 19:46:00 CEST 2013

You can see the effect of the hook in /tmp/jbosseap.log in the application gear:

  Removing existing standalone.xml

    JBoss Bootstrap Environment

    JBOSS_HOME: /var/lib/openshift/51b608630a390e0f1f000001/jbosseap

    JAVA: /usr/lib/jvm/jre-1.7.0/bin/java

    JAVA_OPTS:  -server -XX:+TieredCompilation -Duser.timezone=Europe/Zurich -Dfile.encoding=UTF-8



Comment 2 Raph 2013-06-11 13:37:18 UTC
I grant the OpenShift operations team permission to view what you need, the only thing is: do I have to do something? if yes let me know.

My action hook was named : pre_start_jbosseap-6.0. Juste to make sure, I've create a copy named pre_start_jbosseap (as yours in your test) and added +x permissions.

The content of /tmp/jbosseap.log says:
Removing existing standalone.xml

  JBoss Bootstrap Environment

  JBOSS_HOME: /var/lib/openshift/513ca5b84382ec2b5a00005f/jbosseap

  JAVA: /usr/lib/jvm/jre-1.7.0/bin/java

  JAVA_OPTS:  -server -XX:+TieredCompilation -Xmx256m -XX:MaxPermSize=102m -XX:+AggressiveOpts -Dorg.apache.tomcat.util.LOW_MEMORY=true -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djboss.node.name=fapp-esmart.rhcloud.com -Djgroups.bind_addr= -Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on


I've changed the test script to be able to see the swiss and default time, on the same page (http://fapp-esmart.rhcloud.com/test.jsp).

I've also tried to export java options manually in ssh console and restart the app, but nothing change :

Comment 3 Hiro Asari 2013-06-13 18:33:15 UTC
Hi, Raph,

With the new version of the cartridges, we no longer use the action hooks with version numbers; i.e., pre_start_jbosseap-6.0 should now be named pre_start_jbosseap.

Could you rename your action hooks accordingly, and try again? (I tested the case you described above, and was successful.)

Further changes may be necessary. Please review https://www.openshift.com/blogs/version-2-cartridge-update-action-may-be-required

Thank you.

Comment 4 Dan Mace 2013-06-17 19:28:18 UTC
Closing as a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=972356

*** This bug has been marked as a duplicate of bug 972356 ***

Note You need to log in before you can comment on or make changes to this bug.