Bug 1126646

Summary: Changes to wildfly datasource jndi name are ignored. Default JNDI name used in all cases even when standalone.xml is directly edited.
Product: OpenShift Online Reporter: Andrew <andrew.fritz>
Component: ImageAssignee: Ben Parees <bparees>
Status: CLOSED INSUFFICIENT_DATA QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: andrew.fritz, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-15 14:19:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew 2014-08-05 01:28:14 UTC
Description of problem:

The ability to change the jndi name for the mysql datasource doesn't work. Disabling the data source and changing the name results in the name changing in the UI, but the datasource will not reenable and the managment console shows a generic "an error occured" message in the overlay at the top. Directly editing the standalone.xml file to set the correct jndi name for my application worked until a restart of the application server was required. The name reverted to the original default even though the standalone.xml file still shows the correct (edited) JNDI name. 

Setting this name arbitrarily works on my local wildfly instance. The jndiname in question is java:/MinervaPortalDS which is a legal JNDI name as far as I know. 


Version-Release number of selected component (if applicable):
Current openshift cartridge version (8.1.0 of wildfly)

How reproducible:
Each and every gear restart, or if the gear is idle for a period of time. 


Steps to Reproduce:
1) Setup a fresh wildfly cartridge with a mysql instance. 
2) Attempt to use the mysql datasource after changing the jndi name. 

Actual results:
The datasource can no longer be enabled. The new JNDI name is not available to deployments resulting in unsatisfied dependencies. 

Expected results:
The datasource's jndi name should change and be available to deployments. 


Additional info:

Comment 1 Ben Parees 2014-08-05 17:18:58 UTC
Where did you edit the standalone.xml?  The only place you can make changes to the configuration and expect them to persist is in the .openshift/config/standalone.xml file in your app repository (and then you must push that change)

Otherwise changes you make will be overwritten when the app is restarted, as you observed.

Comment 2 Ben Parees 2014-08-15 14:19:10 UTC
Have not heard from reporter for 10 days...closing.

Andrew, please reopen if you can provide the information from comment #1, otherwise I'm afraid I can't make progress on diagnosing this bug.

Comment 3 Andrew 2014-08-15 14:25:19 UTC
Sorry for the lack of reply. I thought Bugzilla would notify me of updates to the ticket. 

I was editing it in ~/wildfly/standalone/configuration. It is likely that is the problem. I saw no documentation about that. However, shouldn't changes in the management console "take" or are those intended to be transient also? 

Andrew

Comment 4 Ben Parees 2014-08-15 15:24:38 UTC
Those are also transient unless you set the following environment value:
DISABLE_OPENSHIFT_MANAGED_SERVER_CONFIG=true

if you set that, then openshift will not replace your config on each startup and you can freely manipulate it either by hand or via the console.

I believe you can also remove the standalone.xml from your .openshift/config directory in your repo and push the change, from then on the config will not be replaced on startup (since there is no config in your repo anymore).  But the env variable is the intended way to get this behavior.

Comment 5 Andrew 2014-08-15 16:33:23 UTC
Ok. Thanks!