Skip to content

Instantly share code, notes, and snippets.

@BanzaiMan
Created July 11, 2013 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BanzaiMan/5978175 to your computer and use it in GitHub Desktop.
Save BanzaiMan/5978175 to your computer and use it in GitHub Desktop.
bx bin/rhc app create rails ruby-1.9 postgresql-9.2 --from-code https://github.com/BanzaiMan/openshift-rails-example-postgresql.git -s
cd rails
RAILS_ENV=production ./script/rails g scaffold articles title summary:text
git add .
git commit -m 'scaffold'
git push
## visit the app, add records
cd ..
bx bin/rhc snapshot save -a rails
## may need to clean up
bx bin/rhc app delete --confirm rails && rm -rf rails
bx bin/rhc app create rails84 ruby-1.9 postgresql-8.4 -s
bx bin/rhc snapshot restore -a rails84 -f rails.tar.gz
Restoring from snapshot rails.tar.gz...
Warning: Permanently added 'rails84-fooooooooooo.dev.rhcloud.com,54.242.224.179' (RSA) to the list of known hosts.
Removing old git repo: ~/git/rails84.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/rails84.git and ~/app-root/data
Restoring snapshot for postgresql-8.4 gear
cat: postgresql-8.4.tar.gz: No such file or directory
Removing old data dir: ~/app-root/data/*
Restoring ~/app-root/data
gzip: stdin: unexpected end of file
/bin/tar: Child returned status 1
/bin/tar: Error is not recoverable: exiting now
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:131:in `block (2 levels) in oo_spawn': Shell command '/bin/tar --strip=2 --overwrite -xmz ./
*/app-root/data --transform="s|${OPENSHIFT_GEAR_NAME}/data|app-root/data|" --transform="s|git/.*\.git|git/${OPENSHIFT_GEAR_NAME}.git|" --exclude="./*/app-root/runtime/data" --exclude="./*/postgresql/data" 1>&
2' returned an error. rc=2 (OpenShift::Runtime::Utils::ShellExecutionException)
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:94:in `pipe'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:94:in `pipe'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:94:in `block in oo_spawn'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:93:in `pipe'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:93:in `oo_spawn'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-container-selinux-0.0.6/lib/openshift/runtime/containerization/selinux_container.rb:289:in `run_in_container_context'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/model/application_container.rb:621:in `run_in_container_context'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:196:in `extract_restore_archive'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:137:in `restore'
from /usr/bin/gear:280:in `block (2 levels) in <main>'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:155:in `run'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:385:in `run_active_command'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:62:in `run!'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/delegates.rb:11:in `run!'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/import.rb:10:in `block in <top (required)>'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:131:in `block (2 levels) in oo_spawn': Shell command 'cat postgresql-8.4.tar.gz | /usr/bin/s
sh -q -o 'BatchMode=yes' -o 'StrictHostKeyChecking=no' -i $OPENSHIFT_APP_SSH_KEY 297046435558507264606208@297046435558507264606208-fooooooooooo.dev.rhcloud.com 'restore'' returned an error. rc=1 (OpenShift::
Runtime::Utils::ShellExecutionException)
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:94:in `pipe'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:94:in `block in oo_spawn'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:93:in `pipe'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/utils/shell_exec.rb:93:in `oo_spawn'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-container-selinux-0.0.6/lib/openshift/runtime/containerization/selinux_container.rb:289:in `run_in_container_context'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/model/application_container.rb:621:in `run_in_container_context'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:217:in `block in handle_scalable_restore'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:213:in `each'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:213:in `handle_scalable_restore'
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.11.8/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:140:in `restore'
from /usr/bin/gear:280:in `block (2 levels) in <main>'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:180:in `call'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/command.rb:155:in `run'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:385:in `run_active_command'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/runner.rb:62:in `run!'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/delegates.rb:11:in `run!'
from /opt/rh/ruby193/root/usr/share/gems/gems/commander-4.0.3/lib/commander/import.rb:10:in `block in <top (required)>'
Error in trying to restore snapshot. You can try to restore manually by running:
cat rails.tar.gz | ssh 186315934413041224908800@rails84-fooooooooooo.dev.rhcloud.com 'restore INCLUDE_GIT'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment