Description of problem: I have recently migrated my account to a new account with a different domain. In order to mantain my actual apps I have loged in with rhc tools to my old account and executed two successful snapshot save <appname>. After that I have loged out of my old app and loged in again to my new app, created same two apps with same gears and cartridges and executed snapshot restore <appname> <filename> without expected results. Specific results per app: * Scalable php 5.3 + mysql 5.1 snapshot save: OK snapshot restore: - Database restore OK - User data folder OK - Code restore NOOK. After restore, default openshift landing page is showing when access app url. * Scalable jboas7 + postgresql 9.2 snapshot save: OK snapshot restore: - Database restore NOOK. - User data folder NOOK. - Code restore NOOK. After long time executing rhc restore command doing restoring app-root data operation, ruby error pops out. Expected results: Have my app running as it was on my old openshift account automatically. Further actions: I have migrated my code manualy merging new app git repo with my existing external git repo (both cases) and restoring db with pgadmin doing a port-forward rhc command.
What were the exact commands you ran? What was the ruby error you saw? What OS and ruby version are you running rhc on?
1) What were the exact commands you ran? rhc setup -l <user> (old account) rhc snapshot save <appname> rhc logout rhc setup -l <user> (new account) created app jboss7 scalable with postgresql 9.2 via web console. rhc snapshot restore <appname> -f <local folder tar> 2) What was the ruby error you saw? Removing old data dir: ~/app-root/data/* Restoring ~/app-root/data /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:140:in `rescue in block (2 levels) in oo_spawn': Shell command '/bin/tar --strip=2 --overwrite -xmz ./*/app-root/data ./*/app-deployments --transform="s|${OPENSHIFT_GEAR_NAME}/data|app-root/data|" --transform="s|git/.*\.git|git/${OPENSHIFT_GEAR_NAME}.git|" --exclude="./*/app-root/runtime/data" --exclude="./*/jbossas/data" --exclude="./*/haproxy/data" 1>&2' exceeded timeout of 3596 (OpenShift::Runtime::Utils::ShellExecutionException) from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:123:in `block (2 levels) in oo_spawn' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:96:in `pipe' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:96:in `block in oo_spawn' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:95:in `pipe' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/utils/shell_exec.rb:95:in `oo_spawn' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-container-selinux-0.10.1/lib/openshift/runtime/containerization/selinux_container.rb:368:in `run_in_container_context' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/model/application_container.rb:795:in `run_in_container_context' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:259:in `extract_restore_archive' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.30.5/lib/openshift-origin-node/model/application_container_ext/snapshots.rb:162:in `restore' from /usr/bin/gear:585: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)>' 3) What OS and ruby version are you running rhc on? MACOS maveriks - ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
I could not reproduce this problem. The problem could be the restore times out because of size of snapshot. Can you take a look inside your tar file and see if there are any large files inside app-root/data?
That folder has an sql backup of 15 MB nothing else. But tar snapshot size has 328 MB. Where jbossas and app deployments are the biggest folders. I can see that snapshot includes jbossas/standalone/tmp folder of 121 MB. As an idea maybe you could exclude some unnecessary folders like this tmp and others inside app-deployments when generating the snapshot via snapshot save?
You can try setting a the timeout for the restore command to larger value (5 minutes or greater) and see if it works. rhc snapshot restore <appname> -f <local folder tar> --timeout 600
I have tested right now with timeout 600 but after a long time, same error as before. I suppose I could increase that timeout parameter but I don't know if this is an acceptable solution. Any other suggestions?
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/b906cc06f105f4895f97859024012e6d400d63c5 Bug 1147946 - Do not snapshot jboss*/standalone/tmp * Save time and diskspace by not snapshot'ing standalone/tmp. Content will be recreated when cartridge started during restore.
Test on devenv_5253 Both non-scaling and scaling apps in old account can be restored successfully to the new apps in new account with different domain. Move bug to verified.
Also test on mac os(ruby-2.0), issue could not be reproduced.