Created attachment 627283 [details] The wordpress page before jenkins build. Description of problem: When I tested on devenv_2327, I firstly created a wordpress application. Since it takes a long time to deploy(as the bug 863930 say), I restart it used CLI, then I tried to visit the app url, and got error page shown: "Error establishing a database connection" as attachment #1 [details] shown. Then I tried to build Jenkins with the wordpress app. After successful built the wordpress app, the app url can be visit , and the page shown normally without error . Then I tried to changed domain name. Then I found the app page shown not correctly as attachment #2 [details] shown. Version-Release number of selected component (if applicable): devenv_2327 How reproducible: always Steps to Reproduce: 1.Go to the website, and create a wordpress application. 2.Restart the app used CLI ($ rhc app restart -a wordpress -l mgao+dev491 -p redhat) 3.Visit the app url. 4.Enable Jenkins to the app, and then build it with jenkins. 5.Visit the app url again. 6.Change the domain name. 7.Visit the app url again. Actual results: After step 3, I got an error page with messages:"Error establishing a database connection". After step 5, I got the right wordpress page. After step 6, the page cannot be shown correctly as attachment #2 [details] shown. Expected results: When I visit the app url, it should be always right displayed. Additional info: I saw these word in the console output when building wordpress, so it likely used the dev/typeless branch. -------------------------------------------------------------------------- ....... Fetching upstream changes from ssh://a9bddf8efc40480498fc8f3b6cdbc041.rhcloud.com/~/git/wordpress22.git/ Seen branch in repository origin/HEAD Seen branch in repository origin/dev/typeless Seen branch in repository origin/master Commencing build of Revision fb422720ff3aa87daff4cef5a44b1e99f4b66bad (origin/dev/typeless) Checking out Revision fb422720ff3aa87daff4cef5a44b1e99f4b66bad (origin/dev/typeless) No change to record in branch origin/dev/typeless ....... ----------------------------------------------------------------------
Created attachment 627284 [details] The wordpress page after jenkins build and domain name change.
Are you running step 2 before step 1 is finished?
Tested this issue on devenv_2340 without step 2. And the same issue exists on devenv_2340. The steps as below: 1.Go to the website, and create a wordpress application. 2.Wait for a while until the app's status to be "STARTED", then Visit the app url. 3.Enable Jenkins to the app, and then build it with jenkins. 4.Visit the app url again. 5.Change the domain name. 6.Visit the app url again. and result as below: After step 2, The wordpress app status is "STARTED" ,But the app url redirected an error page with messages:"Error establishing a database connection". After step 4, I got the right wordpress page. After step 6, the page cannot be shown correctly as attachment #2 [details] shown. (In reply to comment #2) > Are you running step 2 before step 1 is finished?
Tested on INT(devenv_2572), this issue still exists, the reproduce steps as below: 1.Go to openshift website and login 2.Create a wordpress application 3.Change the domain name After step3, the page of wordpress is not correct as above screenshot.
This happens because we have absolute URLs for links hardcoded in the mysql database. We populate the database during the deploy action hook. Created a pull request on the wordpress-example repository. Also, another much older pull request that avoids populating the database would probably resolve this issue as well.
*** Bug 914845 has been marked as a duplicate of this bug. ***
*** Bug 892119 has been marked as a duplicate of this bug. ***
Wordpress stores absolute URLs for all links in its database. When we change the domain name, those links need to be updated. Probably a update_namespace user hook where the database dump is taken as a sql file, and all references to the application dns changed and then the database imported again. This, however, is too disruptive and we need to look for better alternatives.
This is no longer an issue since we do not allow namespace updates on doamins with applications.
Verified in devenv_3101 Step: 1.Log in website 2.Create a wordpress application 3.Access the url 4.Jenkins build the app Result: 3.Can access the url successfully. 4.Jenkins build successfully,and the app's url can be accessed.