Bug 1111115 - Fail to migrate php app due to Errors encountered executing step upgrade_script_php
Summary: Fail to migrate php app due to Errors encountered executing step upgrade_scri...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Vojtech Vitek
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-19 09:46 UTC by Yan Du
Modified: 2015-05-15 00:43 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-15 10:31:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
detail log (67.55 KB, text/plain)
2014-06-19 09:48 UTC, Yan Du
no flags Details
detail log new (101.17 KB, text/plain)
2014-06-20 08:18 UTC, Yan Du
no flags Details

Description Yan Du 2014-06-19 09:46:29 UTC
Description of problem:

1. Got below error when migrate php app: (detail log has attached.)

"context":{"cartridge":"php","compatible":false}},"upgrade_script_php":{"status":"incomplete","errors":["Upgrade script for php returned a non-zero exit code (1)"],"context":{"cartridge":"php","rc":1,"stdout":"","stderr":"chcon: missing operand\nTry `chcon --help' for more information.\n"}}},"upgrade_complete":false,"errors":[{"message":"Errors encountered executing step upgrade_script_php","backtrace":"/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.26.7/lib/openshift-origin-node/utils/upgrade_progress.rb:42:


2. Visit the app, got 503 in web. but after restart it , app could show normally in web.


3. ssh into the app, got some bash error 

[root@localhost test]# rhc ssh p54s
Connecting to 53919dbb03ef6489a7000027.rhcloud.com ...
bash: export: `OPENSHIFT_PHP_LOG_DIR.erb=<%= ENV['OPENSHIFT_LOG_DIR'] %>': not a valid identifier
bash: export: `PHP_INI_SCAN_DIR.erb=<%= ENV['OPENSHIFT_PHP_DIR'] %>configuration/etc/php.d': not a valid identifier
bash: export: `PHPRC.erb=<%= ENV['OPENSHIFT_PHP_DIR'] %>configuration/etc/php.ini': not a valid identifier
bash: export: `OPENSHIFT_PHP_LOG_DIR.erb=<%= ENV['OPENSHIFT_LOG_DIR'] %>': not a valid identifier
bash: export: `PHP_INI_SCAN_DIR.erb=<%= ENV['OPENSHIFT_PHP_DIR'] %>configuration/etc/php.d': not a valid identifier
bash: export: `PHPRC.erb=<%= ENV['OPENSHIFT_PHP_DIR'] %>configuration/etc/php.ini': not a valid identifier




Version-Release number of selected component (if applicable):
migrate from devenv_stage_883 to devenv_4890



How reproducible:
always



Steps to Reproduce:
1. Create php-5.3/php-5.4 app in old server
2. Do upgrade and migration


The detail steps for upgrade and migrate as below:

> Update broker and site:
cat > /etc/sysconfig/docker <<EOF
other_args="-dns 172.16.0.23"
EOF

docker pull ci.dev.openshift.redhat.com:5000/rhc-broker
docker tag ci.dev.openshift.redhat.com:5000/rhc-broker rhc-broker
docker pull ci.dev.openshift.redhat.com:5000/rhc-site
docker tag ci.dev.openshift.redhat.com:5000/rhc-site rhc-site

> Update node and cartridges:
scp -i libra.pem -r root@$devenv_4890:/root/devenv-local /root/
scp -i libra.pem -r root@$devenv_4890:/etc/yum.repos.d/* /etc/yum.repos.d/
yum update -y --enablerepo devenv-local 

> Restart services after upgrade:
/etc/init.d/rhc-broker restart
/etc/init.d/rhc-site restart
service ruby193-mcollective restart
service rhc-datastore restart

> Migrate mongo (do not support in this sprint)
oo-broker --non-interactive rhc-admin-migrate-datastore --version 2.0.46 --non-compatible
oo-broker --non-interactive rhc-admin-migrate-datastore --version 2.0.46 --compatible

> Migrate node
oo-broker --non-interactive oo-admin-upgrade upgrade-node --version 2.0.46 --ignore-cartridge-version




Actual results:
Same as description


Expected results:
migrate successfully


Additional info:

1. Check the devenv_stage server after migration, the fix seems already there
    chown $OPENSHIFT_GEAR_UUID:$OPENSHIFT_GEAR_UUID ${OPENSHIFT_HOMEDIR}.composer
    chcon -u ${OPENSHIFT_HOMEDIR}.composer

2. The perl and nodejs app could migrate successfully, just php failed.

Comment 1 Yan Du 2014-06-19 09:48:01 UTC
Created attachment 910314 [details]
detail log

Comment 2 Vojtech Vitek 2014-06-19 10:04:45 UTC
https://github.com/openshift/origin-server/pull/5525

Comment 3 Yan Du 2014-06-19 10:08:26 UTC
Hi, Vojtech Vitek

Check the php/bin/upgrade after migration, the fix in https://github.com/openshift/origin-server/pull/5525 is already there, but the php migration still failed.

Comment 4 Vojtech Vitek 2014-06-19 12:13:45 UTC
Can you retest, once devenv_4892 is ready?

Comment 5 Ben Parees 2014-06-19 13:29:26 UTC
Paul was just working in this space too, adding him just in case.

Comment 6 Yan Du 2014-06-20 08:17:43 UTC
migrate from devenv_stage_833 to devenv_stage_890

Still got the same error for php apps.

New log has attached. pls. check.

Comment 7 Yan Du 2014-06-20 08:18:25 UTC
Created attachment 910685 [details]
detail log new

Comment 8 Meng Bo 2014-06-20 08:56:51 UTC
Found the error in upgrade log:

                "upgrade_script_php": {
                    "context": {
                        "cartridge": "php", 
                        "rc": 1, 
                        "stderr": "chcon: missing operand\nTry `chcon --help' for more information.\n", 
                        "stdout": ""

Seems the chcon missing a label in this change https://github.com/openshift/origin-server/pull/5525/files#diff-d45387ca752ada2c920939a5deacda82R47

Comment 10 openshift-github-bot 2014-06-20 12:16:28 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/783f245d480d1d65a896c14ccbd6269180904dc6
Fix php upgrade for 0.0.17 - bug 1111115

ref. commit dcb3324168858888e4a1d31e897ceb20b2af5a20,
     commit 715cce8b70d8f0b6d1f17413b1c8153d07e31915

https://bugzilla.redhat.com/show_bug.cgi?id=1111115

Comment 11 Yan Du 2014-06-23 07:09:15 UTC
Migrate from devenv_stage_883 to devenv_stage_893

All the php apps could work normally after migration.

Issue have been fixed, Move bug to verified.


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