Bug 1018483

Summary: Creating a spree application fails
Product: OpenShift Online Reporter: Marek Mahut <mmahut>
Component: ContainersAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED UPSTREAM QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: dmcphers, mfojtik
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: 2013-10-18 21:46:54 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 Marek Mahut 2013-10-12 12:44:42 UTC
Description of problem:

Tried with both small and medium gear.

$ rhc app create -a spree -t ruby-1.9  --from-code=https://github.com/sarupbanskota/OpenShift-Quickstart-for-Spree.git --trace
Password: ***********

Application Options
-------------------
  Namespace:   mmahut
  Cartridges:  ruby-1.9
  Source Code: https://github.com/sarupbanskota/OpenShift-Quickstart-for-Spree.git
  Gear Size:   default
  Scaling:     no

Creating application 'spree' ... /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/rest/client.rb:425:in `handle_error!': The initial build for the application failed: Shell command '/sbin/runuser -s /bin/sh 5259431c50044607ea000057 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c3,c617' /bin/sh -c \"gear postreceive >> /tmp/initial-build.log 2>&1\""' returned an error. rc=255 (RHC::Rest::ValidationException)

.Last 10 kB of build output:
1c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.13/lib/mysql2/client.rb:58:in `initialize'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:224:in `table_exists?'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/app/models/spree/preferences/store.rb:89:in `should_persist?'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/app/models/spree/preferences/store.rb:37:in `get'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/app/models/spree/preferences/preferable_class_methods.rb:17:in `block in preference'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/app/models/spree/preferences/preferable.rb:34:in `get_preference'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/app/models/spree/calculator/shipping/flat_rate.rb:7:in `<class:FlatRate>'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/app/models/spree/calculator/shipping/flat_rate.rb:5:in `<module:Shipping>'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/app/models/spree/calculator/shipping/flat_rate.rb:4:in `<module:Spree>'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/app/models/spree/calculator/shipping/flat_rate.rb:3:in `<top (required)>'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:359:in `require_or_load'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:502:in `load_missing_constant'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:192:in `block in const_missing'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:190:in `each'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:190:in `const_missing'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/bundler/gems/spree-c364b63e4f1f/core/lib/spree/core/engine.rb:41:in `block in <class:Engine>'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `instance_exec'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `run'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `each'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `run_initializers'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:136:in `initialize!'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/config/environment.rb:5:in `<top (required)>'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:103:in `require_environment!'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/opt/rh/ruby193/root/usr/bin/ruby /var/lib...]
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/var/lib/openshift/5259431c50044607ea000057/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
An error occurred executing 'gear postreceive' (exit code: 1)
Error message: Failed to execute: 'control deploy' for /var/lib/openshift/5259431c50044607ea000057/ruby

For more details about the problem, try running the command again with the '--trace' option.
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/rest/client.rb:59:in `request'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/rest/client.rb:49:in `each'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/rest/client.rb:49:in `request'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/rest/base.rb:25:in `rest_method'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/rest/domain.rb:27:in `add_application'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/commands/app.rb:354:in `create_app'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/commands/app.rb:84:in `create'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/helpers.rb:399:in `call'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/helpers.rb:399:in `section'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/helpers.rb:413:in `paragraph'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/commands/app.rb:79:in `create'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/commands.rb:201:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/commands.rb:201:in `execute'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/commands.rb:192:in `to_commander'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/command_runner.rb:95:in `run!'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/lib/rhc/cli.rb:42:in `start'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.4.8/bin/rhc:18
	from /usr/bin/rhc:19:in `load'
	from /usr/bin/rhc:19
$

Comment 1 Jakub Hadvig 2013-10-14 14:09:00 UTC
The problem is that with merge: 

https://github.com/sarupbanskota/OpenShift-Quickstart-for-Spree/commit/fda206b1d3296b8cbf47ff4ef9cea5d859cb1cb3

there was a lot of default spree images added into the quickstart spree repo.
So now when creating new spree app the creation ends unsuccessful because the asset precompile, with so many assets take too long and causes timeout.

The options are:

1, add marker like "enable_asset_precompile" and only then precompile the assets or put precompile the assets into the spree quickstart + edit the ruby cartridge so it will be able to detect whether some assets(css,js,images) are edited or added, and only then run the asset precompile

2, either remove the assets from the spree quickstart, but I thing that this isn't the way we want to go

3, maybe some other idea ?

Comment 2 Dan McPherson 2013-10-18 21:46:54 UTC
Unfortunately this is a known limitation that quickstarts that take longer than 4 mins to install are not compatible with --from-code.  Longer term we plan to remove the 4 min restriction.

-Dan